﻿// JScript File
function messageselect2()
{
if(document.aspnetForm.ctl00_CPH1_Radio_Button_1.checked==true)
{
document.aspnetForm.ctl00_CPH1_txtMessage.readOnly=false;
document.aspnetForm.ctl00_CPH1_txtMessage.value="";
}
if(document.aspnetForm.ctl00_CPH1_Radio_Button_0.checked==true)
{
document.aspnetForm.ctl00_CPH1_txtMessage.readOnly=true;
document.aspnetForm.ctl00_CPH1_txtMessage.value="Hello! \nI would like to invite you to the Geewiz Online Action Site. Please view the below link.";
}
}
function OpenNewWindow(url)
{
popUpWin=window.open( url, '', '' ) 
if (navigator.appName == 'Netscape')
	 {
		popUpWin.focus()
	  }
}

 function doit(htmfile) {
	popUpWin = window.open(htmfile,'smallWin','height=600,width=900,toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=yes,resizable=no')
	if (navigator.appName == 'Netscape')
	 {
		popUpWin.focus()
	  }
 }
  function doitSmall(htmfile) {
	popUpWin = window.open(htmfile,'smallWin','height=200,width=200,toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=yes,resizable=no')
	if (navigator.appName == 'Netscape')
	 {
		popUpWin.focus()
	  }
 }
  function doitGMap(htmfile) {
	popUpWin = window.open(htmfile,'smallWin','height=500,width=800,toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=yes,resizable=no')
	if (navigator.appName == 'Netscape')
	 {
		popUpWin.focus()
	  }
 }
function Agreemet()
{

if(document.aspnetForm.ctl00_CPH1_txtFName.value=='')
{
alert("Please Enter Full Name. ");
	document.aspnetForm.ctl00_CPH1_txtFName.focus();
	return false;
}

if(document.aspnetForm.ctl00_CPH1_txtAddress.value=='')
{
alert("Please Enter Street Address. ");
	document.aspnetForm.ctl00_CPH1_txtAddress.focus();
	return false;
}
if(document.aspnetForm.ctl00_CPH1_txtTown.value=='')
{
alert("Please Enter Town/City/Code ");
	document.aspnetForm.ctl00_CPH1_txtTown.focus();
	return false;
}

if(document.aspnetForm.ctl00_CPH1_txtState.value=='')
{
alert("Please Enter State ");
	document.aspnetForm.ctl00_CPH1_txtState.focus();
	return false;
}
if(document.aspnetForm.ctl00_CPH1_txtCountry.value=='')
{
alert("Please Enter Country. ");
	document.aspnetForm.ctl00_CPH1_txtCountry.focus();
	return false;
}

if(document.aspnetForm.ctl00_CPH1_txtdlNo.value=='')
{
alert("Please Enter Driver’s License ");
	document.aspnetForm.ctl00_CPH1_txtdlNo.focus();
	return false;
}

if(document.aspnetForm.ctl00_CPH1_ddlContactType.value=='')
{
alert("Please Select Contact Type ");
	document.aspnetForm.ctl00_CPH1_ddlContactType.focus();
	return false;
}
if(document.aspnetForm.ctl00_CPH1_txtWorkTel.value=='')
{
alert("Please Enter Contact No. ");
	document.aspnetForm.ctl00_CPH1_txtWorkTel.focus();
	return false;
}

	if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtEmail.value))
	{
	document.aspnetForm.ctl00_CPH1_txtEmail.focus();
	return false;	 
	}


if(document.aspnetForm.ctl00_CPH1_chkAgree.checked==false)
{
alert("Please click on agreement. ");
	document.aspnetForm.ctl00_CPH1_chkAgree.focus();
	return false;
}
}
function checkaddtopic()
{
     if(document.aspnetForm.ctl00_CPH1_TextBox1.value=='')
    {
        alert("Please Enter Topic");
	    document.aspnetForm.ctl00_CPH1_TextBox1.focus();
	    return false;
	    
    }
}
//blogReply
function checkReply()
{

    if(document.aspnetForm.ctl00_CPH1_txtname.value=='')
    {
        alert("Please Enter Your Name");
	    document.aspnetForm.ctl00_CPH1_txtname.focus();
	    return false;
	    
    }
     if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtemail.value))
	            {
	            document.aspnetForm.ctl00_CPH1_txtemail.focus();
	            return false;	 
	            }
    if(document.aspnetForm.ctl00_CPH1_txtcomment.value=='')
    {
        alert("Please Enter Your Comment");
	    document.aspnetForm.ctl00_CPH1_txtcomment.focus();
	    return false;
    }
    if(document.aspnetForm.ctl00_CPH1_chk.checked==false)
    {
        alert("Please accept terms and conditions");
	    document.aspnetForm.ctl00_CPH1_chk.focus();
	    return false;
    }
}


