

function validatefaq()
{
	if (document.frmFaq.search.value == "")
	{
		alert("Enter text for search");
		document.frmFaq.search.focus();
		return false;
	}
	frmFaq.action="faqdetails.aspx?flag=2&search="+document.frmFaq.search.value;
	return true;
}

function ValidateContactUs()
{
 	var ErrMsg="";
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form1.Contactus2_txtEmail.value.match(emailPat);
	var ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	
	if(document.Form1.Contactus2_txtFname.value=="" )
	{
		alert("First name required\n");
		document.Form1.Contactus2_txtFname.focus();
		return false;
	}
	
	if(document.Form1.Contactus2_txtFname.value.charAt(0)==' ')
	{    alert("First name required"); 
		 document.Form1.Contactus2_txtFname.focus();
		 return false;
	 }
	
	if(document.Form1.Contactus2_txtEmail.value==""||document.Form1.Contactus2_txtEmail.value=="Enter your email.")
	{
	    alert("Email required");		
		document.Form1.Contactus2_txtEmail.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Invalid Email format");
		document.Form1.Contactus2_txtEmail.focus();
		return false;
	}
	
	 if(document.Form1.Contactus2_txtComments.value==""||document.Form1.Contactus2_txtComments.value=="Enter your comments here")
	{
	    alert("Comments required");
		document.Form1.Contactus2_txtComments.focus();
		return false;		
	}
	
	if(document.Form1.Contactus2_txtComments.value.charAt(0)==' ')
	{  
	    alert("No spaces allowed.");
	    document.Form1.Contactus2_txtComments.focus();
		return false;
    }
	if(document.Form1.Contactus2_txtComments.value.length > 250)
	 {
			alert("Please enter only 250 characters");
			document.Form1.Contactus2_txtComments.focus();
			return false; 
	 }
	 
	if(document.Form1.Contactus2_CodeNumberTextBox.value=="")
	{
		alert("Verification code required");
		document.Form1.Contactus2_CodeNumberTextBox.focus();
		return false;
	}
		return true;
	}

function ValidateFaqDetails()
{
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form1.TextBox2.value.match(emailPat);
	if(document.Form1.TextBox2.value=="")
	{
		alert("Email required");
		document.Form1.TextBox2.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Invalid Email format");
		document.Form1.TextBox2.focus();
		return false;
	}
	if(document.Form1.txtArea.value=="")
	{
		alert("Question required");
		document.Form1.txtArea.focus();
		return false;
	}
	return true;
}

function ValidateProfile()
{
	
 	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form2.Profile1_txtEmail.value.match(emailPat);
	if(document.Form2.Profile1_txtFName.value=="")
	{  
		alert("First name required");
		document.Form2.Profile1_txtFName.focus();
		return false;
	}
	if(document.Form2.Profile1_txtFName.value.charAt(0)==' ')
	{   alert("No spaces allowed.\n");
		document.Form2.Profile1_txtFName.focus();
		return false;
	}
	if(document.Form2.Profile1_txtUserName.value=="")
	{
		alert("User name required");
		document.Form2.Profile1_txtUserName.focus();
		return false;
	}
	if(document.Form2.Profile1_txtUserName.value.charAt(0)==' ')
	{   alert("No spaces allowed.\n");
		document.Form2.Profile1_txtUserName.focus();
		return false; 
    }
	if(document.Form2.Profile1_txtPassword.value=="")
	{
		alert("Password required");
		document.Form2.Profile1_txtPassword.focus();
		return false;
	}
	if(document.Form2.Profile1_txtPassword.value.charAt(0)==' ')
	{    alert("No spaces allowed.\n"); 
		document.Form2.Profile1_txtPassword.focus();
		return false;
	 }
	if(document.Form2.Profile1_txtEmail.value=="")
	{
		alert("Email required");
		document.Form2.Profile1_txtEmail.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Invalid Email format");
		document.Form2.Profile1_txtEmail.focus();
		return false;
	}
	
	if(document.Form2.Profile1_ddlCountry.value==".::Please Select::.")
	{
		alert("Country required");
		return false;
	}
	
	if(document.Form2.Profile1_txtAns.value=="")
	{
		alert("Answer required");
		document.Form2.Profile1_txtAns.focus();
		return false;
	}
	if(document.Form2.Profile1_txtAns.value.charAt(0)==' ')
	{    alert("No spaces allowed.\n");
	document.Form2.Profile1_txtAns.focus(); 
	return false;
	}
	return true;
	}
	
function loopy()
 {
		loc = window.location.href
		sPos =loc.lastIndexOf("/")+1;
		if (sPos != -1) loc = loc.substring(0,sPos); // loose existing search
		window.location = loc+'logout.aspx';
	}

function popup(url)
{
	width = 450;
	height = 345;
	xx = window.screen.width;
	yy = window.screen.height;
	xx = (xx/2) - (width/2);
	yy = (yy/2) - (height);
	style = 'left = ' +  xx + ',top = ' + yy + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
	newwindow=window.open(url,'name',style);
	if (window.focus) {newwindow.focus()}
}

