 
 function validateheadersearch()
 {
 var strd;
 if(document.frmheaderSearch.txtVillaNo.value!="")
	
	{/*not required as vila ref is editable*/
	         var anum2=/(^\d+$)|(^\d+\\d+$)/
			/*	if (!anum2.test(document.frmheaderSearch.txtVillaNo.value))
				{
					strd=document.frmheaderSearch.MRF100.value;
	             	alert(strd);
					document.frmheaderSearch.txtVillaNo.focus();
					return false;
	            }*/
	
	}
	return true;
 }
 
 function ValidateAdvanceSearch()
 {
 var strd;
   if(document.frmsearch.txtVillaNo.value=="")
   {
	/* if(document.frmsearch.txtCity.value=="")
	{
		strd=document.frmsearch.MRF1.value;
		alert(strd);
		document.frmsearch.txtCity.focus();
		return false;
	}
	 if((document.frmsearch.ddlStartDate.value==".:Select From Date:." || document.frmsearch.ddlStartDate.value==".:Selecteer startdatum:.")&&(document.frmsearch.ddlEndDate.value!=".:Select To Date:." || document.frmsearch.ddlEndDate.value!=".:Selecteer einddatum:."))
            {
               strd=document.frmsearch.MRF4.value;
		alert(strd);
                return false;
            }
            if((document.frmsearch.ddlStartDate.value!=".:Select From Date:." || document.frmsearch.ddlStartDate.value!=".:Selecteer startdatum:.")&&(document.frmsearch.ddlEndDate.value==".:Select To Date:." || document.frmsearch.ddlEndDate.value==".:Selecteer einddatum:."))
            {
                strd=document.frmsearch.MRF5.value;
		alert(strd);
                return false;
            }       
	 if(document.frmsearch.ddlDistanceCoast.value=="0" || document.frmsearch.ddlDistanceCoast.value==".:Select Distance:." || document.frmsearch.ddlDistanceCoast.value==".:Selecteer afstand:.")
	{
		strd=document.frmsearch.MRF3.value;
		alert(strd);
		document.frmsearch.ddlDistanceCoast.focus();
		return false;
	}

	 if(document.frmsearch.ddlBedRoom.value=="0" || document.frmsearch.ddlBedRoom.value==".:Select BedRooms:." || document.frmsearch.ddlBedRoom.value==".:Aantal Slaapkamers:.")
	{
		strd=document.frmsearch.MRF2.value;
		alert(strd);
		document.frmsearch.ddlBedRoom.focus();
		return false;
	}	*/
	}
	if(document.frmsearch.txtVillaNo.value!="")
	
	{
	    var anum2=/(^\d+$)|(^\d+\\d+$)/
				/*if (!anum2.test(document.frmsearch.txtVillaNo.value))
				{
						strd=document.frmsearch.MRF6.value;
		alert(strd);
					document.frmsearch.txtVillaNo.focus();
					return false;
	             }*/
	
	}
	
	return true; 
 }
 function checkavailibility()
 {
    if(document.form1.ddlfromdt.value==".:Select From Date:." || document.form1.ddlfromdt.value==".:Selecteer startdatum:." || document.form1.ddltodt.value==".:Select To Date:." || document.form1.ddltodt.value==".:Selecteer einddatum:.")
    {
        strd=document.form1.MRF151.value;
        alert(strd);
        return false;
    }
          
    return true;
 }
 
 
 function ValidateDates()
{
   /* if(document.form1.ddlfromdt.value==".:Select From Date:." || document.form1.ddlfromdt.value==".:Selecteer startdatum:.")
    {
       strd=document.form1.MRFDate1.value;
       alert(strd);
       return false;
    }
    if(document.form1.ddltodt.value==".:Select To Date:." || document.form1.ddltodt.value==".:Selecteer einddatum:.")
    {
       strd=document.form1.MRFDate2.value;
       alert(strd);
       return false;
    } */  
    
     if(document.form1.ddlfromdt.value==".:Select From Date:." || document.form1.ddlfromdt.value==".:Selecteer startdatum:." || document.form1.ddltodt.value==".:Select To Date:." || document.form1.ddltodt.value==".:Selecteer einddatum:.")
     {
       strd=document.form1.MRFDate1.value;
       alert(strd);
       return false;
     }
    return true;
 }
 