///email function
function emailCheck (emailStr) 
	{

	var checkTLD=1;

	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

	var emailPat=/^(.+)@(.+)$/;

	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

	var validChars="\[^\\s" + specialChars + "\]";

	var quotedUser="(\"[^\"]*\")";

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

	var atom=validChars + '+';

	var word="(" + atom + "|" + quotedUser + ")";

	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

	var matchArray=emailStr.match(emailPat);

	if (matchArray==null) 
	{
	alert("Email address seems incorrect.");
	return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];

	for (i=0; i<user.length; i++) 
	{
	if (user.charCodeAt(i)>127) 
	{
	alert("Ths username contains invalid characters.");
	return false;
	}
	}
	for (i=0; i<domain.length; i++) 
	{
	if (domain.charCodeAt(i)>127) 
	{
	alert("Ths domain name contains invalid characters.");
	return false;
	}
	}

	if (user.match(userPat)==null) 
	{
	alert("The username doesn't seem to be valid.");
	return false;
	}

	/* if the e-mail address is at an IP address (as opposed to a symbolic
	host name) make sure the IP address is valid. */

	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) 
	{
	for (var i=1;i<=4;i++) 
	{
	if (IPArray[i]>255) 
	{
		alert("Destination IP address is invalid!");
		return false;
	}
	}
	}
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	for (i=0;i<len;i++) 
	{
	if (domArr[i].search(atomPat)==-1) 
	{
	alert("The domain name does not seem to be valid.");
	return false;
	}
	}

	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
	{
	alert("The address must end in a well-known domain or two letter " + "country.");
	return false;
	}
	if (len<2)
	{
	alert("This address is missing a hostname!");
	return false;
	}
	return true;
	}
	
	function RegAgreemet()
	{
	
		        if(document.aspnetForm.ctl00_CPH1_txtUsername.value=='')
                {
                alert("User Name field can not be left blank. Thank you!");
	            document.aspnetForm.ctl00_CPH1_txtUsername.focus();
	            return false;
                }
                else if(document.aspnetForm.ctl00_CPH1_txtUsername.value.length<6)
                {
                alert("User Name has to be of atleast 6 characters. Thank you! ");
	            document.aspnetForm.ctl00_CPH1_txtUsername.focus();
	            return false;
                }         
                
                
	            if(document.aspnetForm.ctl00_CPH1_txtPassword.value=='')
                {
                alert("Password field can not be left blank. Thank you! ");
	            document.aspnetForm.ctl00_CPH1_txtPassword.focus();
	            return false;
                }
               else if(document.aspnetForm.ctl00_CPH1_txtPassword.value.length<6)
                {
                alert("Password has to be of atleast 6 characters. Thank you!");
	            document.aspnetForm.ctl00_CPH1_txtPassword.focus();
	            return false;
                }
                
                if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtEmail.value))
	            {
	            document.aspnetForm.ctl00_CPH1_txtEmail.focus();
	            return false;	 
	            }
	        if(document.aspnetForm.ctl00_CPH1_txtFirstName.value=='')
                {
                alert("Please Enter First Name - Thank you! ");
	            document.aspnetForm.ctl00_CPH1_txtFirstName.focus();
	            return false;
                }
	        if(document.aspnetForm.ctl00_CPH1_txtLastName.value=='')
                {
                alert("Please Enter Last Name - Thank you! ");
	            document.aspnetForm.ctl00_CPH1_txtLastName.focus();
	            return false;
                }
	        if(document.aspnetForm.ctl00_CPH1_cboQuestion.value=='')
                {
                alert("Please Select Security Question - Thank you! ");
	            document.aspnetForm.ctl00_CPH1_cboQuestion.focus();
	            return false;
                }

	        if(document.aspnetForm.ctl00_CPH1_txtAnswer.value=='')
                {
                alert("Please Enter Your Answer - Thank you! ");
	            document.aspnetForm.ctl00_CPH1_txtAnswer.focus();
	            return false;
                }

	         
            if(document.aspnetForm.ctl00_CPH1_chkAgree.checked==false)
                {
                    alert("Please Accept the agreement - Thank you ! ");
	                document.aspnetForm.ctl00_CPH1_chkAgree.focus();
	                return false;
                }
                 if(document.aspnetForm.ctl00_CPH1_chkPolicies.checked==false)
                {
                    alert("Please Accept the Privacy Policy - Thank you ! ");
	                document.aspnetForm.ctl00_CPH1_chkPolicies.focus();
	                return false;
                }
	}
	