function HeaderEmailValidation()
{
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray =document.newsletter.m_txtNewsLetter.value.match(emailPat);
	if(document.newsletter.m_txtNewsLetter.value=="")
	{
		alert("Enter Email address.");
		document.newsletter.m_txtNewsLetter.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Invalid Email format.");
		document.newsletter.m_txtNewsLetter.value="";
		document.newsletter.m_txtNewsLetter.focus();
		return false;
	}
	return true;
}


function HeaderLoginValidation()
{
	if(document.login.m_txtUserName.value==" "||document.login.m_txtUserName.value=="Username")
	{
		alert("Enter your username.");
		document.login.m_txtUserName.focus();
		return false;
	}
	
	if(document.login.m_txtPassword.value==" "||document.login.m_txtPassword.value=="Password")
	{
		alert("Enter your password.");
		document.login.m_txtPassword.focus();
		return false;
	}
	return true;
}

function HeaderSearchValidation()
{  
	if(document.Search.m_txtSearch.value==" "||document.Search.m_txtSearch.value=="Search Here")
	{
		alert("Enter search text.");		
		document.Search.m_txtSearch.focus();
		return false;
	}
	return true;
}
	function validateguestbook()
			{	
			  var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
				var matchArray = frmguest.txtemail.value.match(emailPat);					
				if (document.frmguest.txtfname.value == "")
				{
					alert("Enter User Name.");
					document.frmguest.txtfname.focus();
					return false;
				}					
				if (document.frmguest.txtemail.value=="")
				{
				   alert("Enter EmailId.");
					document.frmguest.txtemail.focus();
					return false;												
				}
				else if (matchArray == null)
				{	
				
						alert ("Please enter your valid email address.");
						document.frmguest.txtemail.focus();
				return false;			
				}					
				if (document.frmguest.txtComment.value == "")
				{
					alert("Enter Comment.");
					document.frmguest.txtComment.focus();
					return false;
				}					
					return true;
			}
			
function ValidateAddNewUser()
{  	var emailPat =/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form1.txt_EmailAdd.value.match(emailPat);
	var err, ErrorDisp, UrlPat;
    ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";

	if (document.Form1.txt_UserName.value=="")
	{ 
			alert("User name required.");
			document.Form1.txt_UserName.focus();
			return false;
	}
	if(document.Form1.txt_UserName.value.charAt(0)==' ')
	{  
	  alert("No spaces allowed.");
			document.Form1.txt_UserName.focus();
			return false;
	}
	if (document.Form1.txt_FirstName.value=="")
	{
		alert("First name required.");
		document.Form1.txt_FirstName.focus();
		return false;
 	}
	if(document.Form1.txt_FirstName.value.charAt(0)==' ')
	{ 
		alert("No spaces allowed.");
		document.Form1.txt_FirstName.focus();
		return false;
 	}
	if (document.Form1.txt_LastName.value=="")
	{ 
		alert("Last name required.");
		document.Form1.txt_LastName.focus();
		return false;
	}
	if(document.Form1.txt_LastName.value.charAt(0)==' ')
	{ 
		alert("No spaces allowed.");
		document.Form1.txt_LastName.focus();
		return false;
	 
	  }
	if (document.Form1.txt_DisplayName.value=="")
	{  
		alert("Display name required.");
		document.Form1.txt_DisplayName.focus();
		return false;
	}
	if(document.Form1.txt_DisplayName.value.charAt(0)==' ')
	{
		 alert("No spaces allowed.");
		document.Form1.txt_DisplayName.focus();
		return false;
	}
	if (document.Form1.txt_EmailAdd.value=="")
	{ 
		alert("Email required.");
		document.Form1.txt_EmailAdd.focus();
		return false;
	}
	else if (matchArray == null)
	{ 
		alert("Invalid Email format");
		document.Form1.txt_EmailAdd.focus();
		return false;
	 }
	if (document.Form1.txt_Password.value=="")
	{ alert("Password required.");
		document.Form1.txt_Password.focus();
		return false;
	  }
	if(document.Form1.txt_Password.value.charAt(0)==' ')
	{  
		alert("No spaces allowed.");
		document.Form1.txt_Password.focus();
		return false;
	}
	if(document.Form1.txt_ConfirmPass.value=="")
	{
		alert("Confirm Password required.");
		document.Form1.txt_ConfirmPass.focus();
		return false;
	}
	if (document.Form1.txt_Password.value!=document.Form1.txt_ConfirmPass.value)
	{
		alert("Password mismatch.");
		document.Form1.txt_ConfirmPass.focus();
		return false;
	}
	if (document.Form1.txt_question.value=="")
	{ 
		alert("Answer required.");
		document.Form1.txt_question.focus();
		return false;
	 }
	if(document.Form1.txt_question.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txt_question.focus();
		return false;
	}
	
	 return true; 
	
	}		

function MsgDeleteRecord()
{
	if(confirm("Are you sure to delete this record?"))
	{	
	return true;
	}
	return false; 
}

function ValidateChangePass()
{
	var err, ErrorDisp;
	err="";
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.txtExistingPass.value=="")
	{
		alert("Existing Password required.");
		document.Form1.txtExistingPass.focus();
		return false;
	}
	if (document.Form1.txtNewPass.value=="")
	{
		alert("New Password required.");
		document.Form1.txtNewPass.focus();
		return false;
	}
	if (document.Form1.txtNewPass.value!=document.Form1.txtConfirmPass.value)
	{
		alert("Password mismatch.");
		document.Form1.txtNewPass.focus();
		return false;
	}
	
		return true;

}	 

