
function ActivateRegionSelector(indexselected, indexvalue)
{

    //alert('Index: ' + document.frmSignUp.1stMemberShipSelection.selectedIndex + '\nValue: ' + document.frmSignUp.1stMemberShipSelection.options[objFrm.selectedIndex].value +'')

		//alert('Begining process to Hide /Display!');
		//alert( '\nIndex Selected: ' + indexselected +'');
	    //alert( '\nIndex Value:     ' + indexvalue +'');
	
		if( indexvalue < 100239)
		{
		
		document.frmSignUp.lstRegions.disabled = false;

		}
		else
		{
	
		document.frmSignUp.lstRegions.options[0].selected = false
		document.frmSignUp.lstRegions.options[1].selected = false
		document.frmSignUp.lstRegions.options[2].selected = false 
		document.frmSignUp.lstRegions.options[3].selected = false		
		document.frmSignUp.lstRegions.options[4].selected = false
		
		document.frmSignUp.lstRegions.disabled = true;
		document.frmSignUp.txtCost.value = 300;   // Old value was 400 New value is 300
	    document.frmSignUp.txtCost1.value = 300;  // Old value was 400 New value is 300
		}

}

  function getSelected(opt) {
            var selected = new Array();
            var index = 0;
            for (var intLoop = 0; intLoop < opt.length; intLoop++) {
               if ((opt[intLoop].selected) ||
                   (opt[intLoop].checked)) {
                  index = selected.length;
                  selected[index] = new Object;
                  selected[index].value = opt[intLoop].value;
                  selected[index].index = intLoop;
               }
            }
            return selected;
         }
         
         
     function getradioSelected(opt) {
            var selected = new Array();
            var index = 0;
            for (var intLoop = 0; intLoop < opt.length; intLoop++) {
               if ((opt[intLoop].selected) ||
                   (opt[intLoop].checked)) {
                  index = selected.length;
                  selected[index] = new Object;
                  selected[index].value = opt[intLoop].value;
                  selected[index].index = intLoop;
               }
            }
            return selected;
         }      
         
         
