//window.onclick = getMousePos;
s_userAgent = window.navigator.userAgent
var isKON = (s_userAgent.indexOf("KHTML")>-1) ? 1 : 0;
posX = 0;
posY = 0;
function noneBlock(){
	a_arguments = noneBlock.arguments;
	for(var i=0;i < a_arguments.length;i++){
		a_nB = a_arguments[i].split("!");s_nBit = a_nB[0];i_nBdisplay = a_nB[1];
		o_showHide = document.getElementById(s_nBit)
		o_showHide.style.display = (i_nBdisplay==0) ? "none" : (i_nBdisplay==1) ? "block" : "inline";
	}
}

function showHide() {
	for(i=0;i < showHide.arguments.length;i++){
		o_showHide = document.getElementById(showHide.arguments[i])
		s_showHide = (o_showHide.style.display!="") ? o_showHide.style.display : "none";
		o_showHide.style.display = (s_showHide=="none") ? (o_showHide.nodeName=="SPAN") ? "inline" : "block" : "none";
	}
}

function visHidden() {
	for(i=0;i < visHidden.arguments.length;i++){
		o_visHidden = document.getElementById(visHidden.arguments[i])
		s_visHidden = (o_visHidden.style.visibility!="") ? o_visHidden.style.visibility : "visible";
		o_visHidden.style.visibility = (s_visHidden=="visible") ? "hidden" : "visible";
	}
}

function jump(menu){
var loc = menu[menu.selectedIndex].value.split("|");
if(loc.length == 2)
window.open(loc[1], loc[0]);
}
 

function cssSwitch(){
	a_cS = cssSwitch.arguments;
	for (i=0;i < a_cS.length;i++){
		a_cSsplit=(a_cS[i].indexOf("&")!=-1) ? a_cS[i].split("&"):a_cS[i].split("!");
		document.getElementById(a_cSsplit[0]).className = a_cSsplit[1];
	}
}

function cssSwitch2(s_cSValue){
			a_cS = s_cSValue.split("&");
			o_cS = document.getElementById(a_cS[0]);
			if (o_cS.style.display == "none"){
				document.getElementById(a_cS[1]).className = a_cS[3];
			}else{
				document.getElementById(a_cS[1]).className = a_cS[2];
			}
		}
function fltrObj(s_fOValue){
	a_fO = s_fOValue.split("|");document.getElementById(a_fO[0]).innerHTML = a_fO[1];
}		
function funSort(){
	a_fSarg = funSort.arguments;
	for (var i=0;i < a_fSarg.length;i++){
		(a_fSarg[i].indexOf("!") > 0) ? noneBlock(a_fSarg[i]) : (a_fSarg[i].indexOf("|") > 0) ? fltrObj(a_fSarg[i]) : cssSwitch(a_fSarg[i]);
	}
}
		
function chkOther(form) {
var reason=document.getElementById("reason")
var num_reason=reason.options[reason.selectedIndex].value
if (num_reason == "HE") {
  document.getElementById('otherReason').style.display='block' 
  }
else {
  document.getElementById('otherReason').style.display='none' }
}

function openHere() {
a_args=openHere.arguments;
 // method for loading content into the iframe
// assumes a_arg[1] is the iframe ID and a_arg[2] is the URL to load into that iframe and a_arg[3] is ID of div containing iframe
eval("window."+a_args[1]+".location.replace(a_args[2])");
o_content = document.getElementById("mainContent");
if (a_args[3]) o_div = document.getElementById(a_args[3]); //keep last
if (!o_content)o_content=0;
if (window.event) {
 yPos= window.event.clientY;xPos= window.event.clientX;
}else if(document.getElementById&&!document.all){
 xPos = a_args[0].clientX;yPos = a_args[0].clientY;
}else{
 xPos=0;yPos=0;
}
i_scrollAmount = (isKON) ? 0 : document.body.scrollTop;
o_div.style.top = yPos + 10-o_content.offsetTop + i_scrollAmount;
o_div.style.left = xPos + 10-o_content.offsetLeft;
o_div.style.visibility = "visible";  //used to be o_div.style.display = 'block';
}

function emailValue() {
	emailval = document.getElementById('email').value; // gets the value of the email field at time of focus
}

function clearVerify() {
	newemailval = document.getElementById('email').value; //get the value of the email field at time of the key press
	confemailval = document.getElementById('confemail').value; //get the value of the confirmation email field at time of key press
	if ((newemailval != emailval) && (confemailval != newemailval))document.getElementById('confemail').value = '';
}