////   Client Manage
function ValidateClientManage()
{	

	var emailPat =/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form1.m_txtEmail.value.match(emailPat);
	var err, ErrorDisp, UrlPat;
	err="";
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.m_txtFirstName.value == "")
	{
		alert("Enter First Name.");
		document.Form1.m_txtFirstName.focus();
		return false;
	}
	if(document.Form1.m_txtFirstName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtFirstName.focus();
		return false;

	}
	if (document.Form1.m_txtUserName.value == "")
	{
		alert("Enter UserName.");
		document.Form1.m_txtUserName.focus();
		return false;
	}
	if(document.Form1.m_txtUserName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtUserName.focus();
		return false;
	
	}
	if (document.Form1.m_txtPassword.value == "")
	{
		alert("Enter Password.");
		document.Form1.m_txtPassword.focus();
		return false;
	}
	if(document.Form1.m_txtPassword.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtPassword.focus();
		return false;
	
	}
	if (document.Form1.m_txtEmail.value == "")
	{
		alert("Enter Email Id.");
		document.Form1.m_txtEmail.focus();
		return false;
	}
	else if (matchArray == null)
	{
		alert("Inavalid Email format.");
		document.Form1.m_txtEmail.focus();
		return false;
	}
	return true;
	}
	
	
	function ChkClientDeleteAll(checkAllBox)                      
	{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	k1=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgClient:_ctl'+k1+':m_chkdelete')
		{
			e.checked= ChkState;                        
			k1++;
		}
	}  
    }

function ChkClientActiveAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;    
	k=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgClient:_ctl'+k+':m_chkactive')
		{
			e.checked= ChkState;    
			k++;                    
		}
    }  
}

//for employee
function ChkEmployeeDeleteAll(checkAllBox)                      
	{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	k1=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='DataGrid1:_ctl'+k1+':m_chkdelete')
		{
			e.checked= ChkState;                        
			k1++;
		}
	}  
}

function ChkEmployeeActiveAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;    
	k=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='DataGrid1:_ctl'+k+':m_chkactive')
		{
			e.checked= ChkState;    
			k++;                    
		}
		
	}  
}
function ValidateCreatePage()
 {
  if (document.Form1.m_txtpagename.value == "")
	{
		alert("Enter Page Name");
		document.Form1.m_txtpagename.focus();
		return false;
	} 
	var is_space=document.Form1.m_txtpagename.value.indexOf(" ");
	if (is_space!=-1)
	{ 
		alert("Space is not allowed in Page Name.");
		document.Form1.m_txtpagename.focus();
		return false;
	}
	var pagePat = /^[A-Za-z0-9_]+$/				
	var matchArray = Form1.m_txtpagename.value.match(pagePat);
	if (matchArray == null)
	{
		strd="Page Name contains Only Alphabets.";
		alert (strd);						
		document.Form1.m_txtpagename.focus();
		return false;
	}
	if (document.Form1.m_txtpagetitle.value == "")
	{   
		alert("Enter Your Page Title.");
		document.Form1.m_txtpagetitle.focus();
		return false;
	}
	if(document.Form1.m_txtpagetitle.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtpagetitle.focus();
		return false;
	}
	if (document.Form1.m_txtmkey.value == "")
	{
		alert("Enter Your Meta Keyword.");
		document.Form1.m_txtmkey.focus();
		return false;
	}
	if(document.Form1.m_txtmkey.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtmkey.focus();
		return false;
	}
	if (document.Form1.m_txtmdesc.value == "")
	{
		alert("Enter Your Meta Description.");
		document.Form1.m_txtmdesc.focus();
		return false;
	}
	if(document.Form1.m_txtmdesc.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtmdesc.focus();
		return false;
	}
	return true;			
}
function limit(text,long) 
{
	var maxlength = new Number(long); 
	if (text.value.length > maxlength)
	{
		text.value = text.value.substring(0,maxlength);
		alert(" Only " + long + " chars");
		return false;
	}
	return true;
}


function ValidateMyProfile()
{
	var emailPat =/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var err, ErrorDisp;
	
	err="";
    ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	
	if (document.Form1.txtDisplayName.value=="")
	{
		alert("Display name required.");
		document.Form1.txtDisplayName.focus();
		return false;
	}
	if(document.Form1.txtDisplayName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtDisplayName.focus();
		return false;

	}
	if (document.Form1.txtFirstName.value=="")
	{
		alert("First name required.");
		document.Form1.txtFirstName.focus();
		return false;
	
	}
	if(document.Form1.txtFirstName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtFirstName.focus();
		return false;

	}
	if (document.Form1.txtEmail.value=="")
	{
		alert("Email required.");
		document.Form1.txtEmail.focus();
		return false;
	}
	
	else if (Form1.txtEmail.value.match(emailPat) == null)
	{
		alert("Inavalid Email format.");
		document.Form1.txtEmail.focus();
		return false;
	}
	return true;
}		
	 

function popup(url)
{
	width = 400;
	height = 345;
	xx = window.screen.width;
	yy = window.screen.height;
	xx = (xx/2) - (width/2);
	yy = (yy/2) - (height);
	style = 'left = ' +  xx + ',top = ' + yy + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
	newwindow=window.open(url,'name',style);
	if (window.focus) {newwindow.focus()}
}