function ValidateReservation()
{
    if(document.form1.ddlfromdt.value==".:Select From Date:." || document.form1.ddlfromdt.value==".:Selecteer startdatum:.")
    {
       strd=document.form1.MRF151.value;
       alert(strd);
       return false;
    }
    if(document.form1.ddltodt.value==".:Select To Date:." || document.form1.ddltodt.value==".:Selecteer einddatum:.")
    {
       strd=document.form1.MRF152.value;
       alert(strd);
       return false;
    }    
	
	if(document.form1.txtAge.value=="")
	{	
	    strd=document.form1.MRF7.value;
		alert(strd);
		document.form1.txtAge.focus();
		return false;
	}
	
       var ValidChars = "0123456789.";
       var IsNumber=true;
       var Char;
       var sText=document.form1.txtAge.value;
       for (i = 0; i < sText.length && IsNumber == true; i++) 
          { 
              Char = sText.charAt(i); 
              if (ValidChars.indexOf(Char) == -1) 
              {
                IsNumber=false;
                if(IsNumber==false)
                {
                   strd=document.form1.MRFAgechk.value;
		           alert(strd);
		           document.form1.txtAge.focus();
                   return false;
                }
              }
          }
            
	if(document.form1.txtName.value=="")
	{
		 strd=document.form1.MRF1.value;
		alert(strd);
		document.form1.txtName.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.txtEmail.value.match(emailPat);
	var strd;
	if(document.form1.txtEmail.value=="")
	{
		strd=document.form1.MRF2.value;
		alert(strd);
		document.form1.txtEmail.focus();
		return false;
	}
	else if (matchArray == null)
	{
		 strd=document.form1.MRF3.value;
		alert(strd);
		document.form1.txtEmail.focus();
		return false;
	}
	if(document.form1.txtAddress.value=="")
	{
	     strd=document.form1.MRF8.value;
		alert(strd);
		document.form1.txtAddress.focus();
		return false;
	}
	
	if(document.form1.txtZip.value=="")
	{
		 strd=document.form1.MRF4.value;
		alert(strd);
		document.form1.txtZip.focus();
		return false;
	}
	if(document.form1.txtCity.value=="")
	{
	     strd=document.form1.MRF9.value;
		alert(strd);
		document.form1.txtCity.focus();
		return false;
	}
	
	
	if(document.form1.txtPhone.value=="")
	{
		 strd=document.form1.MRF5.value;
		alert(strd);
		document.form1.txtPhone.focus();
		return false;
	}
	if(document.form1.txtCell.value=="")
	{
	 strd=document.form1.MRF6.value;
		alert(strd);
		document.form1.txtCell.focus();
		return false;
	}
	if(!document.form1.chkcond.checked)
	{
	    strd=document.form1.MRF11.value;
		alert(strd);
		return false;
	}
	if(document.form1.CodeNumberTextBox.value=="")
	{
		strd=document.form1.MRF131.value;
		alert(strd);
		document.form1.CodeNumberTextBox.focus();
		return false;
	}
	return true;
}
 
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		nav_01_over = newImage("images/nav_01-over.jpg");
		nav_02_over = newImage("images/nav_02-over.jpg");
		nav_03_over = newImage("images/nav_03-over.jpg");
		nav_04_over = newImage("images/nav_04-over.jpg");
		nav_05_over = newImage("images/nav_05-over.jpg");
		preloadFlag = true;
	}
}


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 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 ValidateContactUs()
{
 	var ErrMsg="";
	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);

	/*if(document.form1.txtFname.value=="" || document.form1.txtFname.value==" ")
	{
		
		strd=document.form1.MRF1.value;
	    alert(strd);
		document.form1.txtFname.focus();
		return false;
	}*/
	 if(document.form1.txtLName.value=="" || document.form1.txtLName.value==" ")
	{  
	     strd=document.form1.MRF2.value;
	    alert(strd);
		 document.form1.txtLName.focus();
		 return false;
	}
	
	if(document.form1.txtEmail.value=="")
	{
	   strd=document.form1.MRF3.value;
	   alert(strd);
	   document.form1.txtEmail.focus();
	   return false;
	}
	else if (matchArray == null)
	{
		strd=document.form1.MRF4.value;
	    alert(strd);
		document.form1.txtEmail.focus();
		return false;
	}
	
	 if(document.form1.txtComments.value==""||document.form1.txtComments.value=="Enter your comments here")
	{
	   
	    strd=document.form1.MRF5.value;
	   alert(strd);
		document.form1.txtComments.focus();
		return false;
	}
	
	if(document.form1.txtComments.value.charAt(0)==' ')
	{  
	     strd=document.form1.MRF5.value;
	   alert(strd);
	    document.form1.txtComments.focus();
		return false;
    }
	if(document.form1.txtComments.value.length > 250)
	 {
		strd=document.form1.MRF6.value;
	    alert(strd);
		document.form1.txtComments.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;
	}
}


