function ValidateForm(strForm)
{
	var x;
	var alertmsg;
	x=0;
	alertmsg = "The following fields are required: \n";
	if(strForm=="contactform")
	{
		if (document.getElementById("ename").value==""){alertmsg = alertmsg + "\nName";x = x + 1;}
		if (document.getElementById("eemail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
		if (document.getElementById("esubject").value==""){alertmsg = alertmsg + "\nSubject";x = x + 1;}
		if (document.getElementById("ebody").value==""){alertmsg = alertmsg + "\nBody";x = x + 1;}
	}
	if(strForm=="quoteform")
	{
		if (document.getElementById("ename").value==""){alertmsg = alertmsg + "\nName";x = x + 1;}
		if (document.getElementById("ephone").value==""){alertmsg = alertmsg + "\nPhone";x = x + 1;}
		if (document.getElementById("eemail").value==""){alertmsg = alertmsg + "\nEmail";x = x + 1;}
		if (document.getElementById("egroup").value==""){alertmsg = alertmsg + "\nName of Group";x = x + 1;}
	}
	if(x!=0){alert(alertmsg);return false;}
}
function SwapImage(objSrc,objName)
{
	document.getElementById(objSrc).src = "images/" + objName;
}
function ChangePhoto(strPhoto)
{
	document.getElementById('photo').src = "images/coaches/" + strPhoto;
}
function popup(mypage, myname, w, h, scroll) 
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) 
	{ 
		win.window.focus(); 
	}
}
function ValidateArticle()
{
	ValidateCode();
}
function ValidateCode()
{
	var date_now = new Date()
	var acode = document.getElementById("code").value;
	var cid = document.getElementById("cid").value;
	if(acode!="")
	{
		var xmlUrl = "include/codes.asp?code="+acode+"&id="+cid+"&dtnow="+date_now;
		createXMLHttpRequest();
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.open("GET",xmlUrl,true);
		xmlHttp.send(null);
	}
	else
	{
		CodeOk=false;
		alert("Please Verify the code");
		return false;
	}
}