function staffImagepopup(url)
{
	width = 500;
	height = 500;
	xx = window.screen.width;
	yy = window.screen.height;
	xx = (xx/2) - (width/2);
	yy = (yy/2) - (height);
	style = 'left = ' +  xx + ',top = ' + yy + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no';
	newwindow=window.open(url,'name',style);
	if (window.focus) {newwindow.focus()}
}

function ValidateStaffEditGen()
{
	
	var emailPat =/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = Form1.txtEmail.value.match(emailPat);
	var err, ErrorDisp, UrlPat;
	err="";
	
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	
	if(document.Form1.ddlDepartment.selectedIndex=="0")
	{	
		alert("Department required.");
		document.Form1.ddlDepartment.focus();
		return false;
	}
	
	if (document.Form1.txtStaffNo.value=="")
	{
		alert("Staff no required.");
		document.Form1.txtStaffNo.focus();
		return false;

	}
	if(document.Form1.txtStaffNo.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtStaffNo.focus();
		return false;

	}
	if (document.Form1.txtFName.value=="")
	{
		alert("First name required.");
		document.Form1.txtFName.focus();
		return false;
	}
	if(document.Form1.txtFName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtFName.focus();
		return false;
	
	}
	if (document.Form1.txtLName.value=="")
	{
		alert("Last name required.");
		document.Form1.txtLName.focus();
		return false;
	}
	if(document.Form1.txtLName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtLName.focus();
		return false;
	}
	if (document.Form1.txtEmail.value=="")
	{
		alert("Email required.");
		document.Form1.txtEmail.focus();
		return false;

	}
	else if (matchArray == null)
	{
		alert("Inavalid Email format.");
		document.Form1.txtEmail.focus();
		return false;

	}
	if (document.Form1.ddlGender.selectedIndex=="0")
	{
		alert("Select gender.");
		document.Form1.ddlGender.focus();
		return false;
	}
	if (document.Form1.txtDesignation.value=="")
	{
		alert("Designation required.");
		document.Form1.txtDesignation.focus();
		return false;
	}
	if(document.Form1.txtDesignation.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtDesignation.focus();
		return false;
	}
	if (document.Form1.txtDOB.value=="")
	{
		alert("Date of birth required.");
		document.Form1.txtDOB.focus();
		return false;
	}
	
	return true;
}

function ValidateStaffEditDep()
{
	var err, ErrorDisp;
	err="";
	
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.ddlBloodGroup.selectedIndex=="0")
	{
			alert("Select blood group.");
		document.Form1.ddlBloodGroup.focus();
		return false;
	}
	if (document.Form1.ddlCountry.selectedIndex=="0")
	{
		alert("Select country.");
		document.Form1.ddlCountry.focus();
		return false;
	
	}
	return true;
}

function ProcatManagevalidation()
{	
	var strd;
	if (document.Form1.m_txtCatName.value == "")
	{
		strd=document.Form1.MRF1.value;
		alert(strd);
		document.Form1.m_txtCatName.focus();
		return false;
	}
	if(document.Form1.m_txtCatName.value.charAt(0)==' ')
	{
		alert("Nospaces allowed.");
		document.Form1.m_txtCatName.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtSortOrder.value))
	{
		strd=document.Form1.MRF2.value;
		alert(strd);
		document.Form1.m_txtSortOrder.value="";
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	return true;
}
// color validation for site settings