//	function SubTest_onclick
//	{
//	alert('ss');
//	//document.aspnetForm.ctl00_CPH1_txtUsername.value="ram";

//	 return false;
//	}

function checkdocument(count)
{
    var total = count;
    for(i=1;i<=total;i++)
    {
	    x = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_txtdocTitle.value")
	        if (x!="")
	        {
		        y = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_FileUpload1.value")
		        if(y=="")
		        {
		        alert("Please upload data in document field no."+i);
		        return false;
		        }
	        }
    }
    
     for(i=1;i<=total;i++)
    {
	    x = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_FileUpload1.value")
	        if (x!="")
	        {
		        y = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_txtdocTitle.value")
		        if(y=="")
		        {
		        alert("Please enter a name for each uploaded document in the Title box. ");
		        return false;
		        }
	        }
    }
}

function checkmadatory(countlist,countrepeter)
{

    
    var list = countlist;
    var rep = countrepeter;
//    var total = total;ctl00_CPH1_RptEncumbrance_ctl03_Label1   ctl00_CPH1_DataList2_ctl03_Label1
    var flag = 0;
    
     for(i=1;i<=list;i++)
    {
	    x = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_txtdocTitle.value");
	    y = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_FileUpload1.value");
	    
	    if(x=="" )
	    {
	        flag = flag + 1;
	    }
	       
    }
    
     for(i=0;i<rep;i++)
    {
	     x = eval("document.aspnetForm.ctl00_CPH1_RptEncumbrance_ctl0"+i+"_txtdocTitles.value");
	     y = eval("document.aspnetForm.ctl00_CPH1_RptEncumbrance_ctl0"+i+"_DocEncumbrance.value");
	     if(x=="" )
	    {
	        flag = flag + 1;
	    }
    }
    
    if(flag== list*1+rep*1)
    {
        alert("Please Upload at least one document.");
        return false;
    
    }
  
    
    
    for(i=1;i<=list;i++)
    {
	    x = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_txtdocTitle.value");
	    y = eval("document.aspnetForm.ctl00_CPH1_DataList2_ctl0"+i+"_FileUpload1.value");
	    var z = document.getElementById("ctl00_CPH1_DataList2_ctl0"+i+"_Label1");
	 
	   
	   
	   
	  //  ctl00_CPH1_RptEncumbrance_ctl03_Label1   ctl00_CPH1_DataList2_ctl03_Label1
//	        if (x=="" )
//	        {
//		        alert("Please enter a name for each document in the Title box.");
//		        return false;
//	        }
	        if(x!="" && y=="" && z.innerText=="")
		    {
		        alert("Please Uploading the document.");
		        return false;
		    }
		    if(x=="" && y!="" && z.innerText=="")
		    {
		        alert("Please enter the Title of Doc.");
		        return false;
		    }
		    
    }
    
     for(i=0;i<rep;i++)
    {
	     x = eval("document.aspnetForm.ctl00_CPH1_RptEncumbrance_ctl0"+i+"_txtdocTitles.value");
	     y = eval("document.aspnetForm.ctl00_CPH1_RptEncumbrance_ctl0"+i+"_DocEncumbrance.value");
	     var z = document.getElementById("ctl00_CPH1_RptEncumbrance_ctl0"+i+"_Label1");
//	     z = eval("document.aspnetForm.ctl00_CPH1_RptEncumbrance_ctl0"+i+"_Label1.value");
//	     alert( z);ctl00_CPH1_RptEncumbrance_ctl02_Label1

        if(x!="" && y=="" && z.innerText=="")
		    {
		        alert("Please Uploading the document.");
		        return false;
		    }
		    if(x=="" && y!="" && z.innerText=="")
		    {
		        alert("Please enter the Title of Doc.");
		        return false;
		    }

//	        if (x=="" )
//	        {
//		        alert("Please enter a name for each document in the Title box.");
//		        return false;
//	        }
//	        if(y=="" && z.innerText=="" )
//		    {
//		        alert("Uploading all the documents is mandatory.");
//		        return false;
//		    }
    }
}

