function localDate()
{
	var d=new Date()
	var strTime=""
	var strDate=""
	var strPad=""
	var strInd=""
	var strMins=""
	var strSecs=""
	var dayname=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
	var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
	
	strPad = "&nbsp;&nbsp;&nbsp;"
	if (d.getSeconds() < 10)
	{strSecs = "0" + d.getSeconds()}
	else
	{strSecs = d.getSeconds()}
	if (d.getMinutes() < 10)
	{strMins = "0" + d.getMinutes()}
	else
	{strMins = d.getMinutes()}
	
	if (d.getHours()> 12)
	{strInd=[d.getHours()-12] + ":"+ strMins+":"+strSecs+"&nbsp;PM&nbsp;&nbsp;"}
	else
	{strInd=d.getHours() + ":"+ strMins+":"+strSecs+"&nbsp;AM&nbsp;&nbsp;"}
	
	

	strDate=strInd
	document.getElementById("clock").innerHTML=strDate
}
function showDate()
{
localDate()
setTimeout("showDate()", 1000)
}
function notYet()
{
alert("Sorry, this module is not available yet")
}
function checkEmailValid(emailStr,msg)
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var errMsg="";   
	var matchArray=emailStr.match(emailPat)

	if (matchArray==null) 
	{
	   errMsg=errMsg+"The "+msg+" eMail Address seems incorrect";
	   return errMsg;
	}
	else
	{
	  var user=matchArray[1]
	  var domain=matchArray[2]
	  if (user.match(userPat)==null) 
	  {
		errMsg=errMsg+"The "+msg+" eMail Address seems incorrect";
		return errMsg;       
	  }
	  var IPArray=domain.match(ipDomainPat)
	  if (IPArray!=null) 
	  {
		  for (var i=1;i<=4;i++) 
			  {
			if (IPArray[i]>255) 
				{
				errMsg=errMsg+"The "+msg+" eMail Address seems incorrect";
				return errMsg;
				}//IF
			  }//for
	   }//IP Array
	   var domainArray=domain.match(domainPat)
	   if (domainArray==null) 
	   {
		 errMsg=errMsg+"The "+msg+" eMail Address seems incorrect";
		 return errMsg;
	   }
	   var atomPat=new RegExp(atom,"g")
	   var domArr=domain.match(atomPat)
	   var len=domArr.length
	   if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	   {
		 errMsg=errMsg+"The "+msg+" eMail Address seems incorrect";
		 return errMsg;	
	   } 
	   if (len<2) 
	   {
		 errMsg=errMsg+"The "+msg+" eMmail Address seems incorrect";
		 return errMsg;	 
	   } 
	 }//End  Match
	return "0";
}

function checkDataEntry(obj)
{
	var mycode
	var count=0;
	if(obj.length!=0)
	{
		for(i=0; i<obj.length; i++)
		{
			mycode = obj.charCodeAt(i);
			if((mycode>47 && mycode<58) || (mycode>64 && mycode<91) || (mycode>96 && mycode<123))
			{
				count=count+1;
			}
		}
	}
	return count;
}

function checkContactUs()
{
	if(checkDataEntry(document.frmData.strContactName.value)==0)
	{
		alert("Your Contact Name is required");
		return false;
	}

	var e=document.frmData.strEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Your eMail Address is required");
		return false;
	}
	else
	{
		if (checkEmailValid(e) !="0") 
		{
			alert(checkEmailValid(e,''));
			return false;	
		}
	}
	if(checkDataEntry(document.frmData.strMessage.value)==0)
	{
		alert("Your Message is required");
		return false;
	}	
	return true;
}

function checkMenuRequest()
{
	if(checkDataEntry(document.frmData.strContactName.value)==0)
	{
		alert("Your Contact Name is required");
		return false;
	}
	if(checkDataEntry(document.frmData.strTelephone.value)==0)
	{
		alert("Your Telephone Number is required");
		return false;
	}
	if(checkDataEntry(document.frmData.strAddress.value)==0)
	{
		alert("Your Address is required");
		return false;
	}
	return true;
}

function checkTellFriend()
{
	if(checkDataEntry(document.frmData.strFriendName.value)==0)
	{
		alert("Your Friend's Name is required");
		return false;
	}
	var e=document.frmData.strFriendEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Your Friend's eMail Address is required");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Friend'));
			return false;	
		}
	}	
	if(checkDataEntry(document.frmData.strYourName.value)==0)
	{
		alert("Your Name is required");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("Your eMail Address is required");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your'));
			return false;	
		}
	}	
	return true;
}

function checkMemberSignIn()
{
	var e=document.frmData.strUserName.value;
	if(checkDataEntry(e)==0)
	{
		alert("The eMail Address is required");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		} 
	}
	if(checkDataEntry(document.frmData.strSword.value)==0)
	{
		alert("The Password is required");
		return false;
	}
	return true;
}

function checkMemberPassword()
{
	var e=document.frmData.strEmail.value;
	if(checkDataEntry(e)==0)
	{
		alert("The eMail Address is required");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		} 
	}
	return true;
}