function ValidateSiteSettings()
{
	var validChar='0123456789ABCDEF';
	var entry1=document.Form1.txtMenuActBgColor.value.toUpperCase();
	var entry2=document.Form1.txtMenuInactBgColor.value.toUpperCase();
	var entry3=document.Form1.txtMenuActFontColor.value.toUpperCase();
	var entry4=document.Form1.txtMenuInactFontColor.value.toUpperCase();
	var entry5=document.Form1.txtMenuBorderColor.value.toUpperCase();
	var UrlPat = /^[A-Za-z0-9_\-]+[.]+([A-Za-z0-9_\-]+)*[.]+([A-Za-z0-9_\-]+)$/	
	var emailPat =/^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchEmail = Form1.txtGEmail.value.match(emailPat);
	var strlen1=entry1.length;
	if(strlen1!=7)
	{
		alert("MenuActBgColor Entry must be EXACTLY 7 characters long");
		return false;
	}
	for (i=1;i<7;i++ )
	{
		if(validChar.indexOf(entry1.charAt(i))<0)
		{
			alert("MenuActBgColor Entry must be in RRGGBB hexcode format!");
			return false;
		}
	}
	
	if(entry1.charAt(0) != "#" )
	{
		alert("MenuActBgColor First Character should be # Sign"); 
		return false;
	}
	
	var strlen2=entry2.length;
	if(strlen2!=7)
	{
		alert("MenuInactBgColor Entry must be EXACTLY 7 characters long");
		return false;
	}
	
	for (i=1;i<7;i++ )
	{
		if(validChar.indexOf(entry2.charAt(i))<0)
		{
			alert("MenuInactBgColor Entry must be in RRGGBB hexcode format!");
			return false;
		}
	}
	
	if(entry2.charAt(0) != "#" )
	{
		alert("MenuInactBgColor First Character should be # Sign"); 
		return false;
	}
	
	var strlen3=entry3.length;
	if(strlen3!=7)
	{
		alert("MenuActFontColor Entry must be EXACTLY 7 characters long");
		return false;
	}
	for (i=1;i<7;i++ )
	{
		if(validChar.indexOf(entry3.charAt(i))<0)
		{
			alert("MenuActFontColor Entry must be in RRGGBB hexcode format!");
			return false;
		}
	}
	if(entry3.charAt(0) != "#" )
	{
		alert("MenuActFontColor First Character should be # Sign"); 
		return false;
	}	
	var strlen4=entry4.length;
	if(strlen4!=7)
	{
		alert("MenuInactFontColor Entry must be EXACTLY 7 characters long");
		return false;
	}
	for (i=1;i<7;i++ )
	{
		if(validChar.indexOf(entry4.charAt(i))<0)
		{
			alert("MenuInactFontColor Entry must be in RRGGBB hexcode format!");
			return false;
		}
	}
	if(entry4.charAt(0) != "#" )
	{
		alert("MenuInactFontColor First Character should be # Sign"); 
		return false;
	}	
	var strlen5=entry5.length;
	if(strlen5!=7)
	{
		alert("MenuBorderColor Entry must be EXACTLY 7 characters long");
		return false;
	}
	for (i=1;i<7;i++ )
	{
		if(validChar.indexOf(entry5.charAt(i))<0)
		{
			alert("MenuBorderColor Entry must be in RRGGBB hexcode format!");
			return false;
		}
	}
	if(entry5.charAt(0) != "#" )
	{
		alert("MenuBorderColor First Character should be # Sign"); 
		return false;
	}	
		if (document.Form1.txtGEmail.value=="")
	{
		alert("Admin Email can not be left empty.");
		return false;
	}
	else if(matchEmail== null)
	{
		alert("Invalid Email format.");
		return false;
	}
	
	if (document.Form1.txtGCopyRightText.value=="")
	{
		alert("Copyright field can not be left empty.");
		document.Form1.txtGCopyRightText.focus();
		return false;
	}
	if(document.Form1.txtGCopyRightText.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		return false;
	}
	if (document.Form1.txtGCycImgTrans.value=="")
	{
		alert("Cyclic image transition field can not be left empty.");
		document.Form1.txtGCycImgTrans.focus();
		return false;
	}
	//else
	
		//if (isNaN(document.Form1.txtGCycImgTrans.value)) 
		//{
	//		ErrMsg+ = "Cyclic image transition field accept Numeric Digits Only.\N";
	//	}
	
	
	if (document.Form1.txtGCopyRitURL.value=="")
	{
		alert("Copyright URL field can not be left empty.");
		document.Form1.txtGCopyRitURL.focus();
		return false;
	}
	
	if (document.Form1.m_txtAutoSubject.value=="")
	{
		alert("Subject required.");
		document.Form1.m_txtAutoSubject.focus();
		return false;
	}
	if(document.Form1.m_txtAutoSubject.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		return false;
	}
	if (document.Form1.m_txtAutoResBody.value=="")
	{
		alert("Body required.");
		document.Form1.m_txtAutoResBody.focus();
		return false;
	}
	if(document.Form1.m_txtAutoResBody.value.charAt(0)==' ')
	{	alert("No spaces allowed.");
		return false;
	}
	
		return true;
	}

function faqCatManageValidate() 
{ 
	if (document.Form1.txtCatName.value == "")
	{ 
		alert("Enter Category Name");
		document.Form1.txtCatName.focus();
		return false; 
	} 
	if(document.Form1.txtCatName.value.charAt(0)==' ')
	{	alert("No spaces allowed.");
		document.Form1.txtCatName.focus();
		return false; }
	if (document.Form1.txtSortOrder.value == "")
	{
		alert("Enter Sort Order"); 
		document.Form1.txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.txtSortOrder.value))
	{
		alert("Enter numeric Sort Order");
		document.Form1.txtSortOrder.value="";
		document.Form1.txtSortOrder.focus();
		return false;
	}
	return true;
}

function validateEditDynamicpage()
{
	if (document.Form1.m_txtpagetitle.value == "")
	{   
		alert("Enter Your Page Title.");
		document.Form1.m_txtpagetitle.focus();
		return false;
	}
	if(document.Form1.m_txtpagetitle.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtpagetitle.focus();
		return false;	
	}
	if (document.Form1.m_txtmkey.value == "")
	{
		alert("Enter Your Meta Keyword.");
		document.Form1.m_txtmkey.focus();
		return false;
	}
	if(document.Form1.m_txtmkey.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtmkey.focus();
		return false;
	}
	if (document.Form1.m_txtmdesc.value == "")
	{
		alert("Enter Your Meta Description.");
		document.Form1.m_txtmdesc.focus();
		return false;
	}
	if(document.Form1.m_txtmdesc.value.charAt(0)==' ')
	{
		alert("No spaces all.");
		document.Form1.m_txtmdesc.focus();
		return false;
	}
	return true;			
}