function Membership_vs_regionselector_helper(membershiptype,opt)
{

    //alert('Index: ' + document.frmSignUp.1stMemberShipSelection.selectedIndex + '\nValue: ' + document.frmSignUp.1stMemberShipSelection.options[objFrm.selectedIndex].value +'')

		//alert('Testing begin !');
		//alert( '\nSelected Regions: ' + opt +'');
	   
	      var index_for_regions_count = 0;
	     
	   
	     // Get a list of Regions the user selected
         var sel = getSelected(opt);
         var strSel = "";
         for (var item in sel)       
         {
         strSel += sel[item].value + "\n";
         index_for_regions_count = index_for_regions_count + 1;
         }
         
         //alert("Selected Regions:\n" + strSel);
         //alert("Count Index:\n" + index_for_regions_count);
         
		
         // Determin the what membership the client selected
         var sel = getradioSelected(membershiptype);
         var strradioSel = "";
         for (var item in sel)       
         {
         strradioSel += sel[item].value + "\n";
         }
		 //alert( '\nSelected memberships: ' +  strradioSel +'');
       
        //If you leave out the quotes, JavaScript thinks that you want to compare the value of the variable ownhouse with the value of the variable Yes.      
        
         
         // Logic for the Membership Type *Agent ID = 100235 
         
         if ((strradioSel == 100235) && ((index_for_regions_count > 0) && (index_for_regions_count < 2 ))  )
         {
         alert("Congradulation, your membership type matches number of regions you selected i.e 1, please proceed!!:\n"); 
         document.frmSignUp.txtCost.value = 300;  // Old value was 400 New value is 300
         document.frmSignUp.txtCost1.value = 300; // Old value was 400 New value is 300
         }
         else
         {
			         if ((strradioSel == 100235) && ((index_for_regions_count > 1) && (index_for_regions_count < 3 ))  )
			         {
			         alert("Congradulation, your membership type matches number of regions you selected i.e 2, please proceed!!:\n");
			          document.frmSignUp.txtCost.value = 450;  // Old value was 600 New value is 450
			          document.frmSignUp.txtCost1.value = 450; // Old value was 600 New value is 450
			         }
			         else
			         {
						     if ((strradioSel == 100235) && ((index_for_regions_count > 2) && (index_for_regions_count < 4 ))  )
					         {
					         alert("Congradulation, your membership type matches number of regions you selected i.e 3 , please proceed!!:\n");
					         document.frmSignUp.txtCost.value = 562.50;  // Old value was 750 New value is 562.50
					         document.frmSignUp.txtCost1.value = 562.50; // Old value was 750 New value is 562.50
					         }
					         else
					         {
									 if ((strradioSel == 100235) && ((index_for_regions_count > 3) && (index_for_regions_count < 6 ))  )
							         {
							         alert("Congradulation, your membership type matches number of regions you selected i.e 4 + , please proceed!!:\n");
							         document.frmSignUp.txtCost.value  = 675; // Old value was 900 New value is 675
							         document.frmSignUp.txtCost1.value = 675; // Old value was 900 New value is 675
							         }
							         else
							         {
							          
							         

		                                      if ((strradioSel != 100236) &&  (strradioSel != 100235))
									          
									          {
									              //alert("Sorry please select a Region :\n");
									              //document.frmSignUp.txtCost.value = 0;
									          }
							         
							         
							         }
					         }
			         }
         }
         
         
         
         if ((strradioSel == 100236) && ((index_for_regions_count > 0) && (index_for_regions_count < 2 ))  )
         {
         alert("Congradulation, your membership type matches number of regions you selected i.e 1, please proceed!!:\n");
         document.frmSignUp.txtCost.value = 300;  // Old value was 400 New value is 300
         document.frmSignUp.txtCost1.value = 300; // Old value was 400 New value is 300
         }
         else
         {
			         if ((strradioSel == 100236) && ((index_for_regions_count > 1) && (index_for_regions_count < 3 ))  )
			         {
			         alert("Congradulation, your membership type matches number of regions you selected i.e 2, please proceed!!:\n");
			         document.frmSignUp.txtCost.value = 450;  // Old value was 600 New value is 450
			         document.frmSignUp.txtCost1.value = 450; // Old value was 600 New value is 450
			         }
			         else
			         {
						     if ((strradioSel == 100236) && ((index_for_regions_count > 2) && (index_for_regions_count < 4 ))  )
					         {
					         alert("Congradulation, your membership type matches number of regions you selected i.e 3 , please proceed!!:\n");
					         document.frmSignUp.txtCost.value = 562.5;  // Old value was 750 New value is 562.5
					         document.frmSignUp.txtCost1.value = 562.5; // Old value was 750 New value is 562.5
					         }
					         else
					         {
									 if ((strradioSel == 100236) && ((index_for_regions_count > 3) && (index_for_regions_count < 6 ))  )
							         {
							         alert("Congradulation, your membership type matches number of regions you selected i.e 4 + , please proceed!!:\n");
							         document.frmSignUp.txtCost.value = 675;  // Old value was 900 New value is 675
							         document.frmSignUp.txtCost1.value = 675; // Old value was 900 New value is 675
							         }
							         else
							         {
							          
							              if ((strradioSel != 100235) &&  (strradioSel != 100237))
									          
									          {
									              //alert("Sorry please select a Region :\n");
									          }
							         
							         
							         
							         }
					         }
			         }
         }
         
         
         
         
      if ((strradioSel == 100237) && ((index_for_regions_count > 0) && (index_for_regions_count < 2 ))  )
         {
         alert("Congradulation, your membership type matches number of regions you selected i.e 1, please proceed!!:\n");
         document.frmSignUp.txtCost.value = 300;  // Old value was 400 New value is 300
         document.frmSignUp.txtCost1.value = 300;  // Old value was 400 New value is 300
         }
         else
         {
			         if ((strradioSel == 100237) && ((index_for_regions_count > 1) && (index_for_regions_count < 3 ))  )
			         {
			         alert("Congradulation, your membership type matches number of regions you selected i.e 2, please proceed!!:\n");
			         document.frmSignUp.txtCost.value = 450;  // Old value was 600 New value is 450
			         document.frmSignUp.txtCost1.value = 450;  // Old value was 600 New value is 450
			         }
			         else
			         {
						     if ((strradioSel == 100237) && ((index_for_regions_count > 2) && (index_for_regions_count < 4 ))  )
					         {
					         alert("Congradulation, your membership type matches number of regions you selected i.e 3 , please proceed!!:\n");
					         document.frmSignUp.txtCost.value = 562.5;  // Old value was 750 New value is 562.5
					         document.frmSignUp.txtCost1.value = 562.5;  // Old value was 750 New value is 562.5
					         }
					         else
					         {
									 if ((strradioSel == 100237) && ((index_for_regions_count > 3) && (index_for_regions_count < 6 ))  )
							         {
							         alert("Congradulation, your membership type matches number of regions you selected i.e 4 + , please proceed!!:\n");
							         document.frmSignUp.txtCost.value = 675; // Old value was 900 New value is 675
							         document.frmSignUp.txtCost1.value = 675; // Old value was 900 New value is 675
							         }
							         else
							         {
							          
							           if ((strradioSel != 100235) &&  (strradioSel != 100236))
									          
									          {
									              //alert("Sorry please select a Region :\n");
									          }
							          							         
							         }
					         }
			         }
         }
         
         
                       if ((index_for_regions_count <1) && (strradioSel != 100239))
									          
									          {
									              alert("You need to have one region :\n");
									          }
							          			
         
         
         
//End of function
 }


