var ie = true;

if(navigator.appName == "Netscape") {
	ie = false;
}

function hide(objID) {
	if(ie){
		obj = document.getElementById(objID);

		if(obj.style.visibility!='hidden'){
			obj.style.visibility='hidden';
		}
	}
}

function show(objID) {
	if(ie){
		obj = document.getElementById(objID);

		if(obj.style.visibility!='visible'){
			obj.style.visibility='visible';
		}
	}
}


function verifySubmit(){
	var frmEmail = document.getElementById("frmContact");

	frmEmail.e_name.style.background = "#FFFFFF";
	frmEmail.e_email.style.background = "#FFFFFF";
	frmEmail.e_comment.style.background = "#FFFFFF";


	if(frmEmail.e_name.value==null || frmEmail.e_name.value==""){
		frmEmail.e_name.style.background = "#FFFFCC";
		alert("Name Required");
	}else if(frmEmail.e_email.value==null || frmEmail.e_email.value==""){
		frmEmail.e_email.style.background = "#FFFFCC";
		alert("Email Address Required");
	}else if(frmEmail.e_comment.value==null || frmEmail.e_comment.value==""){
		frmEmail.e_comment.style.background = "#FFFFCC";
		alert("Message Required");
	}else{
		frmEmail.submit();
	}
}




function onLoadEvents(){
	if (xmlhttp.readyState==4) {
		if (xmlhttp.status==200) {
				
				var response	= xmlhttp.responseXML.documentElement;

				/*
				var dateList	= response.getElementsByTagName('date'); //[0].firstChild.data;

				var strHTML		= "";

				for(var i=0; dateList!=null && i<dateList.length; i++){
					
					strDAY		= dateList[i].getElementsByTagName('day')[0].firstChild.data;
					intDAY		= parseInt(strDAY);

					eventList	= dateList[i].getElementsByTagName('event');

				
					for(var x=0; eventList!=null && x<eventList.length; x++){
						strTIME	= eventList[x].getElementsByTagName('time')[0].firstChild.data;
						strTITL	= eventList[x].getElementsByTagName('title')[0].firstChild.data;
						strDESC	= eventList[x].getElementsByTagName('desc')[0].firstChild.data;
						strSHOW = eventList[x].getElementsByTagName('showtime')[0].firstChild.data;
					}
			
				}
				*/

		}else{
			alert("Problem retrieving XML data")
		}
	}
}


function loadXML(url, fnc, async){
	xmlhttp=null;

	if (window.XMLHttpRequest) {
		xmlhttp=new XMLHttpRequest();
	}else if (window.ActiveXObject) {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlhttp!=null) {
		xmlhttp.onreadystatechange=fnc;
		xmlhttp.open("GET",url,async);
		xmlhttp.send(null);
	}else{
		alert("Your browser does not support XMLHTTP.");
	}
}

function signUpEmail(strEmail){
	if( strEmail.indexOf('@')==-1 ||
		strEmail.indexOf('.')==-1 ||
		strEmail.indexOf(' ')!=-1
		)
	{

			alert("Invalid Email Address");

	}else{
		document.getElementById("divSignUpEmail").innerHTML = "Adding Email Address...";

		loadXML("/notify.php?email="+strEmail, onSignUpEmail, true);
	}
}

function onSignUpEmail(){
	if (xmlhttp.readyState==4) {
		if (xmlhttp.status==200) {
				
				var response	= xmlhttp.responseXML.documentElement;
				var statsMSG	= response.getElementsByTagName('status')[0].firstChild.data;
				
				document.getElementById("divSignUpEmail").innerHTML = statsMSG;
		}else{
			alert("Problem retrieving XML data")
		}
	}
}