function ValidateMenuAdd()
 {
	if (document.Form1.m_txtSubMenu.value == "")
	{
		alert("Enter SubMenu Name");
		document.Form1.m_txtSubMenu.focus();
		return false;
	}
	if(document.Form1.m_txtSubMenu.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtSubMenu.focus();
		return false;
	}
	if (document.Form1.m_txtsort.value =="")
	{
		alert("Enter SortOrder");
		document.Form1.m_txtsort.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtsort.value))
	{
		alert("Invalid SortOrder");
		document.Form1.m_txtsort.value="";
		document.Form1.m_txtsort.focus();
		return false;
	}
	if (document.Form1.m_dropdwnlink.value == "::Select::" && document.Form1.txtCustomLink.value == "")
	{
		alert("Select Link");
		document.Form1.m_dropdwnlink.focus();
		return false;
	}
	return true;			
}

function publicationManagevalidation()
{
	var strd;
	if (document.Form1.m_txtPubName.value == "")
	{
		strd="Publication Name Required.";
		alert(strd);
		document.Form1.m_txtPubName.focus();
		return false;
	}
	if(document.Form1.m_txtPubName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtPubName.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtSortOrder.value))
	{
		alert('Enter numeric sort order.');
		document.Form1.m_txtSortOrder.value="";
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	return true;
}


function validatePageManage()
{
	if (document.Form1.m_txtPageTitle.value == "")
	{   
		alert("Enter Your Page Title.");
		document.Form1.m_txtPageTitle.focus();
		return false;
	}
	if(document.Form1.m_txtPageTitle.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtPageTitle.focus();
		return false;
	}
	if (document.Form1.m_txtMetaKeyword.value == "")
	{
		alert("Enter Your Meta Keyword.");
		document.Form1.m_txtMetaKeyword.focus();
		return false;
	}
	if(document.Form1.m_txtMetaKeyword.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtMetaKeyword.focus();
		return false;	
	}
	if (document.Form1.m_txtMetaDescription.value == "")
	{
		alert("Enter Your Meta Description.");
		document.Form1.m_txtMetaDescription.focus();
		return false;
	}
	if(document.Form1.m_txtMetaDescription.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtMetaDescription.focus();
		return false;
	}
	return true;
}

function validateServiceManage()
{	
	if (document.Form1.m_txtServiceName.value == "")
	{
		alert("Please Enter Service Name");
		document.Form1.m_txtServiceName.focus();
		return false;
	}
	if(document.Form1.m_txtServiceName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtServiceName.focus();
		return false;
	}
	if (document.Form1.m_txtSortOrder.value=="")
	{
		alert("Please Enter SortOrder");					
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtSortOrder.value))
	{
		alert("Please Enter Valid SortOrder");
		document.Form1.m_txtSortOrder.value="";
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	if (document.Form1.m_txtshortDesc.value =="")
	{
		alert("Please Enter Short Description.");
		document.Form1.m_txtshortDesc.focus();
		return false;
	}
	if(document.Form1.m_txtshortDesc.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtshortDesc.focus();
		return false;
	}
	return true;
}

function validateLibCatManage()
{	
	if (document.Form1.m_txtCatName.value == "")
	{
		alert("Please Enter Category Name");
		document.Form1.m_txtCatName.focus();
		return false;
	}
	if(document.Form1.m_txtCatName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtCatName.focus();
		return false;
	}
	if (document.Form1.m_txtSortOrder.value=="")
	{
		alert("Please Enter Sort Order");
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtSortOrder.value))
	{
		alert("Please Enter Valid Sort Order");
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	return true;
}
 function ValidateAddDepartment()
 {
	if(document.Form1.txtDeptName.value=="")
	{
		alert("enter department name");
		document.Form1.txtDeptName.focus();
		return false;
	}
	if(document.Form1.txtDeptName.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtDeptName.focus();
		return false;
	}
	if (document.Form1.txtSortOrder.value=="")
	{
		alert("Please Enter Sort Order");
		document.Form1.txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.txtSortOrder.value))
	{   
		alert("Please Enter Valid Sort Order");
		document.Form1.txtSortOrder.value="";
		document.Form1.txtSortOrder.focus();
		
		return false;
	}
	return true;
 }

function validateLibraryManage()
{	
	var UrlPat = /^[http:/]+([A-Za-z0-9_\-]+)[.]+([A-Za-z0-9_\-]+)*[.]+([A-Za-z0-9_\-]+)$/
	//var matchArray = Form1.m_txtUrl.value.match(UrlPat);
	if (document.Form1.m_cmbCategory.value == "")
	{
		alert("Please Select Category Name");
		document.Form1.m_cmbCategory.focus();
		return false;
	}
	if(document.Form1.m_cmbCategory.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_cmbCategory.focus();
		return false;
	}
	if (document.Form1.m_txtLibrary.value == "")
	{
		alert("Please Enter Links Name");
		document.Form1.m_txtLibrary.focus();
		return false;
	}
	if(document.Form1.m_txtLibrary.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.m_txtLibrary.focus();
		return false;
	}
	if (document.Form1.m_txtUrl.value == "")
	{
		alert("Please Enter Url");
		document.Form1.m_txtUrl.focus();
		return false;
	}
	
	if (document.Form1.m_txtSortOrder.value=="")
	{
		alert("Please Enter Sort Order");
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.m_txtSortOrder.value))
	{
		alert("Please Enter Valid Sort Order");
		document.Form1.m_txtSortOrder.focus();
		return false;
	}
	return true;
}

