//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" : (i_nBdisplay==2) ? "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(s_cSValue){
	a_cS = s_cSValue.split("&");
	document.getElementById(a_cS[0]).className = a_cS[1];
} 01/06/05*/

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 on_load(){
document.getElementById("popupIframe").src = ""
}

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

    /* see if the email field has changed.  
	** If so, see if the email field value matches what's currently in the conf email field.  
	** If it doesn't (i.e. it's new), clear the confirmation field. 
	** -PB  */
	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);
}
// 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];    
}	