function IsCityBlank()
{
	if(frmDetailsSearch.txtCity.value== '')
	{
		alert('Please make sure the city field is filled!');
		frmDetailsSearch.txtCity.focus();
		return false;
	}
}



function validateEmailCart(objFrm)
{
	if(isValidEmail(objFrm.txtEmail.value)==false)
	{
		alert('Please enter a valid email address and try again!');
		objFrm.txtEmail.focus();
		return false;
	}
}

function validateRemoveFromCart()
{
	if(confirm('Are you sure you wish to remove this property from your cart?'))
		return true;
	else
		return false;
}		

function addToCart(lngID)
{
	window.location.href='index.asp?PageAction=AddToCart&ID='+lngID;
}

function amlaOpenTour()
{
	window.open('tour/index.asp','EditLst','width=770,height=600,toolbar=0,resize=1,scrollbars=1');
	//alert('Tour will open here');
}

function openPropPrintPage(lngID,lngPrintWhich)
{
	if(lngPrintWhich == 0)
	
		window.open('PrintListing.asp?ID='+lngID,'PrintListing','width=790,height=600,toolbar=0,resize=1,scrollbars=1');
	else
		window.open('PrintListingMember.asp?ID='+lngID,'PrintListing','width=790,height=600,toolbar=0,resize=1,scrollbars=1');
	
}

// ** Validate Photo Image File **//
function validateFile(objFrm)
{
	if(objFrm.txtUpload.value=='')
	{
		alert('Please click on "Browse..." to select the picture you wish to upload from your computer');
		objFrm.txtUpload.focus();
		return false;
	}
	//For now we do not have one of these
	//showUploadingAgentPictureDiv();
	objFrm.submit();
}
// ** END Validate Photo Image File **//


function removeMemberPhoto()
{
	if(confirm('Are you sure you wish to remove your photo?'))
		window.location.href='index.asp?PageAction=Members&Section=Profile&Tab=MemberPhoto&FormAction=RemovePhoto';
}

function removeMemberLogo()
{
	if(confirm('Are you sure you wish to remove your photo?'))
		window.location.href='index.asp?PageAction=Members&Section=Profile&Tab=CoLogo&FormAction=RemovePhoto';
}

function trim(str)
{
   return str.replace(/^\s*|\s*$/g,"");
}

function showHideSoldInfoDiv(lngID)
{
	if(lngID == 2)
		document.getElementById('editListingSoldInfoDiv').style.display='block';
	else
		document.getElementById('editListingSoldInfoDiv').style.display='none';
}
//
function validateAddMemberLink(objFrm){
	
	if(trim(objFrm.txttitle.value)=="")
	{
		
		alert("Please enter link title.");
		objFrm.txttitle.focus();
		return false;
	}
	
	if(trim(objFrm.txturl.value)=='')
	{
		alert('Please enter link URL.');
		objFrm.txturl.focus();
		return false;
	}
}
//

function validateAddNewListing(objFrm)
{

		
	if(trim(objFrm.txtCommission.value)=='')
	{
		alert('Please enter the Buyers Commission.');
		objFrm.txtCommission.focus();
		return false;
	}
	
	if(trim(objFrm.txtOwnerName.value)=='')
	{
		alert('Please enter the Owners Name.');
		objFrm.txtOwnerName.focus();
		return false;
	}
	
	if(trim(objFrm.txtOwnerPhone.value)=='')
	{
		alert('Please enter the Owners Telephone Number.');
		objFrm.txtOwnerPhone.focus();
		return false;
	}
	
	if(trim(objFrm.txtAddress.value)=='')
	{
		alert('Please enter the Owners Address.');
		objFrm.txtAddress.focus();
		return false;
	}
	
	if(objFrm.txtProvinceID.value=='')
	{
		alert('Please select the Province.');
		return false;
	}
	
	if(trim(objFrm.txtCityID.value)=='')
	{
		alert('Please select the City.');
		return false;
	}
	
	if(trim(objFrm.txtPostalCode.value)=='')
	{
		alert('Please enter the Postal Code.');
		objFrm.txtPostalCode.focus();
		return false;
	}
	
	
	
	objFrm.txtHidProvinceName.value = objFrm.txtProvinceName.value;
	objFrm.txtHidCityName.value = objFrm.txtCityName.value;



}