function faqlistMsgDeleteRecord()
{
	var strd=document.Form1.DMCN.value;
	if (confirm(strd))
	{
		return true;
	}
	return false;
}

function doFullScreen()
{		
}
function doNormalScreen()
{
}

function ProductManagevalidation()
			{	
				var strd;
				if (document.Form1.m_txtRefNo.value == "")
				{
					strd=document.Form1.MRF1.value;
					alert(strd);
					document.Form1.m_txtRefNo.focus();
					return false;
				}
				if(document.Form1.m_txtRefNo.value.charAt(0)==' ')
				{
					alert("No spaces allowed.");
					document.Form1.m_txtRefNo.focus();
					return false;
				}
				if (document.Form1.m_txtProductName.value == "")
				{
					strd=document.Form1.MRF2.value;
					alert(strd);
					document.Form1.m_txtProductName.focus();
					return false;
				}
				if(document.Form1.m_txtProductName.value.charAt(0)==' ')
				{
					alert("No spaces allowed.");
					document.Form1.m_txtProductName.focus();
					return false;
				}
			
				if (document.Form1.m_txtShortDesc.value == "")
				{
					strd=document.Form1.MRF3.value;
					alert(strd);
					document.Form1.m_txtShortDesc.focus();
					return false;
				}
				
				
				var anum=/(^\d+$)|(^\d+\.\d+$)/ 
				if (!anum.test(document.Form1.m_txtSortOrder.value))
				{
					strd="Please Enter Numeric Sort Order.";
					alert(strd);
					document.Form1.m_txtSortOrder.value="";
					document.Form1.m_txtSortOrder.focus();
					return false;
				}
				
				return true;
			}
	
			
	function datevalidtion(todate,fromdate)
	{
	if ((document.Form1.todate.value!="") && (document.Form1.fromdate.value!=""))
	{
		if ((document.Form1.todate.value) > (document.Form1.fromdate.value))
		{
			alert("To Date Must be less than From Date");
			document.Form1.todate.focus();
		}	
	}  
}  
function CheckAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.type=='checkbox')
		e.checked= ChkState ;                        
	}  
}

function ChkServiceActiveAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;    
	k=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgService:_ctl'+k+':m_chkactive')
		{
			e.checked= ChkState;    
			k++;                    
		}
	}  
}
function ChkServiceDeleteAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	k1=3;
	for(i=0;i<frm.length;i++)                              
	{                                                            
		e=frm.elements[i];                                   
		if(e.name=='m_dtgService:_ctl'+k1+':m_chkdelete')
		{
			e.checked= ChkState;                        
			k1++;
		}
	}  
}



function ChkLibraryCatActiveAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements;                             
	var ChkState=checkAllBox.checked;    
	k=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgLibCat:_ctl'+k+':m_chkactive')
		{
			e.checked= ChkState;    
			k++;                    
		}
		
	}  
}
function ChkLibraryCatDeleteAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	k1=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgLibCat:_ctl'+k1+':m_chkdelete')
		{
			e.checked= ChkState;                        
			k1++;
		}
	}  
}
function ChkLibraryActiveAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;    
	k=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgLibrary:_ctl'+k+':m_chkactive')
		{
			e.checked= ChkState;    
			k++;                    
		}
		
	}  
}
function ChkLibraryDeleteAll(checkAllBox)                      
{                                                           
	var frm = document.Form1.elements ;                             
	var ChkState=checkAllBox.checked;                   
	k1=3;
	for(i=0;i<frm.length;i++)                              
	{                                                              
		e=frm.elements[i];                                   
		if(e.name=='m_dtgLibrary:_ctl'+k1+':m_chkdelete')
		{
			e.checked= ChkState;                        
			k1++;
		}
	}  
	                                                            
}
function ValidateCyclicImageEdit()
{
	var err, ErrorDisp, UrlPat;
	err="";
	UrlPat = /^[http:/]+([A-Za-z0-9_\-]+)[.]+([A-Za-z0-9_\-]+)*[.]+([A-Za-z0-9_\-]+)$/
	var matchArray = Form1.txtHyperLinkUrl.value.match(UrlPat);
	
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.txtHyperLinkUrl.value=="")
	{
	alert("Hyperlink Url required.");
	document.Form1.txtHyperLinkUrl.focus();
	return false;
	
	}
	 else if (matchArray == null)
	{
	alert("http:// should prefix before URL.");
	document.Form1.txtHyperLinkUrl.focus();
	return false;
	}	
	
	return true;
}
function validateNews()
{
	var err, ErrorDisp, UrlPat;
	err="";
	
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.txtNewsTitle.value=="")
	{
		alert("Enter News title.");
		document.Form1.txtNewsTitle.focus();
		return false;
	}
	
	if(document.Form1.txtNewsTitle.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtNewsTitle.focus();
		return false;
	}
	if (document.Form1.txtDateNews.value=="")
	{
		alert("Enter news date.");
		document.Form1.txtDateNews.focus();
		return false;
	
	}
	if (document.Form1.txtNewsDate.value=="")
	{
	
		alert("Enter expiry date.");
		document.Form1.txtNewsDate.focus();
		return false;
	
	}
	 	
	if (document.Form1.txtSortOrder.value=="")
	{
		alert("Sort order required.");
		document.Form1.txtSortOrder.focus();
		return false;
	}
	
	if(isNaN(document.Form1.txtSortOrder.value)==true)
	{
		alert("Sort order value should be numeric.");
		document.Form1.txtSortOrder.focus();
		return false;
	
	}
	
	return true;
}

