/* Global Variables */
var url = location.href;
var XEUrl = location.href;
var headerImage = '<table border="0" cellspacing="0" cellpadding="0" class="mainWidth"><tr><td class="sideWidth"><img src="http://www.xe.com/gen/images/clear.gif" width="15" height="1" /></td><td><img src="gen/images/printHeader.gif" alt="XE header" width="670" height="95" border="0" usemap="#MapHeader" /></td></tr></table>';
var headerPopImage = '<!--[if IE]><![if !IE]><![endif]-->  <table border="0" cellspacing="0" cellpadding="0" class="mainWidth">  <!--[if IE]><![endif]><![endif]--><!--[if lte IE 6]>  <table border="0" cellspacing="0" cellpadding="0" class="mainWidth" style="margin-top:-18px;"><![endif]--><tr><td class="sideWidth"><img src="http://www.xe.com/gen/images/clear.gif" width="15" height="1" /></td><td><img src="gen/images/printHeaderPop.gif" width="665" height="45" alt="XE header" /></td></tr></table>';

/*
  ------------------------------------
  Changes document element to suit browser
  ------------------------------------
*/
function browser(element){
	if (document.all){
		docElement = document.all.element;
	}else if (document.getElementById && !document.all){
		docElement = document.getElementById(element);
	}else if (document.layers){
		docElement = document.layers[element];
	}
}


function ad() {
	alert('hi');
	if (xmlhttp) {
		var url = 'adLeaderboard.php';
	  	xmlhttp.open("GET",url,true);
	  	xmlhttp.onreadystatechange=loadAd;
	  	xmlhttp.send(null)
	}
}
function loadAd() {
	browser("ad");
	if (xmlhttp.readyState==4) {
	  	docElement.innerHTML=xmlhttp.responseText;
	}
}

/*
  ------------------------------------
  Pop-up window for currency assitants
  ------------------------------------
*/
function PopAndBack()
    {
      CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=215,width=665');
      CurrencyWindow.focus();
      CurrencyWindow.location.href = win;
      history.back();
    }

/*
  ------------------------------------
  Focuses on the form element selected before refresh
  ------------------------------------
*/
function Reset60(URL) {
      xeRefresh=setTimeout("document.location.href=URL",60000);
    }

/*
  ------------------------------------
  General Pop-up Windows
  ------------------------------------
*/
function NewWindow(mypage, myname, w, h, scroll,amountFrom,to,template) {
	if (amountFrom != void 0 || to != void 0){
		  splitArray = amountFrom.split(' ');
		  if (template != void 0 ){
		  	convertPage = 'Amount=' + splitArray[0] + '&From=' + splitArray[1] + '&To=' + to + '&template=' + template;
		  }else{
			convertPage = 'Amount=' + splitArray[0] + '&From=' + splitArray[1] + '&To=' + to;
		  }
	  } else {
		  convertPage='';
	  }
	mypage = mypage + convertPage;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	win = window.open(mypage, myname, winprops);
}
function XENewWindow(mypage, myname, w, h, scroll,amountFrom,to,template) {
	if (amountFrom != void 0 || to != void 0){
		  splitArray = amountFrom.split(' ');
		  if (template != void 0 ){
		  	convertPage = 'Amount=' + splitArray[0] + '&From=' + splitArray[1] + '&To=' + to + '&template=' + template;
		  }else{
			convertPage = 'Amount=' + splitArray[0] + '&From=' + splitArray[1] + '&To=' + to;
		  }
	  } else {
		  convertPage='';
	  }
	mypage = mypage + convertPage;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable';
	win = window.open(mypage, myname, winprops);
}

/*
  ------------------------------------
  PVII Menu CSS Express Drop-Down Menu
  by Project Seven Development
  www.projectseven.com
  ------------------------------------
*/
function P7_ExpMenu(){ //v1.1.0.2 by PVII-www.projectseven.com
 if(navigator.appVersion.indexOf("MSIE")==-1){return;}
 var i,k,g,lg,r=/\s*p7hvr/,nn='',c,cs='p7hvr',bv='p7menubar';
 for(i=0;i<10;i++){g=document.getElementById(bv+nn);if(g){
 lg=g.getElementsByTagName("LI");if(lg){for(k=0;k<lg.length;k++){
 lg[k].onmouseover=function(){c=this.className;cl=(c)?c+' '+cs:cs;
 this.className=cl;};lg[k].onmouseout=function(){c=this.className;
 this.className=(c)?c.replace(r,''):'';};}}}nn=i+1;}
}