function validateUpdateListingForm()
{
	var objFrm = document.frmUpdateListing;

	if(objFrm.lstStatus.value == 2)
	{
		if(objFrm.txtDateSold.value != '')
		{
			if(checkdate(objFrm.txtDateSold) == false)
			{
				alert('Your Date Sold is invalid.  Please fix the date and try again.');
				return false
			}
		}
		else
		{
			alert('Please enter the Date when you sold the property.');
			objFrm.txtDateSold.focus();
			return false;
		}
		
		if(trim(objFrm.txtSoldPrice.value)=='')
		{
			alert('Please enter the Sold Price.');
			objFrm.txtSoldPrice.focus();
			return false;
		}
	}
	
	if(trim(objFrm.txtCommission.value)=='')
	{
		alert('Please enter the Buyers Commission.');
		objFrm.txtCommission.focus();
		return false;
	}
	
	if(trim(objFrm.txtOwnerName.value)=='')
	{
		alert('Please enter the Owners Name.');
		objFrm.txtOwnerName.focus();
		return false;
	}
	
	if(trim(objFrm.txtOwnerPhone.value)=='')
	{
		alert('Please enter the Owners Telephone Number.');
		objFrm.txtOwnerPhone.focus();
		return false;
	}
	
	if(trim(objFrm.txtAddress.value)=='')
	{
		alert('Please enter the Owners Address.');
		objFrm.txtAddress.focus();
		return false;
	}
	
	if(trim(objFrm.txtProvinceName.value)=='')
	{
		alert('Please select the Province.');
		objFrm.txtProvinceName.focus();
		return false;
	}
	
	if(trim(objFrm.txtCityName.value)=='')
	{
		alert('Please select the City.');
		objFrm.txtCityName.focus();
		return false;
	}
	
	if(trim(objFrm.txtPostalCode.value)=='')
	{
		alert('Please enter the Postal Code.');
		objFrm.txtPostalCode.focus();
		return false;
	}
	
	objFrm.txtHidProvName.value = objFrm.txtProvinceName.value;
	objFrm.txtHidCityName.value = objFrm.txtCityName.value;
	
}



