function checkEmail()
	{
	var strEmail, strError, countAtRate, countDot, i;
	var checkAtRate, checkDot;
	var ValidChars,CountValidChars;
	ValidChars="abcdefghijklmnopqrstuvwxyz0123456789_.@ABCDEFGHIJKLMNOPQRSTUVWXYZ-";
	strEmail = checkEmail.arguments[0];
	countAtRate=0;
	countDot=0;
	CountValidChars=0;
	if (strEmail.length >= 7)
		{
		for(i=0;i<strEmail.length;i++)
			{
			if(strEmail.charAt(i)=="@")
				countAtRate++;
			if(strEmail.charAt(i)==".")
				countDot++;
			CountValidChars=0;
			for(j=0;j<ValidChars.length;j++)
				{
				if(strEmail.charAt(i)==ValidChars.charAt(j))
					{
					CountValidChars++;
					}
				}
			if(CountValidChars==0)
				{
				strError=0;
				break;
				}
			}
		}
	checkAtRate=strEmail.indexOf("@",1);
	checkDot=strEmail.indexOf(".",1);
	for(i=1;i<countDot;i++)
		checkDot=strEmail.indexOf(".",checkDot+1);
	if(countAtRate==1 && countDot > 0 && strEmail.length >=7 && strError != 0)
		strError=1;
	else
		strError=0;
	if(checkDot>=strEmail.length-2)
		strError=0;
	if(strEmail.charAt(0)=="@" || strEmail.charAt(strEmail.length-1)=="@")
		strError=0;
	if(strEmail.charAt(0)=="." || strEmail.charAt(strEmail.length-1)==".")
		strError=0;
	if(checkDot < checkAtRate)
		strError=0;

	return strError;
}

function validateclient()
{
	var strError="";
	if(document.frm.fname.value=="")
	  strError=strError+"\nFirst Name";
	if(document.frm.lname.value=="")
	  strError=strError+"\nLast Name";		
	if(document.frm.email.value=="")
	  strError=strError+"\nEmail";
	if(document.frm.email.value!=""){  
	  if(checkEmail(document.frm.email.value)==0)
	    strError=strError+"\nInvalid Email";		
	  }  
	if(document.frm.workphone.value=="")
	  strError=strError+"\nWork Phone";
	if(strError!=""){
	  alert("Check the missing fields:\n=========================="+strError);
	  return false;
	}
	else {
	  return true;
	}
}

function RegisterClient()
{
	var strError="";
	if(document.frm.fname.value=="")
	  strError=strError+"\nFirst Name";
	if(document.frm.lname.value=="")
	  strError=strError+"\nLast Name";		
	if(document.frm.email.value=="")
	  strError=strError+"\nEmail";
	if(document.frm.email.value!=""){  
	  if(checkEmail(document.frm.email.value)==0)
	    strError=strError+"\nInvalid Email";		
	  }  
	if(document.frm.workphone.value=="")
	  strError=strError+"\nWork Phone";
	if(document.frm.txtusername.value=="")
	  strError=strError+"\nUser Name";	  
	if(document.frm.txtpassword.value=="")
	  strError=strError+"\nPassword";	  
	if(strError!=""){
	  alert("Check the missing fields:\n=========================="+strError);
	  return false;
	}
	else {
	  return true;
	}
}

function validatecard()
{
	var strError="";
	if(document.frm.name.value=="")
	  strError=strError+"\nName";
	if(document.frm.cardtype.value=="")
	  strError=strError+"\nCard Type";		  
	if(document.frm.cardnumber.value=="")
	  strError=strError+"\nCard Number";		
	if(strError!=""){
	  alert("Check the missing fields:\n=========================="+strError);
	  return false;
	}
	else {
	  return true;
	}
}

function Shipping()
{
	var strError="";
	if(document.frm.fname.value=="")
	  strError=strError+"\nFirst Name";
	if(document.frm.lname.value=="")
	  strError=strError+"\nLast Name";		
	if(document.frm.email.value=="")
	  strError=strError+"\nEmail";
	if(document.frm.email.value!=""){  
	  if(checkEmail(document.frm.email.value)==0)
	    strError=strError+"\nInvalid Email";		
	  }  
	if(document.frm.workphone.value=="")
	  strError=strError+"\nWork Phone";
	if(document.frm.name.value=="")
	  strError=strError+"\nName";
	if(document.frm.name.value=="")
	  strError=strError+"\nName on Card";	  	  
	if(document.frm.cardtype.value=="")
	  strError=strError+"\nCard Type";		  
	if(document.frm.cardnumber.value=="")
	  strError=strError+"\nCard Number";		  
	if(strError!=""){
	  alert("Check the missing fields:\n=========================="+strError);
	  return false;
	}
	else {
	  return true;
	}
}

