<!--

/* AJAX FUNCTIONS */

	function ajaxFunction() {
		var xmlHttp;
		try { xmlHttp=new XMLHttpRequest(); }  // Firefox, Opera 8.0+, Safari
		catch (e) {
			try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } // Internet Explorer
			catch (e) {
				try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); }
				catch (e) {
					alert("Your browser does not support AJAX!");
					return false;
				}
			}
		}
		return xmlHttp;
	}
	
	function setNav(val) {
		var ajx = ajaxFunction();
		ajx.onreadystatechange=function() {
			if(ajx.readyState==4) {
				//alert(ajx.responseText);
			}
		}
		ajx.open("GET", val, true);
		ajx.send(null);
	}


/* end AJAX  */

/* AUTO-add bookmark to browser */
	function addBookmark(siteAddress,siteName)	{
		if(window.sidebar) {
			window.sidebar.addPanel(siteName, siteAddress,"");
		}	else if(document.all)	{
				window.external.AddFavorite(siteAddress,siteName);
		}	else if(window.opera && window.print)	{
				return true;
		}
		return false;
	}
	
	function hideLoginSpans() {
		document.getElementById('loginMainText').style.height='485px';
		document.getElementById('loginPassHint').style.display='none';
		document.getElementById('loginCustNumRetrieve').style.display='none';
		document.getElementById('loginResetPass').style.display='none';
		return true;
	}
	
	function showObj(val) {
		if(document.getElementById(val)) {
			var x=document.getElementById(val);
			x.style.display='';
			return true;
		}
		return false;
	}
	
	function hideObj(val) {
		if(document.getElementById(val)) {
			var x=document.getElementById(val);
			x.style.display='none';
			return true;
		}
		return false;
	}
	
	function showHideObj(val) {
		if(document.getElementById(val)) {
			var x=document.getElementById(val);
			if(x.style.display=='') {
				x.style.display='none';
			} else {
				x.style.display='';
			}
			return true;
		}
		return false;
	}
	
	/** validates the PIN entered in the join form **/
	function validatePin(val) {
		if(val.length==4) {
			// check for sequence or 4 of a kind
		}
		return true;
	}
	
	function imgPop(mylink , windowname, x, y, scr) {
		if(!window.focus) return true;
		var href;
		href=mylink;
		var newWin;
		newWin = window.open(href, windowname, 'width=' + x +',height=' + y + ',scrollbars=' + scr + '');
		newWin.focus();
		return false;
	}
	
	/**  prints the contents of the element passed into 'val' **/
	function clickPrint(val) { 
		if(document.getElementById(val)) {
			var disp_setting="toolbar=no,location=no,directories=no,menubar=no,statusbar=no,"; 
			disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
			var content_vlue = document.getElementById(val).innerHTML;
			var docprint=window.open("","",disp_setting); 
			docprint.document.open(); 
			docprint.document.write("<html><head><link rel='stylesheet' type='text/css' href='scripts/cal_style.css' />"); 
			docprint.document.write('</head><body onLoad="self.print()" style="background-color:white;">');
			docprint.document.write(content_vlue);          
			docprint.document.write('</body></html>'); 
			docprint.document.close(); 
			docprint.focus(); 
		}
	}
	
	/** set date to first id passed in the 0000-00-00 format **/
	function setStrDate(val, yr, mon, day) {
		if(document.getElementById(val) && document.getElementById(yr) && 
			document.getElementById(mon) && document.getElementById(day)) {
				yr = document.getElementById(yr).value;
				mon = document.getElementById(mon).value;
				day = document.getElementById(day).value;
				if(yr.length!=4) yr='2000';
				if(mon.length!=2) mon='01';
				if(day.length!=2) day='01';
				document.getElementById(val).value = yr + '-' + mon + '-' + day;
				return true;
		}
		return false;
	}
	
	/**************  create popups  **************/
	
	/** creates an iframe box with page info(an) inside it. **/
	function show_box(an, width, height, borderStyle) {
		var href = an;
		var boxdiv = document.getElementById(href);
		if (boxdiv != null) {
			if (boxdiv.style.display=='none') {
				move_box(an, boxdiv);
				boxdiv.style.display='block';
			} else {
				boxdiv.style.display='none';
			}
			return false;
		}
		
		boxdiv = document.createElement('div');
		boxdiv.setAttribute('id', href);
		boxdiv.style.display = 'block';
		boxdiv.style.position = 'absolute';
		boxdiv.style.width = width + 'px';
		boxdiv.style.height = height + 'px';
		boxdiv.style.border = borderStyle;
		boxdiv.style.backgroundColor = '#fff';

		var contents = document.createElement('iframe');
		contents.scrolling = 'no';
		contents.frameBorder = '0';
		contents.style.width = width + 'px';
		contents.style.height = height + 'px';
		contents.src = href;

		boxdiv.appendChild(contents);
		document.body.appendChild(boxdiv);
		move_box(an, boxdiv);
		return false;
	}

	/** works primarily with show_box function above **/
	function move_box(an, box) {
		if (document.all) {
			var cleft = 150;
			var ctop = -120;
		} else {
			var cleft = 300;
			var ctop = -85;
		}
		var obj = an;
		while (obj.offsetParent) {
			cleft += obj.offsetLeft;
			ctop += obj.offsetTop;
			obj = obj.offsetParent;
		}
		box.style.left = cleft + 'px';
		ctop += an.offsetHeight + 8;
		if (document.body.currentStyle && document.body.currentStyle['marginTop']) {
			ctop += parseInt(document.body.currentStyle['marginTop']);
		}
		box.style.top = ctop + 'px';
	}

	function popup(mylink, winName, scroll, x, y) {
		if(! window.focus) return true;
		var href;
		if(typeof(mylink) == 'string') {
			href=mylink;
		} else {
			href=mylink.href;
		}
		window.open(href, winName, 'width=' + x +',height=' + y +',location=no,status=no,resizable=yes,scrollbars=' + scroll + '');
		return false;
	}


-->