function checkdate(objName) {
var datefield = objName;
if (chkdate(objName) == false) {
datefield.select();
//alert("That date is invalid.  Please try again.");
datefield.focus();
return false;
}
else {
return true;
   }
}
function chkdate(objName) {
var strDatestyle = "US"; //United States date style
//var strDatestyle = "EU";  //European date style
var strDate;
var strDateArray;
var strDay;
var strMonth;
var strYear;
var intday;
var intMonth;
var intYear;
var booFound = false;
var datefield = objName;
var strSeparatorArray = new Array("-"," ","/",".");
var intElementNr;
var err = 0;
var strMonthArray = new Array(12);
strMonthArray[0] = "Jan";
strMonthArray[1] = "Feb";
strMonthArray[2] = "Mar";
strMonthArray[3] = "Apr";
strMonthArray[4] = "May";
strMonthArray[5] = "Jun";
strMonthArray[6] = "Jul";
strMonthArray[7] = "Aug";
strMonthArray[8] = "Sep";
strMonthArray[9] = "Oct";
strMonthArray[10] = "Nov";
strMonthArray[11] = "Dec";
strDate = datefield.value;
if (strDate.length < 1) {
return true;
}
for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
strDateArray = strDate.split(strSeparatorArray[intElementNr]);
if (strDateArray.length != 3) {
err = 1;
return false;
}
else {
strDay = strDateArray[0];
strMonth = strDateArray[1];
strYear = strDateArray[2];
}
booFound = true;
   }
}
if (booFound == false) {
if (strDate.length>5) {
strDay = strDate.substr(0, 2);
strMonth = strDate.substr(2, 2);
strYear = strDate.substr(4);
   }
}
if (strYear.length == 2) {
strYear = '20' + strYear;
}
// US style
if (strDatestyle == "US") {
strTemp = strDay;
strDay = strMonth;
strMonth = strTemp;
}
intday = parseInt(strDay, 10);
if (isNaN(intday)) {
err = 2;
return false;
}
intMonth = parseInt(strMonth, 10);
if (isNaN(intMonth)) {
for (i = 0;i<12;i++) {
if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
intMonth = i+1;
strMonth = strMonthArray[i];
i = 12;
   }
}
if (isNaN(intMonth)) {
err = 3;
return false;
   }
}
intYear = parseInt(strYear, 10);
if (isNaN(intYear)) {
err = 4;
return false;
}
if (intMonth>12 || intMonth<1) {
err = 5;
return false;
}
if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
err = 6;
return false;
}
if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
err = 7;
return false;
}
if (intMonth == 2) {
if (intday < 1) {
err = 8;
return false;
}
if (LeapYear(intYear) == true) {
if (intday > 29) {
err = 9;
return false;
}
}
else {
if (intday > 28) {
err = 10;
return false;
}
}
}
if (strDatestyle == "US") {
datefield.value = strMonthArray[intMonth-1] + " " + intday+" " + strYear;
}
else {
datefield.value = intday + " " + strMonthArray[intMonth-1] + " " + strYear;
}
return true;
}
function LeapYear(intYear) {
if (intYear % 100 == 0) {
if (intYear % 400 == 0) { return true; }
}
else {
if ((intYear % 4) == 0) { return true; }
}
return false;
}
function doDateCheck(from, to) {
if (Date.parse(from.value) <= Date.parse(to.value)) {
alert("The dates are valid.");
}
else {
if (from.value == "" || to.value == "") 
alert("Both dates must be entered.");
else 
alert("To date must occur after the from date.");
   }
}


function changeSingleListingImage(strImageLoc)
{
	document.getElementById('img_Large_Main').src=strImageLoc;
}

function openUserProvCitySelect(strReturn)
{
	window.open('user-prov-city-select.asp?strSendBackTo='+strReturn,'EditLst','width=500,height=500,toolbar=0,resize=0');
}


function listingPhotoDelete(lngID,lngListingID)
{
	if (confirm('Are you sure you wish to delete this image?'))
	{
		window.location.href='index.asp?PageAction=Members&Section=EditListing&ID='+lngListingID+'&ImageID='+lngID+'&Tab=Photos&FormAction=Delete'
	}
}

function listingPhotoSetMain(lngID,lngListingID)
{
	window.location.href='index.asp?PageAction=Members&Section=EditListing&ID='+lngListingID+'&ImageID='+lngID+'&Tab=Photos&FormAction=SetMain'
}


function validateAddNewOtherProfile(objFrm)
{
	if (objFrm.txtFirst.value=='')
	{
		alert('Please enter your First Name');
		objFrm.txtFirst.focus();
		return false
	}
	
	if (objFrm.txtLast.value=='')
	{
		alert('Please enter your Last Name');
		objFrm.txtLast.focus();
		return false
	}
	

	if (objFrm.txtAddress.value=='')
	{
		alert('Please enter your Address');
		objFrm.txtAddress.focus();
		return false
	}

	if (objFrm.txtProvinceID.value=='')
	{
		alert('Please select your province & city.');
		return false
	}
	
	if (objFrm.txtPostalCode.value=='')
	{
		alert('Please enter your Postal Code');
		objFrm.txtPostalCode.focus();
		return false
	}
	
	if (objFrm.txtTelNum.value=='')
	{
		alert('Please enter your Telephone Number');
		objFrm.txtTelNum.focus();
		return false
	}

}


function checkLanguage(strLang){
	
	if(strLang=='01')
		alert('You will be viewing AMLA with English');
	
	
	if(strLang=='02')
		alert('You will be viewing AMLA with Spanish');

    frmLanguage.submit();
   
}


