function hideLogin(){
	document.getElementById("loginWin1").style.display="none";
	document.getElementById("loginWin2").style.display="block";
}
function removeUN1(){
	if(document.getElementById("username1").value!="")document.getElementById("username1").style.background="#FFFFFF";
}
function removeUN(){
	document.getElementById("username1").style.background="#FFFFFF";
}
function addUN1(){
	if (document.getElementById("username1").value==""){document.getElementById("username1").style.background="url(/images/input_username.gif)"}
}
function removePW1(){
	document.getElementById("password1").style.background="#FFFFFF";
}
function addPW1(){
	if (document.getElementById("password1").value==""){document.getElementById("password1").style.background="url(/images/input_password.gif)"}
}
function checkLoginEnter(){
	e=window.event||window.Event;
	if(e.keyCode==13){
		runLogin();
	}
}
function runLogin(){
	if((document.getElementById("username1").value=="")||(document.getElementById("password1").value=="")){
		alert('Please fill out a Username and Password.');
	}else{
		document.cookie = 'myUserName=' + document.getElementById("username1").value + '; expires=Thu, 2 Aug 2099 20:47:11 UTC; path=/'
		newSSwin = window.open("/loginPopup.asp?ty=1","SS","status=no,resizable=yes,scrollbars=yes,width=400,height=300");
	}
}
function runChangePW(){
		newSSwin = window.open("/loginPopup.asp?ty=3","SS","status=no,resizable=yes,scrollbars=yes,width=400,height=300");
		setTimeout(checkPP,4000);
}
function checkPP(username){
	document.getElementById("loginButton").innerHTML = "<a href='javascript:runLogin();'><img src='/images/login_2.gif' border=0 alt='Login'></a>";//"<img id='btnLogin' onclick='runLogin();' border='0' style='cursor:pointer;' src='http://www.wirelessapplications.com/wac/images/test/Logon-Loginbtn02.gif' alt='Login'>";
	if(newSSwin == null){alert('We have detected that you may have a Popup Blocker.  Please check your browser settings.')}
	else{document.getElementById("usernamespan").innerHTML = username;}
}
function getXML() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	alert('Status: Cound not create XmlHttpRequest Object.  Consider upgrading your browser.');
	}
}
var sendXML = getXML();
function doLoadFeat(){
	sendXML.open("GET","homePage_feat.asp",true);
	sendXML.onreadystatechange=function (){if(sendXML.readyState==4){document.getElementById('featHolder').innerHTML = sendXML.responseText}};
	sendXML.send(null);
}

function tryitnow(){
	if((document.getElementById('tryitLat').value!='') && (document.getElementById('tryitLon').value!='') && (document.getElementById('tryitEmail').value!='')){
		document.getElementById('tryitNowFramer').src='/AHN/Crunch/tryItNow.asp?lat='+document.getElementById('tryitLat').value+'&lon='+document.getElementById('tryitLon').value+'&em='+document.getElementById('tryitEmail').value;
		alert('Your Sample site has been submitted, you will be emailed shortly with the results.');
	}else{alert('Please fill out a Lat, Lon and your email address.');}
}
function checkkeypress(){
	e=window.event||window.Event;
	var key;
	if(e.keyCode){key=e.keyCode;}else if(e.charCode){key=e.charCode;}
	//alert(e+", "+e.keyCode+", "+e.charCode+", "+key);
	if ((key >= 48 && key < 58) || (key == 46) || (key == 45))
		{e.returnValue = true;}
	else{e.returnValue = false;}
}