function CheckFloorPlan()
{  
    
        if(document.aspnetForm.ctl00_CPH1_txtImageTitle1.value!="" && document.aspnetForm.ctl00_CPH1_FileUpload1.value== "")
        {
            alert("Image field should not be left blank.");
           document.aspnetForm.ctl00_CPH1_txtImageTitle1.focus();
            return false;
        }
        else if(document.aspnetForm.ctl00_CPH1_txtImageTitle1.value=="" && document.aspnetForm.ctl00_CPH1_FileUpload1.value!= "")
        {
            alert("Title field should not be left blank.");
            return false;
        }
        
    
        if(document.aspnetForm.ctl00_CPH1_txtImageTitle2.value!="" && document.aspnetForm.ctl00_CPH1_FileUpload2.value== "")
        {
            alert("Image field should not be left blank.");
            document.aspnetForm.ctl00_CPH1_txtImageTitle2.focus();
            return false;
        }
        else if(document.aspnetForm.ctl00_CPH1_txtImageTitle2.value=="" && document.aspnetForm.ctl00_CPH1_FileUpload2.value!= "")
        {
            alert("Title field should not be left blank.");
            return false;
        }
        
        
            if(document.aspnetForm.ctl00_CPH1_txtImageTitle3.value!="" && document.aspnetForm.ctl00_CPH1_FileUpload3.value== "")
        {
            alert("Image field should not be left blank.");
            document.aspnetForm.ctl00_CPH1_txtImageTitle3.focus();
            return false;
        }
        else if(document.aspnetForm.ctl00_CPH1_txtImageTitle3.value=="" && document.aspnetForm.ctl00_CPH1_FileUpload3.value!= "")
        {
            alert("Title field should not be left blank.");
            return false;
        }
        
        
            if(document.aspnetForm.ctl00_CPH1_txtImageTitle4.value!="" && document.aspnetForm.ctl00_CPH1_FileUpload4.value== "")
        {
            alert("Image field should not be left blank.");
            document.aspnetForm.ctl00_CPH1_txtImageTitle4.focus();
            return false;
        }
        else if(document.aspnetForm.ctl00_CPH1_txtImageTitle4.value=="" && document.aspnetForm.ctl00_CPH1_FileUpload4.value!= "")
        {
            alert("Title field should not be left blank.");
            return false;
        }
        
        
            if(document.aspnetForm.ctl00_CPH1_txtImageTitle5.value!="" && document.aspnetForm.ctl00_CPH1_FileUpload5.value== "")
        {
            alert("Image field should not be left blank.");
            document.aspnetForm.ctl00_CPH1_txtImageTitle4.focus();
            return false;
        }
        else if(document.aspnetForm.ctl00_CPH1_txtImageTitle5.value=="" && document.aspnetForm.ctl00_CPH1_FileUpload5.value!= "")
        {
            alert("Title field should not be left blank.");
            return false;
        }
        
        else
        {
            return true;
        }

}

function checkuserupdate()
{
	
        if(document.aspnetForm.ctl00_CPH1_txtFName.value=='')
        {
        alert("Please Enter First Name - thank you ! ");
        document.aspnetForm.ctl00_CPH1_txtFName.focus();
        return false;
        }           
        
        if(document.aspnetForm.ctl00_CPH1_txtLName.value=='')
        {
        alert("Please Enter Last Name - thank you ! ");
        document.aspnetForm.ctl00_CPH1_txtLName.focus();
        return false;
        }          
        
        if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtEmail.value))
        {
        document.aspnetForm.ctl00_CPH1_txtEmail.focus();
        return false;	 
        }
	        
}