function validateSignUpForm(objFrm)
{

	if (objFrm.txtUser.value=='')
	{
		alert('Please enter your Username');
		objFrm.txtUser.focus();
		return false;
	}
	
	if (objFrm.txtPass.value=='')
	{
		alert('Please enter your Password');
		objFrm.txtPass.focus();
		return false;
	}
	
	
	if (objFrm.txtFirst.value=='')
	{
		alert('Please enter your First Name.');
		objFrm.txtFirst.focus();
		return false;
	}
	
	if (objFrm.txtLast.value=='')
	{
		alert('Please enter your Last Name.');
		objFrm.txtLast.focus();
		return false;
	}
	
	if (objFrm.txtCoName.value=='')
	{
		alert('Please enter your Company Name.');
		objFrm.txtCoName.focus();
		return false;
	}
	
	if (objFrm.txtAddress.value=='')
	{
		alert('Please enter your Address.');
		objFrm.txtAddress.focus();
		return false;
	}
	
	if (objFrm.txtEmail.value=='')
	{
		alert('Please enter your Email Address.');
		objFrm.txtEmail.focus();
		return false;
	}
	
	if (objFrm.txtProvinceName.value=='')
	{
		alert('Please enter your Province Name.');
		objFrm.txtProvinceName.focus();
		return false;
	}
	
	if (objFrm.txtCityName.value=='')
	{
		alert('Please enter your City Name.');
		objFrm.txtCityName.focus();
		return false;
	}
	
	if (objFrm.txtPostalCode.value=='')
	{
		alert('Please enter your Postal Code.');
		objFrm.txtPostalCode.focus();
		return false;
	}
	
	if (objFrm.txtTelNum.value=='')
	{
		alert('Please enter your Telephone Number.');
		objFrm.txtTelNum.focus();
		return false;
	}
	
	
	
	    if ((objFrm.lstRegions.value=='') && (document.frmSignUp.lstRegions.disabled))
	    {
		//alert('No Problemo Buyer Agents need no region!!!.');
		//objFrm.lstRegions.focus();
		//return false;
		}
		else if (   (objFrm.lstRegions.value=='') && (!(document.frmSignUp.lstRegions.disabled))   )
		{
		alert('Please select at least one region.');
		objFrm.lstRegions.focus();
		return false;
		}
		else
		{
		}
		
   
}


function validateRegisterForm(objFrm)
{

	if (objFrm.txtName.value=='')
	{
		alert('Please enter your Name.');
		objFrm.txtName.focus();
		return false;
	}
	
	if (objFrm.txtEmail.value=='')
	{
		alert('Please enter your Email Address.');
		objFrm.txtEmail.focus();
		return false;
	}
	if(isValidEmail(objFrm.txtEmail.value)==false)
	{
		alert('Please enter a valid email address and try again!');
		objFrm.txtEmail.focus();
		return false;
	}
	
	var Pass=objFrm.txtPass.value;
	if (Pass=='')
	{
		alert('Please enter your Password');
		objFrm.txtPass.focus();
		return false;
	} 
	else if(Pass.length<6 || Pass.length>20)
	{
		alert('Password should be at least 6 and at most 20 characters long.');
		objFrm.txtPass.focus();
		return false;
	} 

	if (objFrm.txtPass2.value!=Pass)
	{
		alert('Passwords do not match.');
		objFrm.txtPass2.focus();
		return false;
	} 

	if (objFrm.verificationCode.value=='')
	{
		alert('Please enter the verificationCode.');
		objFrm.verificationCode.focus();
		return false;
	}
   
}


function validateBuyingPropertyPage(objFrm)
{
	if (objFrm.txtName.value=='')
	{
		alert('Please enter your First & Last Name.');
		objFrm.txtName.focus();
		return false;
	}
	
	if (objFrm.txtPhone.value=='')
	{
		alert('Please enter your Telephone Number.');
		objFrm.txtPhone.focus();
		return false;
	}
	
	if (objFrm.txtProvince.value=='')
	{
		alert('Please select the Province & City.');
		return false;
	}
	
	if (objFrm.lstPropertyType.value=='')
	{
		alert('Please select the type of Property you are looking for.');
		objFrm.lstPropertyType.focus();
		return false;
	}
}

function validateLocateAgentSellingPage(objFrm)
{
	if (objFrm.txtRegion.value=='')
	{
		alert('Please select the Province & City');
		return false;
	}
}

function validateSellingContactForm(objFrm)
{
	if (objFrm.txtName.value=='')
	{
		alert('Please enter your First & Last Name.');
		objFrm.txtName.focus();
		return false;
	}
	
	if (objFrm.txtPhone.value=='')
	{
		alert('Please enter your Telephone Number.');
		objFrm.txtPhone.focus();
		return false;
	}
	
	if (objFrm.txtEmail.value=='') 
	{
		alert('Please enter an email address.');
		return false;
	}
	

}

function isValidEmail(str) 
{
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
