/* change the opacity for different browsers */function changeOpacity (opacity,id) {    var object = document.getElementById(id).style;    object.opacity = (opacity / 100);    object.MozOpacity = (opacity / 100);    object.KhtmlOpacity = (opacity / 100);    object.filter = "alpha(opacity=" + opacity + ")";}/* swap visibilty of object */function changeVisibility (objectID, newVisibility) {	var styleObject = getStyleObject(objectID);	if (styleObject) {		styleObject.visibility = newVisibility;		return true;	} else {		return false;	}} function checkEmail (email, invalidaddress) {	var testresults;	var invalidcheck = 0;	var str = email;	var filter = /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;	if (filter.test(str)) {		var tempstring = str.split("@");		tempstring = tempstring[1].split(".");		if (invalidaddress != null) {			for (i=0; i<invalidaddress.length; i++){				if (tempstring[0]==invalidaddress[i]) invalidcheck = 1;			}		}		if (invalidcheck != 1) return true;		else return false;	} else return false;}/* get browser size */function getWindowSize() {	if (parseInt(navigator.appVersion)>3) {		if (navigator.appName=="Netscape") {			winW = window.innerWidth;			winH = window.innerHeight;		}		if (navigator.appName.indexOf("Microsoft")!=-1) {			winW = document.body.offsetWidth;			winH = document.body.offsetHeight;		}	}	return new Array(winW,winH);}/* find specifed objects left offset */function getLeft (ele) { 	var elem = MM_findObj(ele);	xPos     = elem.offsetLeft; 	tempEl   = elem.offsetParent; 	while (tempEl != null) { 		xPos  += tempEl.offsetLeft; 		tempEl = tempEl.offsetParent; 	} 	return xPos;} // getleft/* check query variable in url */function getQueryVariable (variable) {	var query = window.location.search.substring(1);	var vars = query.split("&");	for (var i=0;i<vars.length;i++) {		var pair = vars[i].split("=");		if (pair[0] == variable) return pair[1];	}}function getStyleObject (objectId) {	// cross-browser function to get an object's style object given its id  if(document.getElementById && document.getElementById(objectId)) {	// W3C DOM		return document.getElementById(objectId).style;  } else if (document.all && document.all(objectId)) {	// MSIE 4 DOM		return document.all(objectId).style;  } else if (document.layers && document.layers[objectId]) {	// NN 4 DOM.. note: this won't find nested layers		return document.layers[objectId];  } else {		return false;  }} // getStyleObject/* find specifed objects top offset */function getTop(ele) {	var elem = MM_findObj(ele);	var yPos = elem.offsetTop;	tempEl = elem.offsetParent;	while (tempEl != null) {		yPos  += tempEl.offsetTop;		tempEl = tempEl.offsetParent;	}	return yPos;} // gettop/* macromedia custom image rollover function */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_jumpMenu (targ,selObj,restore) { //v3.0  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");  if (restore) selObj.selectedIndex=0;}/* macromedia custom image rollover function */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_reloadPage (init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}/* macromedia custom image rollover function */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];}}/* macromedia custom image rollover function */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;}/* move a menu this is currently customized to make "drop-ups" instead of "drop-downs" */function move (objToMove, objRelativeTo, positionY, positionX, yo, xo) {	if (positionX == null) positionX = 'left';	if (positionY == null) positionY = 'top';	if (xo == null) xo = 0;	if (yo == null) yo = 0;	var x = 0;	var y = 0;	var styleObject = getStyleObject(objToMove);	if(styleObject) {		// find object's height		var objRef = MM_findObj(objToMove);		var objHeight = objRef.offsetHeight;		var objWidth = objRef.offsetWidth;		switch (positionY) {			case "bottom": 				y = getTop(objRelativeTo);				break;			case "top":				y = getTop(objRelativeTo) - objHeight ;				break;			case "middle":				y = getTop(objRelativeTo) - (objHeight/2);				break;		}		switch (positionX) {			case "left":				x = getLeft(objRelativeTo);				break;			case "center":				x = getLeft(objRelativeTo) - (objWidth/2);				break;			case "right":				x = getLeft(objRelativeTo) - objWidth;				break;		}		y = 36;		x += xo;		y += yo;		styleObject.left = x + 'px';		styleObject.top = y + 'px';		return true;	} else return false;}/* number only text field (seems to not work with "NUM" keys) */function numbersOnly (myfield, e, dec) {	var key;	var keychar;	if (window.event)  key = window.event.keyCode;	else if (e) key = e.which;	else return true;	keychar = String.fromCharCode(key);	if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) return true;	else if ((("0123456789").indexOf(keychar) > -1)) return true;	else if (dec && (keychar == ".")) {	   myfield.form.elements[dec].focus();	   return false;	} else return false;}/* animate opacity */function opacity (id, opacStart, opacEnd, millisec) {    //speed for each frame    var speed = Math.round(millisec / 100);    var timer = 0;    //determine the direction for the blending, if start and end are the same nothing happens    if(opacStart > opacEnd) {        for(i = opacStart; i >= opacEnd; i--) {            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));            timer++;        }    } else if(opacStart < opacEnd) {        for(i = opacStart; i <= opacEnd; i++)            {            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));            timer++;        }    }}/* open a centered popup */function popUp (url,width,height,title,scrollbar,resizable,center) {	//set defaults	if (width == null) width = 600;	if (height == null) height = 450;	if (title == null) title = 'auto_popup';	if (scrollbar == null) scrollbar = false;	if (resizable == null) resizable = false;	if (center == null) center = true;	//set props	scrollbar = scrollbar == true ? 'yes' : 'no';	resizable = resizable == true ? 'yes' : 'no';	winProperties = 'height='+height+',width='+width+',toolbar=no,location=no,scrollbars='+scrollbar+',titlebar=no,menubar=no,resizable='+resizable+',status=no';	//open and move	win = window.open(url,title, winProperties);	if (!win) alert('Please disable your popup blocker to use this site.');	else if (center) {		if (self.screen) {			sw = self.screen.width;			sh = self.screen.height;		} else return;		win.moveTo((sw-width)/2,(sh-height)/2);	}}/* resize flash object */ function resizeSWF (id,nWidth,nHeight) {	if (nWidth == null || !nWidth) nWidth = '';	if (nHeight == null || !nHeight) nHeight = '';	nWidth = nWidth.toString();	nHeight = nHeight.toString();	if (nWidth.length > 0) {		if (nWidth.substr(nWidth.length-2) != 'px' && nWidth.substr(nWidth.length-1) != '%') nWidth += "px";		document.getElementById(id).style.width = nWidth;		document.getElementById(id+'_div').style.width = nWidth;	}	if (nHeight.length > 0) {		//alert(nHeight);		if (nHeight.substr(nWidth.length-2) != 'px' && nHeight.substr(nWidth.length-1) != '%') nHeight += "px";		document.getElementById(id).style.height = nHeight;		document.getElementById(id+'_div').style.height = nHeight;	}}/* stop 100% flash movie from shrinking below a certain size */function swfSizeMin(swf_id,min_w,min_h) {	//set it up to update	window.onresize = function() {		swfSizeMin(swf_id,min_w,min_h)	}	//get window size	var sizes = getWindowSize();	var win_w = sizes[0];	var win_h = sizes[1];	//figure out what to set flash size to	if (win_w < min_w) var w = min_w;	else var w = "100%";	if (win_h < min_h) var h = min_h;	else var h = "100%";	//set the size	resizeSWF(swf_id,w,h);	}function toggleDisplay (obj_id, display_mode) {	if (document.getElementById) {		var obj = document.getElementById(obj_id);		if (display_mode != null) obj.style.display = display_mode;		else {			if (obj.style.display == 'none') obj.style.display = '';			else obj.style.display = 'none';		}		return obj.style.display;	}}	