function changepassword()
{
	var strError="";
	if(document.frm.oldpassword.value=="")
	  strError=strError+"\nOld Password";
	if(document.frm.newpassword.value=="")
	  strError=strError+"\nNew Password";		  
	if((document.frm.cpassword.value)!=(document.frm.newpassword.value))
	  strError=strError+"\nPassword Mismatched";		
	if(strError!=""){
	  alert("Check the missing fields:\n=========================="+strError);
	  return false;
	}
	else {
	  return true;
	}
}

function frmDel()
{
if (confirm("Are you sure to delete?")==true)
	{
	document.frm.method="Post";
	document.frm.action=frmDel.arguments[0];
	document.frm.submit();
	}
}

function viewdetail(val){
  window.open(val,"mywindow","location=0,status=1,scrollbars=1,resizable=1,width=400,height=400");
}

function check(){
  var strError="";
  if(document.frmLogin.txtusername.value=="")
    strError=strError+"\nUsername";
  if(document.frmLogin.txtpassword.value=="")
    strError=strError+"\nPassword";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validateaboutus(){
  document.forms.frm.elements.txtaboutus.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtaboutus.value=="")
    strError=strError+"\nAbout Us";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatecontactus(){
  document.forms.frm.elements.txtcontactus.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtcontactus.value=="")
    strError=strError+"\nContact Us";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatesupport(){
  document.forms.frm.elements.txtsupport.value = oEdit1.getHTMLBody();
  //alert(document.frm.txtsupport.value);
  var strError="";
  if(document.frm.txtsupport.value=="")
    strError=strError+"\nSupport";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validateservices(){
  document.forms.frm.elements.txtservices.value = oEdit1.getHTMLBody();
  //alert(document.forms.frm.txtservices.value);
  //return false;
  var strError="";
  if(document.frm.txtservices.value=="")
    strError=strError+"\nServices";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatewelcome(){
  document.forms.frm.elements.txtwelcome.value = oEdit1.getHTMLBody();
  alert(document.forms.frm.elements.txtwelcome.value);
  return false;
  //alert(document.forms.frm.txtservices.value);
  var strError="";
  if(document.frm.txtwelcome.value=="")
    strError=strError+"\nWelcome";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatereason(){
  document.forms.frm.elements.txtreason.value = oEdit1.getHTMLBody();
  //alert(document.forms.frm.txtservices.value);
  var strError="";
  if(document.frm.txtreason.value=="")
    strError=strError+"\nReason";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validateclientlink(){
  document.forms.frm.elements.txtclientlink.value = oEdit1.getHTMLBody();
  //alert(document.forms.frm.txtservices.value);
  var strError="";
  if(document.frm.txtclientlink.value=="")
    strError=strError+"\nClients";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatedownload(){
  document.forms.frm.elements.txtdownload.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtdownload.value=="")
    strError=strError+"\nDownloads";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatesendmail(){
  var strError="";
  if(document.frm.txtname.value=="")
    strError=strError+"\nName";
  if(document.frm.txtphone.value=="")
    strError=strError+"\nPhone";    
  if(document.frm.txtemail.value=="")
    strError=strError+"\nEmail";
  if(document.frm.txtemail.value!=""){  
    if(checkEmail(document.frm.txtemail.value)==0)
      strError=strError+"\nInvalid Email";		
    }
  if(document.frm.txtsubject.value=="")
    strError=strError+"\nSubject";    
  if(document.frm.txtenquiry.value=="")
    strError=strError+"\nEnquiry";    
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validateprivacy(){
  document.forms.frm.elements.txtprivacy.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtprivacy.value=="")
    strError=strError+"\nPrivacy";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validateterms(){
  document.forms.frm.elements.txtterms.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtterms.value=="")
    strError=strError+"\nTerms";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatead(){
  var strError="";
  if(document.frm.txtnametype.value=="")
    strError=strError+"\nName";
  //if(document.frm.filename_old.value=="")
  //  strError=strError+"\nSelect File";    
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validaterecentupdates(){
  document.forms.frm.elements.txtdetails.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtheading.value=="")
    strError=strError+"\nHeading";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}

function validatespecialoffer(){
  document.forms.frm.elements.txtdetails.value = oEdit1.getHTMLBody();
  var strError="";
  if(document.frm.txtheading.value=="")
    strError=strError+"\nHeading";
  if(strError!=""){
    alert("Check the missing fields:\n=========================="+strError);
    return false;
  }
  else {
    return true;
  }
}