var o_popurl = "#";var o_popwindow = 0;var b_popwindow = 1;
function checkpopUp(){
	b_popwindow = (o_popwindow) ? o_popwindow.closed : 1;
	if(b_popwindow) document.location = o_popurl;
	else o_popwindow.focus();
}
function popUp(s_url,s_name,s_attrib){
	o_popurl = s_url;
	o_popwindow = window.open(s_url,s_name,s_attrib);
	//setTimeout("checkpopUp()",500); //no longer implemented
}
// show/hide table rows
s_userAgent = window.navigator.userAgent
isIE = (navigator.userAgent.indexOf("MSIE")>-1) ? 1 : 0;
isWin = (navigator.userAgent.indexOf("Windows")>-1) ? 1 : 0;
isWinIE = (isWin&&isIE) ? 1 : 0;
function showrow(s_tableid){
o_table = document.getElementById(s_tableid)
a_tr = o_table.getElementsByTagName('tr');
	for(var i=0;i<a_tr.length;i++){
		if(a_tr[i].className=="hiderow")a_tr[i].style.display= (isWinIE) ? "inline" : "table-row";
	}
}
// use to disable links when "expanding"
function showrowlinks (o_link1,o_link2) {
o_link1.parentNode.innerHTML=o_link1.innerHTML;
o_link2.parentNode.innerHTML=o_link2.innerHTML;
}
function dataSwitchPhone(i_Select){
document.CheckoutForm.telephoneNumber.value = a_ccDisplay[i_Select];
document.CheckoutForm.telephoneNumberID.value = phoneIDs[i_Select];
}
function dataSwitchAlternatePhone(i_Select){
document.CheckoutForm.alternateTelephoneNumber.value = a_ccDisplay[i_Select];
document.CheckoutForm.alternateTelephoneNumberID.value = phoneIDs[i_Select];    
}
	
var o_slide;var i_slideH;var i_slidespeed;var i_slidedelay;var i_initslidedelay;var t_slidetimer=null;
function slideDiv(s_slideid,i_speed,i_delay,i_initdelay){
	o_slide = document.getElementById(s_slideid);i_slidespeed=i_speed;i_slidedelay=i_delay;
	i_initslidedelay=i_initdelay;
	i_slideH=o_slide.offsetHeight;
	t_slidetimer = setTimeout('doSlideDiv()',i_initslidedelay);
}
function doSlideDiv(){
	if(i_slideH>0){
		o_slide.style.height = i_slideH+"px";
		i_slideH-=i_slidespeed;
		t_slidetimer = setTimeout('doSlideDiv()',i_slidedelay);
	}else{
		i_slideH = 0;
		o_slide.style.height = "0px";
		o_slide.style.clip = "rect(auto auto 0px auto)";
		clearTimeout(t_slidetimer);
	}
}

function findairport(s_url,s_form,s_input){
	s_popurl = s_url;
	s_popurl+= "?formName="+document.getElementById(s_form).name+"&fieldName="+document.getElementById(s_input).name;
	o_popwindow = window.open(s_popurl,"airportlookup","height=300,width=450,scrollbars=yes");
	if(o_popwindow)o_popwindow.focus();
}

var s_multiclass = 0;
function multiroomchild(){
	var i_childs = 0;
	for(var i=0;i<i_rooms;i++){
		document.getElementById("room"+(i+1)).style.display="block";
		i_childs+=document.getElementById("f_child"+(i+1)).selectedIndex;
	}
	if(!s_multiclass)s_multiclass=document.getElementById("f_child1").parentNode.className;
	switch (i_childs){
		case 0:
			for(var i=0;i<i_maxrooms;i++)document.getElementById("f_child"+(i+1)).parentNode.className = s_multiclass;
			document.getElementById("paxChildAges").style.display = "none";
		break;
		default:
			for(var i=0;i<i_rooms;i++){
				s_class =document.getElementById("f_child"+(i+1)).parentNode.className; 
				s_class+=" formselect";
				document.getElementById("f_child"+(i+1)).parentNode.className=s_class;
			}
			a_childs = document.getElementById("paxChildAges").getElementsByTagName("div");
			for(var i=0;i<a_childs.length;i++)if(a_childs[i].className!="superclear")a_childs[i].style.display = (i<i_childs) ? "inline":"none";
			document.getElementById("paxChildAges").style.display = "block";
	}

}
function multirooms(s_rooms){
	o_rooms = document.getElementById(s_rooms);
	i_rooms = parseInt(o_rooms.options[o_rooms.selectedIndex].text);
	i_maxrooms = parseInt(o_rooms.options[o_rooms.options.length-1].text);
	for(var i=0;i<i_maxrooms;i++)document.getElementById("room"+(i+1)).style.display="none";
	for(var i=0;i<i_rooms;i++)document.getElementById("room"+(i+1)).style.display="block";
	if(document.getElementById("paxChildAges"))multiroomchild();
}