function checkagent()
{
	
        if(document.aspnetForm.ctl00_CPH1_txtAgentName.value=='')
        {
        alert("Please Enter Agent Name - thank you ! ");
        document.aspnetForm.ctl00_CPH1_txtAgentName.focus();
        return false;
        }            
        
          if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtEmail.value))
        {
        document.aspnetForm.ctl00_CPH1_txtEmail.focus();
        return false;	 
        }
        if (document.aspnetForm.ctl00_CPH1_txtMobile.value=='')
        {
        alert("Please Enter Mobile Number - thank you ! ");

        document.aspnetForm.ctl00_CPH1_txtMobile.focus();
        return false;	 
        }
        
         if (document.aspnetForm.ctl00_CPH1_txtPhone1.value=='')
        {
        alert("Please Enter Phone Number - thank you ! ");

        document.aspnetForm.ctl00_CPH1_txtPhone1.focus();
        return false;	 
        }
        
      
        
         if (document.aspnetForm.ctl00_CPH1_txtProfile.value=='')
        {
            alert("Please Enter Profile - thank you ! ");
            document.aspnetForm.ctl00_CPH1_txtProfile.focus();
            return false;	 
        }
        
        
	        
}

function checkagency()
{	

 if (document.aspnetForm.ctl00_CPH1_ddMemberShipType.value=='' || document.aspnetForm.ctl00_CPH1_ddMemberShipType.value=='--Select--')
    {
    alert("Please Select Membership Type - thank you ! ");

    document.aspnetForm.ctl00_CPH1_ddMemberShipType.focus();
    return false;	 
    }
            
    if (document.aspnetForm.ctl00_CPH1_txtUserId.value=='')
    {
    alert("Please Enter User ID - thank you ! ");

    document.aspnetForm.ctl00_CPH1_txtUserId.focus();
    return false;	 
    }
    
     if (document.aspnetForm.ctl00_CPH1_txtPassword.value=='')
    {
    alert("Please Enter Password - thank you ! ");

    document.aspnetForm.ctl00_CPH1_txtPassword.focus();
    return false;	 
    }
    
    if (document.aspnetForm.ctl00_CPH1_txtPassword.value.length<6)
    {
    alert("Passwords have to be at least 6 character please- thank you ! ");

    document.aspnetForm.ctl00_CPH1_txtPassword.focus();
    return false;	 
    }
    
     if (document.aspnetForm.ctl00_CPH1_txtAgentName.value=='')
    {
            alert("Please Enter Agent Name - thank you ! ");

    document.aspnetForm.ctl00_CPH1_txtAgentName.focus();
    return false;	 
    }
    
     if (document.aspnetForm.ctl00_CPH1_txtOwnerName.value=='')
    {
        alert("Please Enter Owner Name - thank you ! ");
        document.aspnetForm.ctl00_CPH1_txtOwnerName.focus();
        return false;	 
    }
    
    if(document.aspnetForm.ctl00_CPH1_txtNoOfEmployee.value=='')
    {
    alert("Please Enter Number of Employees - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtNoOfEmployee.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtStreetAddress.value=='')
    {
    alert("Please Enter Street Address - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtStreetAddress.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_ddlCountry.options[0].selected==true)
    {
    alert("Please Select County - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlCountry.focus();
    return false;
    } 
     
     if(document.aspnetForm.ctl00_CPH1_ddlState.value=='---State---' || document.aspnetForm.ctl00_CPH1_ddlState.value=="--State--" || document.aspnetForm.ctl00_CPH1_ddlState.value=="" || document.aspnetForm.ctl00_CPH1_ddlState.value=="0")
    {
    alert("Please Select State - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlState.focus();
    return false;
    } 
       
     if(document.aspnetForm.ctl00_CPH1_ddlsuburb.value=='---Suburb---' || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="--Suburb--" || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="" || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="0")
    {
    alert("Please Select Suburb - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlsuburb.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtMobile.value=='')
    {
    alert("Please Enter Mobile Number - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtMobile.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtContactEmail.value=='')
    {
    alert("Please Enter Email - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtContactEmail.focus();
    return false;
    } 
     if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtContactEmail.value))
    {
    document.aspnetForm.ctl00_CPH1_txtContactEmail.focus();
    return false;	 
    }
//    if(document.aspnetForm.ctl00_CPH1_AgentSnap.value=='')
//    {
//    alert("Please Enter Agent Snap - thank you ! ");
////    document.aspnetForm.ctl00_CPH1_AgentSnap.focus();
//    return false;
//    }
    if(document.aspnetForm.ctl00_CPH1_txtProfile.value=='')
    {
    alert("Please Enter Profile - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtProfile.focus();
    return false;
    } 
	        
}

function checkagencyedit()
{	    
   
     if (document.aspnetForm.ctl00_CPH1_txtAgentName.value=='')
    {
            alert("Please Enter Agent Name - thank you ! ");

    document.aspnetForm.ctl00_CPH1_txtAgentName.focus();
    return false;	 
    }
    
     if (document.aspnetForm.ctl00_CPH1_txtOwnerName.value=='')
    {
        alert("Please Enter Owner Name - thank you ! ");
        document.aspnetForm.ctl00_CPH1_txtOwnerName.focus();
        return false;	 
    }
    
    if(document.aspnetForm.ctl00_CPH1_txtNoOfEmployee.value=='')
    {
    alert("Please Enter Number of Employees - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtNoOfEmployee.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtStreetAddress.value=='')
    {
    alert("Please Enter Street Address - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtStreetAddress.focus();
    return false;
    } 
     if(document.aspnetForm.ctl00_CPH1_ddlCountry.options[0].selected==true)
    {
    alert("Please Select County - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlCountry.focus();
    return false;
    } 
     
     if(document.aspnetForm.ctl00_CPH1_ddlState.value=='---State---' || document.aspnetForm.ctl00_CPH1_ddlState.value=="--State--" || document.aspnetForm.ctl00_CPH1_ddlState.value=="" || document.aspnetForm.ctl00_CPH1_ddlState.value=="0")
    {
    alert("Please Select State - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlState.focus();
    return false;
    } 
       
     if(document.aspnetForm.ctl00_CPH1_ddlsuburb.value=='--Select--' || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=='---Suburb---' || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="--Suburb--" || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="" || document.aspnetForm.ctl00_CPH1_ddlsuburb.value=="0")
    {
    alert("Please Select Suburb - thank you ! ");
    document.aspnetForm.ctl00_CPH1_ddlsuburb.focus();
    return false;
    } 
  
    if(document.aspnetForm.ctl00_CPH1_txtMobile.value=='')
    {
    alert("Please Enter Mobile Number - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtMobile.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtContactEmail.value=='')
    {
    alert("Please Enter Email - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtContactEmail.focus();
    return false;
    } 
     if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtContactEmail.value))
    {
    document.aspnetForm.ctl00_CPH1_txtContactEmail.focus();
    return false;	 
    }
//    if(document.aspnetForm.ctl00_CPH1_AgentSnap.value=='')
//    {
//    alert("Please Enter Agent Snap - thank you ! ");
////    document.aspnetForm.ctl00_CPH1_AgentSnap.focus();
//    return false;
//    }
    if(document.aspnetForm.ctl00_CPH1_txtProfile.value=='')
    {
    alert("Please Enter Profile - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtProfile.focus();
    return false;
    } 
	        
}

function ChckSendmail()
{
    if(document.aspnetForm.ctl00_CPH1_TextBox1.value=='')
    {
    alert("Please Enter Your Name - thank you ! ");
    document.aspnetForm.ctl00_CPH1_TextBox1.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtEmail.value=='')
    {
    alert("Please Enter Phone - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtEmail.focus();
    return false;
    } 
  
    if (!emailCheck(document.aspnetForm.ctl00_CPH1_TextBox3.value))
	{
	document.aspnetForm.ctl00_CPH1_TextBox3.focus();
	return false;	 
	}
    
    
   if(document.aspnetForm.ctl00_CPH1_txtMessage.value=='')
    {
    alert("Please Enter Message - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtMessage.focus();
    return false;
    } 
   
}
function CheckAgencyEmailReply()
{
  if(document.aspnetForm.ctl00_CPH1_txtEmail.value=='')
    {
    alert("Please Enter Email - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtEmail.focus();
    return false;
    } 
    else
    {
    if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtEmail.value))
	{
	document.aspnetForm.ctl00_CPH1_txtEmail.focus();
	return false;	 
	}
    }

    if(document.aspnetForm.ctl00_CPH1_txtName.value=='')
    {
    alert("Please Enter Name - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtName.focus();
    return false;
    } 
    if(document.aspnetForm.ctl00_CPH1_txtMessage.value=='')
    {
    alert("Please Enter Message - thank you ! ");
    document.aspnetForm.ctl00_CPH1_txtMessage.focus();
    return false;
    } 
  
  
    if (!emailCheck(document.aspnetForm.ctl00_CPH1_txtReplEmail.value))
	{
	document.aspnetForm.ctl00_CPH1_txtReplEmail.focus();
	return false;	 
	}
    
    
   
   
}







