
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 MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 mm_preloadimages() { //v3.0
  var d=document; if(d.images){ if(!d.mm_p) d.mm_p=new Array();
    var i,j=d.mm_p.length,a=mm_preloadimages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.mm_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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];}
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

// 5. Show
// This shows a hidden object.

function Show(ob) {
	if (document.getElementById) {
		document.getElementById(ob).style.display = "block"
	} else if (document.all) {
		document.all.ob.style.display = "block"
	} else {
		document.ob.display ="block"
	}
}

// 6. Hide
// This hides an object.

function Hide(ob) {
	if (document.getElementById) {
		document.getElementById(ob).style.display = "none"
	} else if (document.all) {
		document.all.ob.style.display = "none"
	} else {
		document.ob.display = "none"
	}
}

function Check(ob) {
 	if (document.getElementById(ob).style.display == "none")
		Show(ob);
	else {
		Hide(ob);
	}
}
function check(ob) {
 	if (document.getElementById(ob).style.display == "none" || document.getElementById(ob).style.display == "")
		Show(ob);
	else {
		Hide(ob);
	}
}

function setClass(ob,cls) {
	if (document.getElementById) {
		document.getElementById(ob).className = cls
	} else if (document.all) {
		document.all.ob.className = cls
	} else {
		document.ob.className = cls
	}
}

function removeClass(ob,cls) {
	if (document.getElementById) {
		document.getElementById(ob).className = ""
	} else if (document.all) {
		document.all.ob.className = ""
	} else {
		document.ob.className = ""
	}
}

function checkClass(ob,cls) {
		if (document.getElementById(ob).className == cls)
			removeClass(ob,cls);
		else
			setClass(ob,cls);
}


function doPopups() {
	var links = document.getElementsByTagName("a");
	for (var i=0; i < links.length; i++) {
		if (links[i].title.match("popper")) {
			alert(links[i].href);
			mylink = links[i].href;
			links[i].onclick = function() {
				
				return false;
				/*
				var img = new Image();
				img.onload = function() {
					bob = window.open(mylink,'myWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=' + (img.width + 20) + ',height=' + (img.height + 20));
					bob.focus();
				}
				img.src = mylink;
				return false;*/
			}
		}
	}
	return false;
}

function doPopups2(evt) {
		alert (evt);
		return false;
}

// JavaScript Document
/**/
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("navFrame");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
  				}
  				node.onmouseout=function() {
  					this.className=this.className.replace(" over", "");
  				 }
  			 }
 		 }
 	}
}
//UNCOMMENT THE NEXT LINE TO TURN ON DROP_DOWN MENUS
window.onload=startList;

sfHover = function() {
	var sfEls = document.getElementById("navFrame").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

var isNav, isIE
var coll = ""
var styleObj = ""
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = false;
	} else {
		isIE = true;
		coll = "all.";
		styleObj = ".style";
	}
}

function getObjHeight(obj) {
	if(isNav) {
		return obj.clip.height;
	} else {
		return obj.clientHeight;
	}
}

function getInsideWindowHeight() {
	if(isNav) {
		return window.innerHeight;
	} else {
		return document.body.clientHeight;
	}
}

function getObjWidth(obj) {
	if(isNav) {
		return obj.clip.width;
	} else {
		return obj.clientWidth;
	}
}

function getInsideWindowWidth() {
	if(isNav) {
		return window.innerWidth;
	} else {
		return document.body.clientWidth;
	}
}

function shiftTo(obj,x,y) {
	if(isNav) {
		obj.moveTo(x,y);
	} else {
		obj.pixelLeft = x;
		obj.pixelTop = y;
	}
}

function centerIt(theOb) {
	var obj = "document." + coll + "bodyWrap" + styleObj;
	var contentObj = "document." + coll + "bodyWrap";
	alert(obj);
	var y = Math.round((getInsideWindowHeight()/2) - (getObjHeight(contentObj)/2));
	var x = Math.round((getInsideWindowWidth()/2) - (getObjWidth(contentObj)/2));
	shiftTo(obj,x,y)
	obj.visibility = "visible";
}

function handleResize() {
	if (isNav) {
		location.reload();
	} else {
		centerIt();
	}
}