function HeaderLoginValidation()
{
	if(document.login.m_txtUserName.value==" ")
	{
		alert("Enter your username.");
		document.login.m_txtUserName.focus();
		return false;
	}
	
	if(document.login.m_txtPassword.value=="")
	{
		alert("Enter your password.");
		document.login.m_txtPassword.focus();
		return false;
	}
	return true;
}

function HeaderSearchValidation()
{
	if(document.Search.m_txtSearch.value==" ")
	{
		alert("Enter search text.");
		document.Search.m_txtSearch.focus();
		return false;
	}
}
function ValidateGuestBook()
{
    var err, ErrorDisp, emailPat;
    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);
	err="";
	ErrorDisp = "You are missing following entries.\n";
	ErrorDisp += "----------------------------------------\n";
	if (document.form1.txtfname.value=="" || document.form1.txtfname.value==" ")
	{
		err += "First Name required.\n";
		document.form1.txtfname.focus();
	}	
	if (document.form1.txtlname.value=="" || document.form1.txtlname.value==" ")
	{
		err += "Last Name required.\n";
	}
	if (document.form1.txtemail.value=="" || document.form1.txtemail.value==" ")
	{
		err += "Email required.\n";
	}
	else if (matchArray == null)
	{  
	     err += "Inavalid Email format.\n";
	}
	if (document.form1.txtComment.value=="" || document.form1.txtComment.value=="Enter your comment's.")
	{
		err += "Comments required.\n";
	}	
	if (err=="")
	{
		return true;
	}
	else
	{	
		alert(ErrorDisp+err);
		return false;
	}
}
function Callmevalidation()
	{
	    var strd;
		var emailPat1 = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray1 = frmcontactus.txtemail.value.match(emailPat1);
	/*	if (document.frmcontactus.txtfname.value == "" || document.frmcontactus.txtfname.value == " ")
		{
		    strd=document.frmcontactus.MRF101.value;
		    alert(strd);
		    document.frmcontactus.txtfname.focus();
			return false;
		}*/
		if (document.frmcontactus.txtlname.value == "" || document.frmcontactus.txtlname.value == " ")
		{
		    strd=document.frmcontactus.MRF102.value;
		    alert(strd);
			document.frmcontactus.txtlname.focus();
			return false;
		}
//		if (document.frmcontactus.reffno.value == "")
//		{
//		     strd=document.frmcontactus.MRF106.value;
//		    alert(strd);
//		    document.frmcontactus.reffno.focus();
//			return false;
//		}
//		 var anum2=/(^\d+$)|(^\d+\\d+$)/
//		if (!anum2.test(document.frmcontactus.reffno.value))
//		{
//				strd=document.frmcontactus.MRF107.value;
//		    alert(strd);
//			document.frmcontactus.reffno.focus();
//			return false;
//		}
		if (document.frmcontactus.txtemail.value == "")
		{
		    strd=document.frmcontactus.MRF103.value;
		    alert(strd);
		   	document.frmcontactus.txtemail.focus();
			return false;
		}
    	else if (matchArray1 == null)
		{
		    strd=document.frmcontactus.MRF1044.value;
		    alert(strd);
			document.frmcontactus.txtemail.focus();
			return false;
		}
		return true;
	}
	function Mailfriendvalidation()
    {
        var strd;
		var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray = form1.txtfriendemail.value.match(emailPat);
		var matchArray1 = form1.txtselfEmail.value.match(emailPat);
	    if(matchArray == null)
	    {
		    strd=document.form1.MRF1.value;
		    alert(strd);
		    document.form1.txtfriendemail.focus();
		    return false;
	    }
    	
	    if(matchArray1 == null)
	    {
		    strd=document.form1.MRF2.value;
		    alert(strd);
		    document.form1.txtselfEmail.focus();
		    return false;
	    }
	    return true;
    }
	function popup1(url)
	{
		width = 620;
		height = 600;
		xx = window.screen.width;
		yy = window.screen.height;
		xx = (xx/2) - (width/2);
		yy = (yy/2) - (height);
		tt = 50;
		style = 'left = ' +  xx + ',top = ' + tt + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes';
		newwindow=window.open(url,'name',style);
		if (window.focus) {newwindow.focus()}
	}
	function mailtofriend(url)
	{
		width = 510;
		height = 370;
		xx = window.screen.width;
		yy = window.screen.height;
		xx = (xx/2) - (width/2);
		yy = (yy/2) - (height);
		tt = 50;
		style = 'left = ' +  xx + ',top = ' + tt + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes';
		newwindow=window.open(url,'name',style);
		if (window.focus) {newwindow.focus()}
	}
	function clearTip(field)
	{
		if(field.defaultValue == field.value)				
		field.value = "";
	}

	function writeTip(field)
	{
		if(field.value == "")
			field.value = field.defaultValue;
	}
	function validatReferenceNo()
	{
	
	    var emailPat=/(^\d+$)|(^\d+\.\d+$)/
		var matchArray = frmrefsearch.txtrefsearch.value.match(emailPat);
        if (document.frmrefsearch.txtrefsearch.value == "")
        {
        alert("Please Enter Reference Number.");
        document.frmrefsearch.txtrefsearch.focus();
        return false;
        }
        if (document.frmrefsearch.txtrefsearch.value == "Enter Reference Number..")
        {
        alert("Please Enter Reference Number.");
        document.frmrefsearch.txtrefsearch.focus();
        return false;
        }
       if (matchArray == null)
        {
	        alert ("Please Enter Numeric Reference Number.");
	        document.frmrefsearch.txtrefsearch.focus();
	        return false;
        }
       
	}
