//SWAP IMAGE
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function swapImage() {
	strImage = (arguments[1]=='on')?'style/images/leftmenu_r.gif':'style/images/leftmenu.gif';
	MM_swapImage(arguments[0],'',strImage,1)
}

function MM_homeMenu(targ,selObj,restore){ //v3.0
	if (selObj.selectedIndex == 4 || selObj.selectedIndex == 0 ) {
			eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		}
		else {
			window.open(selObj.options[selObj.selectedIndex].value,'new')
		}
  if (restore) selObj.selectedIndex=0;
	return false;
}



// Exit disclaimer
var popupWidth;
var popupHeight;

// check type size
function textSizeDetect() {
	var intTextSize = (document.layers)?document.layers["textsizedetect"]:(document.all)?document.all["textsizedetect"]:(document.getElementById)?document.getElementById("textsizedetect"):"";

	if (intTextSize) {
		 intTextSize = intTextSize.offsetHeight
	}
	if (intTextSize>14){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=240;
	} else if (intTextSize>12){
		//set the height and width of the popup
		popupWidth=220;
		popupHeight=220;
	} else{
		popupWidth=220;
		popupHeight=200;
	
	}
}


// get all links with the class name disclaimer and add to them
// an onclick event going to the disclaimer, and an onKeyPress event 
// going to the onClick event
function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("disclaimer")) {
      links[i].onclick = function() {
		textSizeDetect()
		window.open(this.href,'disclaimer','width='+popupWidth+',height='+popupHeight+',scrollbars=auto,resizable');
        return false;
      }
	  links[i].onkeypress = function(){
	  	verifyKey(this,'this.onclick();');
	  }
    }
  }
}
// Called in on index.asp
// window.onload = doPopups;