function ValidateCyclicImageManage()
{	
  
	var err, ErrorDisp, UrlPat;
	err="";
	UrlPat = /^[http:/]+([A-Za-z0-9_\-]+)[.]+([A-Za-z0-9_\-]+)*[.]+([A-Za-z0-9_\-]+)$/
	var matchArray = Form1.txtUrl.value.match(UrlPat);
	
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.Form1.txtImageFile.value=="")
	{
	alert("Select image.");
		document.Form1.txtImageFile.focus();
		return false;
	}
	if (document.Form1.txtUrl.value=="")
	{
		alert("Hyperlink Url required.");
		document.Form1.txtUrl.focus();
		return false;
	
	}
	 else if (matchArray == null)
	{
	alert("Invalid URL.");
		document.Form1.txtUrl.focus();
		return false;

	}	
	return true;
}
function faqManagevalidation()
{	
	var strd;
	if (document.Form1.cmbCategory.value == "")
	{
		strd=document.Form1.MRF1.value;
		alert(strd);
		document.Form1.txtQuestion.focus();
		return false;
	}
	if(document.Form1.cmbCategory.value.charAt(0)==' ')
	{
		alert("No spaces allowed");
		document.Form1.txtQuestion.focus();
		return false;
	}
	if (document.Form1.txtQuestion.value == "")
	{
		strd=document.Form1.MRF2.value;
		alert(strd);
		document.Form1.txtQuestion.focus();
		return false;
	}
	if(document.Form1.txtQuestion.value.charAt(0)==' ')
	{
		alert("No spaces allowed.");
		document.Form1.txtQuestion.focus();
		return false;
	}
	if (document.Form1.txtSortOrder.value=="")
	{
		strd=document.Form1.MRF4.value;
		alert(strd);
		document.Form1.txtSortOrder.focus();
		return false;
	}
	var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.Form1.txtSortOrder.value))
	{
		strd=document.Form1.MRF5.value;
		alert(strd);
		document.Form1.txtSortOrder.focus();
		return false;
	}
	return true;
}

		//for shipping details form

function shippingval()
{
	
	if(document.Form1.txt_firstName.value=="")
	{
		alert("Please enter your first name.");
		document.Form1.txt_firstName.focus();
		return false;
	}
	
	if(document.Form1.txtLastName.value=="")
	{
		alert("Please enter your last name.");
		document.Form1.txtLastName.focus();
		return false;
	}
	
	if(document.Form1.txt_billinfoaddr1.value=="")
	{
		alert("Please enter address1.");
		document.Form1.txt_billinfoaddr1.focus();
		return false;
	}
	
	if(document.Form1.txt_billingPostalcode.value=="")
	{
		alert("Please enter postal code.");
		document.Form1.txt_billingPostalcode.focus();
		return false;
	}
	
	if(document.Form1.txt_billinfocity.value=="")
	{
		alert("Please enter city.");
		document.Form1.txt_billinfocity.focus();
		return false;
	}
	
	if(document.Form1.drp_billinfocountry.value=="")
	{
		alert("Please enter country.");
		document.Form1.drp_billinfocountry.focus();
		return false;
	}
	
	if(document.Form1.txt_Email.value=="")
	{
		alert("Please enter email.");
		document.Form1.txt_Email.focus();
		return false;
	}
	
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray =document.Form1.txt_Email.value.match(emailPat);
	
	if (matchArray == null)
	{
		alert("Invalid Email format.");
		document.Form1.txt_Email.value="";
		document.Form1.txt_Email.focus();
		return false;
	}
	
	if(document.Form1.txt_mobile.value=="")
	{
		alert("Please enter your mobile number.");
		document.Form1.txt_mobile.focus();
		return false;
	}
	
	//if(document.Form1.drp_shippingmethod.value=="")
	//{
		//alert("Please select shipping method.");
		//document.Form1.drp_shippingmethod.focus();
		//return false;
	//}
	
	if(document.Form1.txt_shiptoname.value=="")
	{
		alert("Please enter ship to name.");
		document.Form1.txt_shiptoname.focus();
		return false;
	}
	
	if(document.Form1.txt_address.value=="")
	{
		alert("Please enter address.");
		document.Form1.txt_address.focus();
		return false;
	}
	
	if(document.Form1.txt_city.value=="")
	{
		alert("Please enter city.");
		document.Form1.txt_city.focus();
		return false;
	}
	
	if(document.Form1.txt_pincode.value=="")
	{
		alert("Please enter postal code.");
		document.Form1.txt_pincode.focus();
		return false;
	}
	
	if(document.Form1.drp_Country.value=="")
	{
		alert("Please select country.");
		document.Form1.drp_Country.focus();
		return false;
	}
	
	return true;
}


function ShowAlert()
{
alert("Sorry,Vote Can be Submitted only once!!!");
return false;
}