function validatmailid()
{
    var strd;
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = document.Newsletter.txtnewsletter.value.match(emailPat);
	if(matchArray == null)
    { 
        strd=document.Newsletter.MRF2001.value;
	    alert(strd);
	    document.Newsletter.txtnewsletter.focus();
	    return false;
    }
    
}
function OpenWindow()
{ 
window.open("Calculator.htm","winPop","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=335,left=150,top=150");
}
function popUpWindowCC(url,wd,ht)
{
	newwindow=window.open(url,'cc','scrollbars=1,location=0,menubar=0,resizable=0,width='+wd+',height='+ht+',left = 80,top = 80');
	if (window.focus) {newwindow.focus()}
}
function OpenWindowDn()
{ 
window.open("../Calculator.htm","winPop","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=335,left=150,top=150");
}
function popUpWindowCC(url,wd,ht)
{
	newwindow=window.open(url,'cc','scrollbars=1,location=0,menubar=0,resizable=0,width='+wd+',height='+ht+',left = 80,top = 80');
	if (window.focus) {newwindow.focus()}
}

///Ecommerce Validation

function ValidateFaq()
			{
				var strd;
					if (document.frmFaq.search11.value == "")
					{
						strd=document.frmFaq.MF1.value;
						alert (strd);
						document.frmFaq.search11.focus();
						return false;
					}
					return true;
			}
		//Validation for Contact Us
		function clearTip(field)
			{
				if(field.defaultValue == field.value)
				field.value = "";
			}
		function writeTip(field)
			{
				if(field.value == "")
				field.value = field.defaultValue;
			}	
			
			function Contactusvalidation()
			{	
				var strd;
				if (document.frmContactUs.txtFirstName.value == " " || document.frmContactUs.txtFirstName.value == "First Name")
				{
					strd=document.frmContactUs.MRF11.value;
					alert(strd);
					document.frmContactUs.txtFirstName.focus();
					return false;
				}
				if (document.frmContactUs.txtLastName.value == " " || document.frmContactUs.txtLastName.value == "Last Name")
				{
					strd=document.frmContactUs.MRF22.value;
					alert(strd);
					document.frmContactUs.txtLastName.focus();
					return false;
				}
				if (document.frmContactUs.txtEmail.value == " ")
				{
					strd=document.frmContactUs.MRF33.value;
					alert(strd);
					document.frmContactUs.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = frmContactUs.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						strd=document.frmContactUs.MRF44.value;
						alert (strd);
						document.frmContactUs.txtEmail.focus();
						return false;
					}					
				}
				if (document.frmContactUs.cmbCountry.value == " " || document.frmContactUs.cmbCountry.value == "Select Country")
				{
					strd=document.frmContactUs.MRF55.value;
					alert(strd);
					document.frmContactUs.cmbCountry.focus();
					return false;
				}
				
			}
			
			function popupContact(url)
			{
				
				width = 270;
				height = 145;
				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 popitupContact(url)
		{
			newwindow=window.open(url,'name','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=270,height=145,left = 350,top = 400');
			if (window.focus) {newwindow.focus()}
		}
				
				//Validation for Contact Us Ends
				
		//Validation for Suggestions		
				
		function validateSuggestion()
			{	
				var strd;
				if (document.abc.txtFirstName.value == "")
				{
					alert("PLease Enter your Name");
					document.abc.txtFirstName.focus();
					return false;
				}
				if (document.abc.txtEmail.value == "")
				{
					alert("Please Enter Email Address");
					document.abc.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = abc.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						alert ("Please enter your valid email address.");
						document.abc.txtEmail.focus();
						return false;
					}					
				}
			
			}
			
			//Validations for Unsubscribe
			
				function validateUnsubscribe()
			{
				var strd;
				if (document.frmContactUs.txtEmail.value == "")
				{
					strd=document.frmContactUs.MRF1.value;
					alert(strd);
					document.frmContactUs.txtEmail.focus();
					return false;
				}
				else
				{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
					var matchArray = frmContactUs.txtEmail.value.match(emailPat);
					if (matchArray == null)
					{
						strd=document.frmContactUs.MRF2.value;
						alert (strd);
						document.frmContactUs.txtEmail.focus();
						return false;
					}					
				}	
			}

//Validation for MyAccount

	function validAccount()
		{
			if (document.abc.txtFirstName.value=="")
			{
				alert('Please enter first name');
				document.abc.txtFirstName.focus();
				return false;
			}
			if (document.abc.txtLastName.value=="")
			{
				alert('Please enter last name');
				document.abc.txtLastName.focus();
				return false;
			}
			var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
			var matchArray = document.abc.txtEmail.value.match(emailPat);
			if (matchArray == null)
			{
				alert('Please enter valid email address');
				document.abc.txtEmail.focus();
				return false;
			}	
			if (document.abc.txt_address1.value=="")
			{
				alert('Please enter Address.');
				document.abc.txt_address1.focus();
				return false;
			}
			if (document.abc.txtPostalCode.value=="")
			{
				alert('Please enter postal Code');
				document.abc.txtPostalCode.focus();
				return false;
			}
		
			if(document.getElementById("cmbstate").value==":: Select State ::")
				{
					alert('Please Select  State');
					document.abc.cmbstate.focus();
					return false;
				}
			if(document.getElementById("cmbstate").value=="Others")
				{
					if (document.abc.txtState.value=="")
					{
						alert('Please enter your State');
						document.abc.txtState.focus();
						return false;
					}
				}
			if (document.abc.cmbCountry.value=="")
			{
				alert('Please select country name');
				document.abc.cmbCountry.focus();
				return false;
			}
			if (document.abc.txtPhone.value=="")
			{
				alert('Please enter phone number');
				document.abc.txtPhone.focus();
				return false;
			}
			var anum2=/(^\d+$)|(^\d+\\d+$)/
				if (!anum2.test(document.abc.txtPhone.value))
				{
					alert("please enter phone number only in figures.");
					document.abc.txtPhone.focus();
					return false;
				}
			if (document.abc.txtpassword.value=="")
			{
				alert('Please enter your password');
				document.abc.txtpassword.focus();
				return false;
			}
			if (document.abc.txtpasswordconfm.value=="")
			{
				alert('Please enter confirm password');
				document.abc.txtpasswordconfm.focus();
				return false;
			}
			if (document.abc.txtpasswordconfm.value!=document.abc.txtpassword.value)
			{
				alert('Password & confirm password must be same.');
				document.abc.txtpasswordconfm.focus();
				return false;
			}
			
			if (document.abc.ddlQuestion.value == "1")
			{
				alert('Please select Question.');
				document.abc.ddlQuestion.focus();
				return false;
			}
			
			if (document.abc.txtAns.value == "")
			{
				alert('Please select Answer.');
				document.abc.txtAns.focus();
				return false;
			}
			return true;
		}		
		
		
		//Validate Login
		
		  function validateLogin()
			  {	
					
					if (document.frmlogin.txt_username.value == "")
					{
						alert('Please enter UserName');
						document.frmlogin.txt_username.focus();
						return false;
					}	
				   if (document.frmlogin.txt_password.value == "")
					{
						alert("Please enter password");
						document.frmlogin.txt_password.focus();
						return false;
					}		
			  return true;						
	   	     }	
	   	     
	   	     
	   	     
	   	     //Validation for new user Registration
	   	     
	   	     
	   	 function validateNewUser()
			{	
				if (document.frmregister.txtusername.value=="")
				{
					alert('Please enter User name');
					document.frmregister.txtusername.focus();
					return false;
				}
				if (document.frmregister.txtFirstName.value=="")
				{
					alert('Please enter first name');
					document.frmregister.txtFirstName.focus();
					return false;
				}
				if (document.frmregister.txtLastName.value=="")
				{
					alert('Please enter last name');
					document.frmregister.txtLastName.focus();
					return false;
				}
				var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
				var matchArray = document.frmregister.txtEmail.value.match(emailPat);
				if (matchArray == null)
				{
					alert('Please enter valid email address');
					document.frmregister.txtEmail.focus();
					return false;
				}	
				if (document.frmregister.txtPhone.value=="")
				{
					alert('Please enter phone number');
					document.frmregister.txtPhone.focus();
					return false;
				}
				var anum2=/(^\d+$)|(^\d+\\d+$)/
				if (!anum2.test(document.frmregister.txtPhone.value))
				{
					//strd = document.Form1.MRF5.value;
					alert("please enter phone number only in figures.");
					document.frmregister.txtPhone.focus();
					return false;
				}
				if (document.frmregister.txtAddress1.value=="")
				{
					alert('Please enter address');
					document.frmregister.txtAddress1.focus();
					return false;
				}
				/*if (document.frmregister.txtPhone.value=="")
				{
					alert('Please enter phone number');
					document.frmregister.txtPhone.focus();
					return false;
				}*/
				if (document.frmregister.txtPostalCode.value=="")
				{
					alert('Please enter PostalCode Code');
					document.frmregister.txtPostalCode.focus();
					return false;
				}
				if(document.getElementById("cmbstate").value==":: Select State ::")
				{
					alert('Please Select  State');
					document.frmregister.cmbstate.focus();
					return false;
				}
				if(document.getElementById("cmbstate").value=="Others")
				{
					if (document.frmregister.txtState.value=="")
					{
						alert('Please enter your State');
						document.frmregister.txtState.focus();
						return false;
					}
				}
					
				/*if (document.frmregister.txtCity.value=="")
				{
					alert('Please enter City name');
					document.frmregister.txtCity.focus();
					return false;
				}*/
				if (document.frmregister.cmbCountry.value==":: Select Country ::")
				{
					alert('Please select country name');
					document.frmregister.cmbCountry.focus();
					return false;
				}
				if (document.frmregister.txtpassword.value=="")
				{
					alert('Please enter your password');
					document.frmregister.txtpassword.focus();
					return false;
				}
				if (document.frmregister.txtcpassword.value=="")
				{
					alert('Please enter confirm password');
					document.frmregister.txtcpassword.focus();
					return false;
				}
				if (document.frmregister.txtcpassword.value!=document.frmregister.txtpassword.value)
				{
					alert('Password & confirm password must be same.');
					document.frmregister.txtcpassword.focus();
					return false;
				}
				
				if (document.frmregister.ddlQuestion.value == "1")
				{
					alert('Please select Question.');
					document.frmregister.ddlQuestion.focus();
					return false;
				}
				
				if (document.frmregister.txtAns.value == "")
				{
					alert('Please select Answer.');
					document.frmregister.txtAns.focus();
					return false;
				}
				return true;
			}
			
			function checkstate()
			{
				if(document.getElementById("cmbstate").value=="Others")
				{
					//document.frmregister.txtState.Enabled=true;
					document.getElementById("txtState").disabled=false
				}
				else
				{
					document.getElementById("txtState").disabled=true;
				}
				return true;
			}
			
			function checkbillingstate()
			{
				if(document.getElementById("drp_billstate").value=="Others")
				{	
					document.getElementById("txt_otherbillstate").disabled=false
				}
				else
				{
					document.getElementById("txt_otherbillstate").disabled=true;
				}
				return true;
			}
			
			function checkshippingstate()
			{
				if(document.getElementById("drp_ShippingState").value=="Others")
				{	
					document.getElementById("txt_othershipstate").disabled=false
				}
				else
				{
					document.getElementById("txt_othershipstate").disabled=true;
				}
				return true;
			}
			
			
		//Validation For LoginManage	
			function checkPass()
			{
				
					if (document.Form1.txtPassword.value == "")
					{
						alert("Please, Enter your Password.");
						document.Form1.txtPassword.focus();
						return false;
					}
					if (document.Form1.txtPassword.value != document.Form1.txtConfirmPass.value)
					{
						alert("Password and Confirm Password should be same.");
						document.Form1.txtConfirmPass.value = "";
						document.Form1.txtConfirmPass.focus();
						return false;
					}
					return true;
				
			}
		
		
		//not used Validation for Advance Search
		
			function validateAdvSearch()
			{	
				var strd;
				if (document.Form1.txtsearchcriteria.value == " " || document.Form1.txtsearchcriteria.value == "Enter Search Criteria")
				{
					//strd=document.Form1.MRF11.value;
					alert('Please enter search Criteria...');
					document.Form1.txtsearchcriteria.focus();
					return false;
				}
				
				var anum=/(^\d+$)|(^\d+\.\d+$)/
				if (document.Form1.txtpfrom.value  != "" )
				{
					if (!anum.test(document.Form1.txtpfrom.value))
					{
						alert('Invalid Price')
						document.Form1.txtpfrom.focus();
						return false;
					}
				}
				if (document.Form1.txtto.value  != "" )
				{	
					if (!anum.test(document.Form1.txtto.value))
					{
						alert('Invalid Price')
						document.Form1.txtto.focus();
						return false;
					}
				}	
				
			}	
			
			function validatsearch()
			{
				var strd;
					if (document.frm.search.value == "")
					{
						strd=document.frm.MRF1.value;
						alert (strd);
						document.frm.search.focus();
						return false;
					}
			}
			
			
			//Validation for shipping info
			
			function validateShippingInfo()
			{
			
				var strd;
				if (document.Form1.txt_FirstName.value=="")
				{
					strd=document.Form1.MRF11.value;
					alert(strd);
					document.Form1.txt_FirstName.focus();
					return false;
				}
				
				if (document.Form1.txt_LastName.value=="")
				{
					strd=document.Form1.MRF22.value;
					alert(strd);
					document.Form1.txt_LastName.focus();
					return false;
				}
				
				if (document.Form1.txt_Email.value=="")
				{
					strd=document.Form1.MRF33.value;
					alert(strd);
					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)
				{   
					strd=document.Form1.MRF44.value;
					alert(strd);
					document.Form1.txt_Email.focus();
					return false;
				}
				
				if (document.Form1.txt_address1.value=="")
				{
					strd=document.Form1.MRF55.value;
					alert(strd);
					document.Form1.txt_address1.focus();
					return false;
				}
				
				if (document.Form1.txt_billCity.value=="")
				{
					strd=document.Form1.MRF56.value;
					alert(strd);
					document.Form1.txt_billCity.focus();
					return false;
				}	
				
				if (document.Form1.txt_billpostalcode.value=="")
				{
					strd=document.Form1.MRF57.value;
					alert(strd);
					document.Form1.txt_billpostalcode.focus();
					return false;
				}	
				
				if (document.Form1.txt_Phone.value=="")
				{
					strd=document.Form1.MRF58.value;
					alert(strd);
					document.Form1.txt_Phone.focus();
					return false;
				}	
				
				if (document.Form1.drp_billstate.value=="")
				{
					strd=document.Form1.MRF59.value;
					alert(strd);
					document.Form1.drp_billstate.focus();
					return false;
				}	
				
				if (document.Form1.drp_billcountry.value=="")
				{
					strd=document.Form1.MRF60.value;
					alert(strd);
					document.Form1.drp_billcountry.focus();
					return false;
				}	
				
				if (document.Form1.drp_shippingmethod.value=="")
				{
					strd=document.Form1.MRF61.value;
					alert(strd);
					document.Form1.drp_shippingmethod.focus();
					return false;
				}
				
				if (document.Form1.txt_shiptoname.value=="")
				{
					strd=document.Form1.MRF62.value;
					alert(strd);
					document.Form1.txt_shiptoname.focus();
					return false;
				}
				
				if (document.Form1.txt_address.value=="")
				{
					strd=document.Form1.MRF63.value;
					alert(strd);
					document.Form1.txt_address.focus();
					return false;
				}	
				
				if (document.Form1.txt_city.value=="")
				{
					strd=document.Form1.MRF56.value;
					alert(strd);
					document.Form1.txt_city.focus();
					return false;
				}	
				
				if (document.Form1.txt_pincode.value=="")
				{
					strd=document.Form1.MRF57.value;
					alert(strd);
					document.Form1.txt_pincode.focus();
					return false;
				}
				
				if (document.Form1.drp_Country.value=="")
				{
					strd=document.Form1.MRF60.value;
					alert(strd);
					document.Form1.drp_Country.focus();
					return false;
				}	
				
				return true;					
			}
			

function ValidateSearch()
{
	if (document.frmsearch.Nsearch.value=="")
	{
		alert("Please enter search string to search.");
		document.frmsearch.Nsearch.focus();
		return false;
	}	
}

function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

