﻿

function defaultButtonFix() {
__defaultFired = false;
}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}
// JScript File
function AllowOnlyNumericDot(e)
{

	
     var key = (window.event) ? event.keyCode : e.which;  
	
 	
if ( key > 47 && key < 58 || key == 46 || key==8 || key==44)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}
 
// JScript File
function AllowOnlyNumericDotDash(e)
{
	
     var key = (window.event) ? event.keyCode : e.which;  
	
if ( key > 47 && key < 58 || key == 46 || key==8 || key==45|| key==44)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}

   function AllowOnlyNumericCommaDash(e)
{
	
     var key = (window.event) ? event.keyCode : e.which;  

if ( key > 47 && key < 58  || key==8 || key==45 || key==44)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}



// JScript File
function AllowOnlyNumeric(e)
{
	
     var key = (window.event) ? event.keyCode : e.which;  
	//alert(key) 
if ( key > 47 && key < 58 || key == 46 || key==8 || key==45)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}
////////Register for Classifieds
function EnableState(obj)
{

ddlCity=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlCity;
ddlState=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlState;
txtState=document.aspnetForm.ctl00_ContentPlaceHolder1_txtState;
txtCity=document.aspnetForm.ctl00_ContentPlaceHolder1_txtCity;

if(obj.value!="1")
{
ddlCity.style.display="none";
ddlState.style.display="none";
txtState.style.display="inline";
txtCity.style.display="inline";

}
else
{


ddlCity.style.display="inline";
ddlState.style.display="inline";
txtState.style.display="none";
txtCity.style.display="none";

}
}

function EnableCity(obj)
{
txtCity=document.aspnetForm.ctl00_ContentPlaceHolder1_txtCity;

if(obj.value=="0")
{

txtCity.style.display="inline";
}
else
{
txtCity.style.display="none";


}
}
function Confirm(val)
{

        
     if(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(val); 
     
    if(!Page_IsValid)
    { 
       
        var i;
    for (i = 0; i < Page_Validators.length; i++)
     {
        if (!Page_Validators[i].isvalid)
         {
           if( document.getElementById(Page_Validators[i].controltovalidate)!=null)
           {
            document.getElementById(Page_Validators[i].controltovalidate).focus();
            break;
            }
        } 
    }
    }
}




function DateValidate(source, args)
{
    args.IsValid = true;
    drpDate=document.getElementById("ctl00_ContentPlaceHolder1_drpDate");
   drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpMonth");
   drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpYear");
   drpHours=document.getElementById("ctl00_ContentPlaceHolder1_drpHours");
   drpMins=document.getElementById("ctl00_ContentPlaceHolder1_drpMins");
  
    if(drpDate.selectedIndex==0 || drpMonth.selectedIndex==0  || drpYear.selectedIndex==0 || drpHours.selectedIndex==0 || drpMins.selectedIndex==0)
    {
    args.IsValid = false;

    }
    else
    {
 var strdate=drpDate.value + "/" + drpMonth.value + "/" + drpYear.value;
   args.IsValid = validIndianDate(strdate,"");
   }
    return args.IsValid;
}

function CompareDate(source, args)
{

    args.IsValid = true;

    drpDate=document.getElementById("ctl00_ContentPlaceHolder1_drpDate");
   drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpMonth");
   drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpYear");
   drpHours=document.getElementById("ctl00_ContentPlaceHolder1_drpHours");
   drpMins=document.getElementById("ctl00_ContentPlaceHolder1_drpMins");
    if(drpDate.selectedIndex==0 || drpMonth.selectedIndex==0  || drpYear.selectedIndex==0 || drpHours.selectedIndex==0 || drpMins.selectedIndex==0)
    {
   

    }
    else
    {
var strdate=drpDate.value + "/" + drpMonth.value + "/" + drpYear.value;
var date=new Date();

args.IsValid = compareWithCurrentDate(date.getDate() + "/" + date.getMonth()+ "/" +date.getYear(),strdate,"");
    }

    return args.IsValid;
}
function DateRValidate(source, args)
{
    args.IsValid = true;
    drpDate=document.getElementById("ctl00_ContentPlaceHolder1_drpRDate");
   drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpRMonth");
   drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpRYear");
   drpHours=document.getElementById("ctl00_ContentPlaceHolder1_drpRHour");
   drpMins=document.getElementById("ctl00_ContentPlaceHolder1_drpRMin");
  
    if(drpDate.selectedIndex==0 || drpMonth.selectedIndex==0  || drpYear.selectedIndex==0 || drpHours.selectedIndex==0 || drpMins.selectedIndex==0)
    {
    args.IsValid = false;

    }
    else
    {
 var strdate=drpDate.value + "/" + drpMonth.value + "/" + drpYear.value;
   args.IsValid = validIndianDate(strdate,"");
   }
    return args.IsValid;
}

function CompareRDate(source, args)
{
    args.IsValid = true;

    drpRDate=document.getElementById("ctl00_ContentPlaceHolder1_drpRDate");
   drpRMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpRMonth");
   drpRYear=document.getElementById("ctl00_ContentPlaceHolder1_drpRYear");
   drpDate=document.getElementById("ctl00_ContentPlaceHolder1_drpDate");
   drpMonth=document.getElementById("ctl00_ContentPlaceHolder1_drpMonth");
   drpYear=document.getElementById("ctl00_ContentPlaceHolder1_drpYear");
     drpRHours=document.getElementById("ctl00_ContentPlaceHolder1_drpRHour");
   drpRMins=document.getElementById("ctl00_ContentPlaceHolder1_drpRMin");
   if(drpRDate.selectedIndex==0 || drpRMonth.selectedIndex==0  || drpRYear.selectedIndex==0 || drpRHours.selectedIndex==0 || drpRMins.selectedIndex==0)
    {
    }
    else
    {
var strdate=drpDate.value + "/" + drpMonth.value + "/" + drpYear.value;
var strdate1=drpRDate.value + "/" + drpRMonth.value + "/" + drpRYear.value;
var date=new Date();

args.IsValid = compareWithCurrentDate(strdate,strdate1,"");
    
}
    return args.IsValid;
}



  function IndustryPhone(source, args)
{
args.IsValid = true;

txtPhLand=document.getElementById("ctl00_ContentPlaceHolder1_txtLandline").value
txtMobile=document.getElementById("ctl00_ContentPlaceHolder1_txtMobile").value


if(txtPhLand=="" && txtMobile=="")
{
args.IsValid = false;
}
else
{

if(txtPhLand!="")
{
    if(txtPhLand.length!=7)
    {
        args.IsValid = false;
    }
}

if(txtMobile!="")
{
    if(txtMobile.length<10)
    {
        args.IsValid = false;
    }
}



}

return args.IsValid;

} 



    function Check(source, args)
{
args.IsValid = true;

txtPhLand=document.getElementById("ctl00_ContentPlaceHolder1_txtPhLand").value
txtMobile=document.getElementById("ctl00_ContentPlaceHolder1_txtMobile").value


if(txtPhLand=="" && txtMobile=="")
{
args.IsValid = false;
}
else
{

if(txtPhLand!="")
{
    if(txtPhLand.length<7)
    {
        args.IsValid = false;
    }
}

if(txtMobile!="")
{
    if(txtMobile.length<10)
    {
        args.IsValid = false;
    }
}



}

return args.IsValid;

} 
function CheckDrop(source, args)
{
args.IsValid = true;

txtPAdd=document.getElementById("ctl00_ContentPlaceHolder1_txtAdd").value
drpPOpt=document.getElementById("ctl00_ContentPlaceHolder1_drpDOptions").value


if(txtPAdd=="" && drpPOpt=="")
{
args.IsValid = false;
document.getElementById("ctl00_ContentPlaceHolder1_txtAdd").disabled=false;

document.getElementById("ctl00_ContentPlaceHolder1_drpDOptions").disabled=false;

}
 if(drpPOpt!="")
{

document.getElementById("ctl00_ContentPlaceHolder1_txtAdd").disabled=true;

document.getElementById("ctl00_ContentPlaceHolder1_drpDOptions").disabled=false;
}
else if(txtPAdd!="")
{
document.getElementById("ctl00_ContentPlaceHolder1_txtAdd").disabled=false;

document.getElementById("ctl00_ContentPlaceHolder1_drpDOptions").disabled=true;
}


return args.IsValid;

}
 function CheckPickUp(source, args)
{
args.IsValid = true;

txtPAdd=document.getElementById("ctl00_ContentPlaceHolder1_txtPlace").value
drpPOpt=document.getElementById("ctl00_ContentPlaceHolder1_drpPickOptions").value


if(txtPAdd=="" && drpPOpt=="")
{
args.IsValid = false;
document.getElementById("ctl00_ContentPlaceHolder1_txtPlace").disabled=false;

document.getElementById("ctl00_ContentPlaceHolder1_drpPickOptions").disabled=false;

}
 if(drpPOpt!="")
{

document.getElementById("ctl00_ContentPlaceHolder1_txtPlace").disabled=true;

document.getElementById("ctl00_ContentPlaceHolder1_drpPickOptions").disabled=false;
}
else if(txtPAdd!="")
{
document.getElementById("ctl00_ContentPlaceHolder1_txtPlace").disabled=false;

document.getElementById("ctl00_ContentPlaceHolder1_drpPickOptions").disabled=true;
}


return args.IsValid;

}
function ChangeSel(val)
{

var obj;
var a=0;
//alert(document.forms[0].elements("ctl00_ContentPlaceHolder1_dlCat_ctl01_rdn"))

for(i=1;i<250;i++)
{

    if(i<10)
    {
        obj=document.forms[0].elements["ctl00$ContentPlaceHolder1$dlCat$ctl0"+i+"$rdn1"]
      
         if(obj!=null)
        {
       obj.checked=false;
          
        }
    
}
else
{
    obj=document.forms[0].elements["ctl00$ContentPlaceHolder1$dlCat$ctl"+i+"$rdn1"]
    if(obj!=null)
    {
   obj.checked=false;
       
    }

}

}

val.checked=true;
}
function Val11(source, args)
{
var obj;
var a=0;
//alert(document.forms[0].elements("ctl00_ContentPlaceHolder1_dlCat_ctl01_rdn"))

for(i=1;i<250;i++)
{

    if(i<10)
    {
        obj=document.forms[0].elements["ctl00$ContentPlaceHolder1$dlCat$ctl0"+i+"$rdn1"]
        if(obj!=null)
        {
       
            if(obj.checked)
            {
           if(a==0)
            a=1
            }
        }
    
}
else
{
    obj=document.forms[0].elements["ctl00$ContentPlaceHolder1$dlCat$ctl"+i+"$rdn1"]
    if(obj!=null)
    {
   
        if(obj.checked)
        {
             if(a==0)
            a=1
        }
    }

}

}

if(a==0)
args.IsValid=false;
else
args.IsValid=true;



return args.IsValid;

}




function CurrentEmployer(source, args)
{
args.IsValid = true;
//Exp= document.getElementById("ctl00_ContentPlaceHolder1_rdType_0")
alert(document.getElementById("ctl00_ContentPlaceHolder1_rdType_0"));
//txtFname=document.getElementById("ctl00_ContentPlaceHolder1_txtCurrentOrgan").value

//if(Exp.checked && txtFname=="")
//{

//args.IsValid = false;

//}
//   
//   return  args.IsValid; 
}

//function CurrentDesignation(source, args)
//{
//args.IsValid = true;
//Exp= document.forms[0].elements["ctl00$ContentPlaceHolder1$cblAdvance"]
//txtFname=document.getElementById("ctl00_ContentPlaceHolder1_txtCurrJobProf").value

//if(Exp.checked && txtFname=="")
//{

//args.IsValid = false;

//}
//   
//   return  args.IsValid; 
//}

//function CurrentEmployer(source, args)
//{
//args.IsValid = true;
//Exp= document.forms[0].elements["ctl00$ContentPlaceHolder1$cblAdvance"]
//txtFname=document.getElementById("ctl00_ContentPlaceHolder1_txtCurrentSalary").value

//if(Exp.checked && txtFname=="")
//{

//args.IsValid = false;

//}
//   
//   return  args.IsValid; 
//}


function FNameValidate(source, args)
{
args.IsValid = true;

txtFname=document.getElementById("ctl00_ContentPlaceHolder1_txtUname").value
if(txtFname.length<6)
    {
        args.IsValid = false;
    }
    else
    {
         var reg=/[^0-9a-zA-Z_-]/;
        
        if (reg.test(txtFname)) 
        {
          args.IsValid = false;
        }
    }
   
   return  args.IsValid; 
}
function PassValidate(source, args)
{
args.IsValid = true;

txtPass=document.getElementById("ctl00_ContentPlaceHolder1_txtPass").value
if(txtPass.length<6)
    {
        args.IsValid = false;
    }
    else
    {
         var reg=/[^0-9a-zA-Z_-]/;
        
        if (reg.test(txtPass)) 
        {
          args.IsValid = false;
        }
    }
   
   return  args.IsValid; 
}
/////


////////For Taxi Service


////


function VSpace(ctrl,ctrlname)
{
	
	var content;
	content = ctrl.value;
	
	//for space entered 		
	if(content.length > 0)
	{
		for(var i=0;i<content.length;i++)
		{
			if(content.charAt(i)!=String.fromCharCode(32))
			{
				return true;
			}
		}
		alert("Please Enter " + ctrlname +"!");
		ctrl.value=""
		ctrl.focus();	
		return false;
	}
	else
	{
		//for null 
	    alert("Please Enter " + ctrlname +"!");
		ctrl.focus();	
		return false;
	}
	return true;
}

function Cis(txt) {
	if(txt == null || txt == "" || txt == "undefined") {
		return "";
	}
        var re = "\\s*";
        var re1 = new RegExp("^" + re);
        var re2 = new RegExp(re + "$");
        txt = txt.replace(re1,"");
        txt = txt.replace(re2,"");
        return txt;
}

function vE(srcObj,objNamePassed) {
	
	var email = srcObj.value;
	var objName = objNamePassed;
	if(objName == "" || objName == null) {
		objName = "Email ID " + srcObj.name;
	}
	email = Cis(email);
	srcObj.value = email;
	var re = new RegExp("^\([\\w_\\-\\.]+\)\@\([\\w_\\-]\+\\.\)+\([\\w_]\+\)$");
	if(email.match(re)) {
		return email;
	}
	alert("'" + email + "' is not a Valid " + objName);
	srcObj.focus();
	
	return false;
}

function vE_mul(srcObj,objNamePassed) {
	
	var email = srcObj;
	var objName = objNamePassed;
	if(objName == "" || objName == null) {
		objName = "Email ID " + srcObj.name;
	}
	email = Cis(email);
	srcObj = email;
	var re = new RegExp("^\([\\w_\\-\\.]+\)\@\([\\w_\\-]\+\\.\)+\([\\w_]\+\)$");
	if(email.match(re)) {
		return email;
	}
	alert("'" + email + "' is not a Valid " + objName);
	//srcObj.focus();
	
	return false;
}
function Req_mand(ctrl,ctrlname)
{
	if(ctrl.value=="")
	{
		alert("Please Enter " + ctrlname +"!");
		ctrl.focus();
		return false;
	}
	else if(VSpace(ctrl,ctrlname)==false)
	{
		ctrl.focus();
		return false;
	}
	return true;
}

function SMenu(ctrl,ctrlname)
{
	
	if(ctrl.value=="")		
	{
		alert("Please Select " + ctrlname);
		return false;
	}
}


function MLength(ctrl,ctrlname,ctrlCharacter)
{
		var ctrllength=ctrl.value;
	if(ctrllength.length>ctrlCharacter)
	{
		alert("Please Enter Only " + ctrlCharacter + " Characters for " + ctrlname);
		ctrl.focus();
		return false;
	}
}



function CNumber(obj, objName)
{
	var alphaExp = /^[0-9-]+$/;
	if(obj.value.match(alphaExp)){
		return true;
	}else{
		alert(objName + ' can have Numbers and "-" only!');
		obj.focus();
		return false;
	}
}




//***************************************************************************
//Check if the Date is Valid Indian Date. [dd/mm/yyyy]
// return date if valid,
// false otherwise
//***************************************************************************
function validIndianDate(srcObj,objNamePassed) {
	
	var formatMessage = "\n\nPlease Enter the date in DD/MM/YYYY Format";
	var val = srcObj;
	var objName = objNamePassed;
	
	val = trim(val);
	var re = new RegExp("^\([0-9]{1,2}\).\([0-9]{1,2}\).\([0-9][0-9][0-9]{0,2}\)$");
	var daysOfMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
	
	var monthNames = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	
	if(val.match(re)) {
		var tmpDate = re.exec(val);
		if(tmpDate[2] > 12 || tmpDate[2] < 1) {
			//alert("Invalid Month : " + tmpDate[2] + " in Field " + objName + formatMessage);
			
			return false;
		}
		tmpDate[2]--;
		
		if(tmpDate[3] <49 && tmpDate[3] > 0) {
			tmpDate[3] = "20" + tmpDate[3];
		}
		if(tmpDate[3] == "00" ||tmpDate[3] == "0") {
			tmpDate[3] = "2000";
		}
		if(tmpDate[3] <100 && tmpDate[3] > 49) {
			tmpDate[3] = "19" + tmpDate[3];
		}
		if(tmpDate[3] > 9999 || tmpDate[3] < 1900) {
			//alert("Invalid Year : " + tmpDate[3] + ". Valid Values are between 1900 and 9999 Only." + " for Field " + objName + formatMessage);
			
			return false;
		}
		if(tmpDate[3]%4 == 0) {
			daysOfMonth[1]++;
		}
		if(tmpDate[3]%400 != 0 && tmpDate[3]%100 == 0) {
			daysOfMonth[1]--;
		}
		if(tmpDate[1] <= 0) {
			//alert("Invalid Day : " + tmpDate[1] + " in Field " + objName + formatMessage);
		
			return false;
		}
		if(tmpDate[1] > daysOfMonth[tmpDate[2]]) {
			//alert(monthNames[tmpDate[2]]  + " in Field " + objName + " can have only " + daysOfMonth[tmpDate[2]] + " Days.");
		
			return false;
		}
		//var newDate = new Date(tmpDate[3],tmpDate[1],tmpDate[2]);
		var newDate = tmpDate[1]  + " " + monthNames[tmpDate[2]] + ", " + tmpDate[3];
		return newDate;
	}
	//alert("Invalid Date : " + val + " in Field " + objName + formatMessage);

	return false;
}



function compareWithCurrentDate(today,todate,toname)
{

	
	
	var mdate = todate;	
	var pos1 = mdate.indexOf("/");
	var newdate = mdate.substr(pos1+1);
	var pos2 = newdate.indexOf("/");
	var dval2= mdate.substr(0,pos1);
	var mval2 = newdate.substr(0,pos2);
	var yval2 = newdate.substr(pos2+1);
		
	//obtain month,day and year of current date
	var mdate = today;
	var pos1 = mdate.indexOf("/");
	var newdate = mdate.substr(pos1+1);
	var pos2 = newdate.indexOf("/");
	var dval3= mdate.substr(0,pos1);
	var mval3= newdate.substr(0,pos2);
	var yval3= newdate.substr(pos2+1);
	var date1=mval2 + "/" + dval2 + "/" + yval2;
	var today1=mval3 + "/" + dval3 + "/" + yval3;

	
	date1=new Date(date1);
	today1=new Date(today1);
	

	if(date1 <today1) 
	{ 
	//	alert(toname + " should be Greater than or equal to Current date");
		
		return false; 
			
	} 
	return true;
}

//**************************************************************************
// Check if the Time is Valid
//**************************************************************************

function IsValidTime(timeStr) 
{
	// Checks if time is in HH:MM:SS AM/PM format.
	// The seconds and AM/PM are optional.
	
	var timePat = /^(\d{1,2}):(\d{2})(:(\d{2}))?(\s?(AM|am|PM|pm))?$/;
	
	var matchArray = timeStr.match(timePat);
	if (matchArray == null) {
	alert("Time is not in a valid format.");
	return false;
	}
	hour = matchArray[1];
	minute = matchArray[2];
	second = matchArray[4];
	ampm = matchArray[6];
	
	if (second=="") { second = null; }
	if (ampm=="") { ampm = null }
	
	if (hour < 0  || hour > 23) {
	alert("Hour must be between 1 and 12. (or 0 and 23 for military time)");
	return false;
	}
	if (hour <= 12 && ampm == null) {
		if (confirm("Please indicate which time format you are using.  OK = Standard Time, CANCEL = Military Time")) {
		alert("You must specify AM or PM.");
		return false;
		}
	}
	if  (hour > 12 && ampm != null) {
	alert("You can't specify AM or PM for military time.");
	return false;
	}
	if (minute<0 || minute > 59) {
	alert ("Minute must be between 0 and 59.");
	return false;
	}
	if (second != null && (second < 0 || second > 59)) {
	alert ("Second must be between 0 and 59.");
	return false;
	}
return false;
}
function trim(txt) {
	if(txt == null || txt == "" || txt == "undefined") {
		return "";
	}
        var re = "\\s*";
        var re1 = new RegExp("^" + re);
        var re2 = new RegExp(re + "$");
        txt = txt.replace(re1,"");
        txt = txt.replace(re2,"");
        return txt;
}



function AllowOnlyNumeric(e)
{
	
     var key = (window.event) ? event.keyCode : e.which;  
	
if ( key > 47 && key < 58 || key == 46 || key==8 || key==45 || key==44)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}


function compareIndianDates(fromdate,fromname,todate,toname)
{
	
	
	
	//obtain month,day and year of date1
	var mdate = fromdate;
	var pos1 = mdate.indexOf("/");
	var newdate = mdate.substr(pos1+1);
	var pos2 = newdate.indexOf("/");
	var dval1= mdate.substr(0,pos1);
	var mval1 = newdate.substr(0,pos2);
	var yval1 = newdate.substr(pos2+1);
	
	//obtain month,day and year of date2
	var mdate = todate;
	var pos1 = mdate.indexOf("/");
	var newdate = mdate.substr(pos1+1);
	var pos2 = newdate.indexOf("/");
	var dval2= mdate.substr(0,pos1);
	var mval2 = newdate.substr(0,pos2);
	var yval2 = newdate.substr(pos2+1);
		
	var date1=mval1 + "/" + dval1 + "/" + yval1;
	var date2=mval2 + "/" + dval2 + "/" + yval2;

	
	date1=new Date(date1);
	date2=new Date(date2);
	
	if(date1 > date2) 
	{ 
		alert(fromname + " should be less than " + toname);
	
		return false; 
	} 
	return true;
}
function CheckLengthDesc(source, args)
{
args.IsValid = true;

ddlPDesc=document.getElementById("ctl00_ContentPlaceHolder1_txtLname").value

if(ddlPDesc.length<50 || ddlPDesc.length>400)
{
args.IsValid = false;


}
return args.IsValid;

}


/*
realEstate

function Validate()
{
ddlMinAmt=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlMinAmt;

ddlMaxAmt=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlMaxAmt;
ddlMinAmtType=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlMinAmtType;
ddlMaxAmtType=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlMaxAmtType;


if(parseInt(ddlMinAmt.value)!=0 && parseInt(ddlMinAmtType.value)!=0 && parseInt(ddlMaxAmt.value)!=0 && parseInt(ddlMaxAmtType.value)!=0)
{
if((parseInt(ddlMinAmt.value)*parseInt(ddlMinAmtType.value))>(parseInt(ddlMaxAmt.value)*parseInt(ddlMaxAmtType.value)))
{

alert("From Range Should be Less than To Range")
ddlMinAmt.selectedIndex=0;
ddlMaxAmt.selectedIndex=0;
ddlMinAmtType.selectedIndex=0;
ddlMaxAmtType.selectedIndex=0;
ddlMinAmt.focus();
}
}

ddlRMin=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlRMin;
ddlRUnit=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlRUnit;
ddlRMax=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlRMax;
ddlRUnitMax=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlRUnitMax;

if(ddlRMin!=null)
{
if(parseInt(ddlRMin.value)!=0 && parseInt(ddlRUnit.value)!=0 && parseInt(ddlRMax.value)!=0 && parseInt(ddlRUnitMax.value)!=0)
{
if((parseInt(ddlRMin.value)*parseInt(ddlRUnit.value))>(parseInt(ddlRMax.value)*parseInt(ddlRUnitMax.value)))
{

alert("From Range Should be Less than To Range")

ddlRMin.selectedIndex=0;
ddlRMax.selectedIndex=0;
ddlRUnit.selectedIndex=0;
ddlRUnitMax.selectedIndex=0;

ddlRMin.focus();
}
}
}

ddlRMin=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlLMin;
ddlRUnit=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlLMinUnit;
ddlRMax=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlLMax;
ddlRUnitMax=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlLMaxUnit;

if(ddlRMin!=null)
{
if(parseInt(ddlRMin.value)!=0 && parseInt(ddlRUnit.value)!=0 && parseInt(ddlRMax.value)!=0 && parseInt(ddlRUnitMax.value)!=0)
{
if((parseInt(ddlRMin.value)*parseInt(ddlRUnit.value))>(parseInt(ddlRMax.value)*parseInt(ddlRUnitMax.value)))
{

alert("From Range Should be Less than To Range")
ddlRMin.selectedIndex=0;
ddlRMax.selectedIndex=0;
ddlRUnit.selectedIndex=0;
ddlRUnitMax.selectedIndex=0;
ddlRMin.focus();
}
}
}
}*/
// JScript File
function AllowOnlyNumeric(e)
{
	
     var key = (window.event) ? event.keyCode : e.which;  
	//alert(key) 
if ( key > 47 && key < 58 || key == 46 || key==8 || key==45)  
   return;
 else
 {
   if (window.event) 
       window.event.returnValue = null;
     else 
     e.preventDefault(); 
	 }
}
// JScript File

function Checkifselected(source, args)
{
 
args.IsValid = true;
  
 var chk1=document.aspnetForm.ctl00$ContentPlaceHolder1$chk1;

var chk2=document.aspnetForm.ctl00$ContentPlaceHolder1$chk2;
var chk3=document.aspnetForm.ctl00$ContentPlaceHolder1$chk3;
var chk4=document.aspnetForm.ctl00$ContentPlaceHolder1$chk4;
if(chk2.checked ||chk1.checked ||chk3.checked ||chk4.checked )
args.IsValid = true;
else
args.IsValid = false;
return args.IsValid; 

}
function Checkifselected1(source, args)
{
 
args.IsValid = true;
  
 var chk1=document.aspnetForm.ctl00$ContentPlaceHolder1$chk1;

var chk2=document.aspnetForm.ctl00$ContentPlaceHolder1$chk2;
var chk3=document.aspnetForm.ctl00$ContentPlaceHolder1$chk3;
var chk4=document.aspnetForm.ctl00$ContentPlaceHolder1$chk4;
var chk5=document.aspnetForm.ctl00$ContentPlaceHolder1$chk5;
var chk6=document.aspnetForm.ctl00$ContentPlaceHolder1$chk6;
var chk7=document.aspnetForm.ctl00$ContentPlaceHolder1$chk7;
var chk8=document.aspnetForm.ctl00$ContentPlaceHolder1$chk8;
if(chk2.checked ||chk1.checked ||chk3.checked ||chk4.checked||chk5.checked ||chk6.checked ||chk7.checked ||chk8.checked  )
args.IsValid = true;
else
args.IsValid = false;
return args.IsValid; 

}
function Checkifselected12(source, args)
{
 
args.IsValid = true;
  
 var chk1=document.aspnetForm.ctl00$ContentPlaceHolder1$chk1;

var chk2=document.aspnetForm.ctl00$ContentPlaceHolder1$chk2;
var chk3=document.aspnetForm.ctl00$ContentPlaceHolder1$chk3;
var chk4=document.aspnetForm.ctl00$ContentPlaceHolder1$chk4;
var chk5=document.aspnetForm.ctl00$ContentPlaceHolder1$chk5;
var chk6=document.aspnetForm.ctl00$ContentPlaceHolder1$chk6;
 
if(chk2.checked ||chk1.checked ||chk3.checked ||chk4.checked||chk5.checked ||chk6.checked )
args.IsValid = true;
else
args.IsValid = false;
return args.IsValid; 

}
function EnableStateText(obj)
{

ddlCity=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlCity;
txtState=document.aspnetForm.ctl00_ContentPlaceHolder1_txtState;
txtCity=document.aspnetForm.ctl00_ContentPlaceHolder1_txtCity;
if(obj.value=="36")
{


txtState.style.display="inline";
txtCity.style.display="inline";

}
else
{


txtState.style.display="none";
txtCity.style.display="none";
}
}
function EnableState(obj)
{

ddlCity=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlCity;
ddlState=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlState;
txtState=document.aspnetForm.ctl00_ContentPlaceHolder1_txtState;
txtCity=document.aspnetForm.ctl00_ContentPlaceHolder1_txtCity;

if(obj.value!="1")
{
ddlCity.style.display="none";
ddlState.style.display="none";
txtState.style.display="inline";
txtCity.style.display="inline";

}
else
{


ddlCity.style.display="inline";
ddlState.style.display="inline";
txtState.style.display="none";
txtCity.style.display="none";

}
}


function ResumeDOB(source, args)
{
args.IsValid = true;

ddlYear=document.getElementById("ctl00_ContentPlaceHolder1_ddYear").value
ddlMonth=document.getElementById("ctl00_ContentPlaceHolder1_ddMonth").value
ddlDate=document.getElementById("ctl00_ContentPlaceHolder1_ddDate").value

if(ddlYear=="0" || ddlMonth=="0" || ddlDate=="0")
{

args.IsValid = false;


}
return args.IsValid;

}



function EnableControls(Val)
{
ddlArea=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlArea;
ddlPrice=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlPrice;

if(Val==3 || Val==4 || Val==12 || Val==20 || Val==22)
{
document.getElementById("divbed").style.display="block";
document.getElementById("divFloors").style.display="block";
document.getElementById("divAge").style.display="block";
document.getElementById("divBuilt").style.display="block";

}
else if(Val==1 || Val==2 || Val==5 || Val==6 || Val==14 || Val==15 || Val==19 || Val==21)
{
document.getElementById("divbed").style.display="none";
document.getElementById("divFloors").style.display="none";
document.getElementById("divAge").style.display="none";
document.getElementById("divBuilt").style.display="none";
}
else
{

document.getElementById("divbed").style.display="none";
document.getElementById("divFloors").style.display="block";
document.getElementById("divAge").style.display="block";

document.getElementById("divBuilt").style.display="block";

}


if(Val==4)
{
if(document.getElementById("divUArea")!=null)
{
document.getElementById("divUArea").style.display="block";
document.getElementById("divbed").style.display="none";
}
}
else
{
if(document.getElementById("divUArea")!=null)
document.getElementById("divUArea").style.display="none";

}
if(document.getElementById("ChangeArea")!=null)
{
if(Val==4)
{
document.getElementById("ChangeArea").innerHTML="Flat Area";
}
else if(Val==6 || Val==15 || Val==19|| Val==20)
{
document.getElementById("ChangeArea").innerHTML="Land Area";
}
else if(Val==8 || Val==9 || Val==10 || Val==11 || Val==16)
{
document.getElementById("ChangeArea").innerHTML="Empty Space Available";

}
else
{
document.getElementById("ChangeArea").innerHTML="Site Area";
}
}


if(Val==15 || Val==16 || Val==17 || Val==18 || Val==19 || Val==20 )
{
    if(ddlArea.length==4)
    {
      var elOptNew = document.createElement('option');
        elOptNew.text = "Acres";
        elOptNew.value = 2;

    ddlArea.add(elOptNew,2); 

    }
    if(ddlPrice.length==3)
    {
      var elOptNew = document.createElement('option');
        elOptNew.text = "Per Acre";
        elOptNew.value = 2;

    ddlPrice.add(elOptNew,2); 

    }

}
else
{
if(ddlArea.length==5)
ddlArea.remove(2);
if(ddlPrice!=null)
if(ddlPrice.length==4)
ddlPrice.remove(2);

}

}


function EnLocationText(Val)
{
txtLocation=document.aspnetForm.ctl00_ContentPlaceHolder1_txtLocation;

if(Val=="119" || Val=="1216")
{
txtLocation.style.display="inline";

}
else
{
txtLocation.style.display="none";


}
}

function CheckMake(source, args)
{
args.IsValid = true;
ddmake=document.getElementById("ctl00_ContentPlaceHolder1_ddmake").value

if(ddmake=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}





function CheckYearSelect(source, args)
{
args.IsValid = true;
ddyear=document.getElementById("ctl00_ContentPlaceHolder1_ddyear").value

if(ddyear=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}


function rdbtnddlSP(source, args)
{
args.IsValid = true;
rdbtnSSP_0=document.aspnetForm.ctl00_ContentPlaceHolder1_rdbtnSSP_0;
ddlSSP=document.getElementById("ctl00_ContentPlaceHolder1_ddlSSP").value;

if((rdbtnSSP_0.checked) && (ddlSSP=="0"))
{
args.IsValid = false;

}
return args.IsValid;

}




function CheckYearRangeSelect(source, args)
{
args.IsValid = true;
ddyrange=document.getElementById("ctl00_ContentPlaceHolder1_ddyrange").value
ddyear = document.getElementById("ctl00_ContentPlaceHolder1_ddyear").value

if((ddyrange=="Select") || (ddyrange<=ddyear))
{
args.IsValid = false;

}
return args.IsValid;

}


function CheckPriceSelect(source, args)
{
args.IsValid = true;
ddprice=document.getElementById("ctl00_ContentPlaceHolder1_ddprice").value

if(ddprice=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}

function CheckPriceRangeSelect(source, args)
{
args.IsValid = true;
ddrange=document.getElementById("ctl00_ContentPlaceHolder1_ddrange").value
ddprice = document.getElementById("ctl00_ContentPlaceHolder1_ddprice").value

if((ddrange=="Select") || (ddrange<=ddprice))
{
args.IsValid = false;

}
return args.IsValid;

}


function CheckMileageSelect(source, args)
{
args.IsValid = true;
ddmil=document.getElementById("ctl00_ContentPlaceHolder1_ddmil").value

if(ddmil=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}



function CheckMileageRangeSelect(source, args)
{
args.IsValid = true;
ddmrange=document.getElementById("ctl00_ContentPlaceHolder1_ddmrange").value
ddmil = document.getElementById("ctl00_ContentPlaceHolder1_ddmil").value

if((ddmrange=="Select") || (ddmrange <= ddmil))
{
args.IsValid = false;

}
return args.IsValid;

}

function CheckColorSelect(source, args)
{
args.IsValid = true;
ddcolor=document.getElementById("ctl00_ContentPlaceHolder1_ddcolor").value

if(ddcolor=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}



function CheckOwnerSelect(source, args)
{
args.IsValid = true;
ddowners=document.getElementById("ctl00_ContentPlaceHolder1_ddowners").value

if(ddowners=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}

function CheckFuelSelect(source, args)
{
args.IsValid = true;
ddfuel=document.getElementById("ctl00_ContentPlaceHolder1_ddfuel").value

if(ddfuel=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}



function CheckDateSelect(source, args)
{
args.IsValid = true;
dpDate=document.getElementById("ctl00_ContentPlaceHolder1_dpDate").value

if(dpDate=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}


function CheckContact(source, args)
{
args.IsValid = true;
txtLandline=document.getElementById("ctl00_ContentPlaceHolder1_txtLandline").value
txtMobile=document.getElementById("ctl00_ContentPlaceHolder1_txtMobile").value
txtOffice=document.getElementById("ctl00_ContentPlaceHolder1_txtOffice").value



if((txtLandline==null) && (txtMobile==null) && (txtOffice==null))
{
args.IsValid = false;
alert(args.IsValid);
}
return args.IsValid;
alert(args.IsValid);
}


function CheckMonthSelect(source, args)
{
args.IsValid = true;
dpMonth=document.getElementById("ctl00_ContentPlaceHolder1_dpMonth").value

if(dpMonth=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}


function CheckLocalitySelect(source, args)
{
args.IsValid = true;
ddlLocality=document.getElementById("ctl00_ContentPlaceHolder1_ddlLocality").value

if(ddlLocality=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}



function isDimension(Val)
{
TextD1=document.aspnetForm.ctl00_ContentPlaceHolder1_TextD1;
TextD2=document.aspnetForm.ctl00_ContentPlaceHolder1_TextD2;
txtArea=document.aspnetForm.ctl00_ContentPlaceHolder1_txtArea;

if(Val==3 || Val==4)
{
TextD1.style.display="inline";
TextD2.style.display="inline";
txtArea.style.display="none";
document.getElementById("x").style.display="inline";
}
else
{
TextD1.style.display="none";
TextD2.style.display="none";
txtArea.style.display="inline";
document.getElementById("x").style.display="none";

}


}

function isDimensionSearch(Val)
{
TextD1=document.aspnetForm.ctl00_ContentPlaceHolder1_TextD1;
TextD2=document.aspnetForm.ctl00_ContentPlaceHolder1_TextD2;
txtAreaMin=document.aspnetForm.ctl00_ContentPlaceHolder1_txtAreaMin;
txtAreaMax=document.aspnetForm.ctl00_ContentPlaceHolder1_txtAreaMax;

if(Val==3 || Val==4)
{
TextD1.style.display="inline";
TextD2.style.display="inline";
txtAreaMin.style.display="none";
txtAreaMax.style.display="none";
document.getElementById("To").style.display="none";

document.getElementById("x").style.display="inline";
}
else
{
TextD1.style.display="none";
TextD2.style.display="none";
txtAreaMin.style.display="inline";
txtAreaMax.style.display="inline";
document.getElementById("To").style.display="inline";
document.getElementById("x").style.display="none";

}


}

function Display()
{
rdnType_0=document.aspnetForm.ctl00_ContentPlaceHolder1_rdnType_0;
ddlPtype=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlPtype;
if(rdnType_0.checked)
{
document.getElementById("div2").style.display="none";
document.getElementById("div1").style.display="block";
if(ddlPtype.length==3)
    {
      var elOptNew = document.createElement('option');
        elOptNew.text = "Commercial";
        elOptNew.value = 7;

    ddlPtype.add(elOptNew,4); 

    }
}
else
{

document.getElementById("div1").style.display="none";
document.getElementById("div2").style.display="block";
if(ddlPtype.length==4)
    {
     
    ddlPtype.remove(3); 

    }
}
}



function DisFloors()
    {

  
   var val=parseInt(document.getElementById("ctl00_ContentPlaceHolder1_ddlFloor").value)
    
    for(i=1;i<=5;i++)
   {
   
   document.getElementById("spn" + i).style.display="none";  
   
   
   
   }
   for(i=1;i<=5;i++)
   {
   if(i<=val)
   {
   document.getElementById("spn" + i).style.display="inline";  
   
   }
   
   }
      
   }
function CheckTitle(source, args)
{
 args.IsValid = true;
 txtTitle = document.getElementById("ct100_ContentPlaceHolder1_txtTitle").value
 if(txtTitle=="")
 {
 args.IsValid = false;
 }
 return args.IsValid;
}
 
function CheckDescription(source, args)
{
 args.IsValid = true;
 txtDesc = document.getElementById("ct100_ContentPlaceHolder1_txtDesc").value
 if(txtDesc=="")
 {
 args.IsValid = false;
 }
 return args.IsValid;
} 

function CheckPhoto(source, agrs)
{
args.IsValid = true;
fuImage = document.getElementById("ct100_ContentPlaceHolder1_fuImage").value

if(fuImage=="")
{
args.IsValid = false;
}
return args.IsValid;
}
   
function CheckPType(source, args)
{
args.IsValid = true;
ddlPtype=document.getElementById("ctl00_ContentPlaceHolder1_ddlPtype").value

if(ddlPtype=="0")
{
args.IsValid = false;

}
return args.IsValid;

}
function CheckCity(source, args)
{
args.IsValid = true;
ddlPtype=document.getElementById("ctl00_ContentPlaceHolder1_ddlCity").value
ddlCityText=document.getElementById("ctl00_ContentPlaceHolder1_txtCity").value
if(ddlPtype=="3")
{

 if(ddlCityText=="")
args.IsValid = false;

}
return args.IsValid;

}
function CheckCitySearch(source, args)
{
args.IsValid = true;
ddlPtype=document.getElementById("ctl00_ContentPlaceHolder1_ddlCity").value
if(ddlPtype=="Select")
{

 
args.IsValid = false;

}
return args.IsValid;

}
function CheckLayout(source, args)
{
args.IsValid = true;
ddlPtype=document.getElementById("ctl00_ContentPlaceHolder1_ddlCity").value
ddlLocation=document.getElementById("ctl00_ContentPlaceHolder1_ddlLocation").value
txtLocation=document.getElementById("ctl00_ContentPlaceHolder1_txtLocation").value
if(ddlPtype=="2")
{
 
}
else
{

if(ddlLocation=="0")
args.IsValid = false;

if(ddlLocation=="119" || ddlLocation=="1216")
{
if(txtLocation=="")
args.IsValid = false;

}

}

return args.IsValid;

}



function CheckLayoutSearch(source, args)
{
args.IsValid = true;
ddlLocation=document.getElementById("ctl00_ContentPlaceHolder1_ddlLocation").value

if(ddlLocation=="Select")
args.IsValid = false;


return args.IsValid;

}

function CheckRadiobtn(source,args)
{

args.IsValid=true;

rbBHK1=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_0");
rbBHK2=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_1");
rbBHK3=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_2");
rbBHK4=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_3");


if((rbBHK1.checked==false) && (rbBHK2.checked==false) && (rbBHK3.checked==false) && (rbBHK4.checked==false))
{
args.IsValid=false;
return args.IsValid;
}

}



function CheckSqFt(source,args)
{

args.IsValid=true;

rbBHK1=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_0");
rbBHK2=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_1");
rbBHK3=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_2");
rbBHK4=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_3");

sqft1=document.getElementById("ctl00_ContentPlaceHolder1_txtSqFt1");
sqft2=document.getElementById("ctl00_ContentPlaceHolder1_txtSqFt2");
sqft3=document.getElementById("ctl00_ContentPlaceHolder1_txtSqFt3");
sqft4=document.getElementById("ctl00_ContentPlaceHolder1_txtSqFt4");
if((rbBHK1.checked==true) && (sqft1.value==""))
{
args.IsValid=false;
return args.IsValid;

}
if((rbBHK2.checked==true) && (sqft2.value==""))
{
args.IsValid=false;
return args.IsValid;

}
if((rbBHK3.checked==true) && (sqft3.value==""))
{
args.IsValid=false;
return args.IsValid;

}
if((rbBHK4.checked==true) && (sqft4.value==""))
{
args.IsValid=false;
return args.IsValid;

}

return args.IsValid;

}



function CheckReqPrice(source,args)
{

args.IsValid=true;

rbBHK1=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_0");
rbBHK2=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_1");
rbBHK3=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_2");
rbBHK4=document.getElementById("ctl00_ContentPlaceHolder1_cblBedrooms_3");

pr1=document.getElementById("ctl00_ContentPlaceHolder1_txtPrice1");
pr2=document.getElementById("ctl00_ContentPlaceHolder1_txtPrice2");
pr3=document.getElementById("ctl00_ContentPlaceHolder1_txtPrice3");
pr4=document.getElementById("ctl00_ContentPlaceHolder1_txtPrice4");

if((rbBHK1.checked==true) && (pr1.value==""))
{

args.IsValid=false;
return args.IsValid;
}
if((rbBHK2.checked==true) && (pr2.value==""))
{

args.IsValid=false;
return args.IsValid;
}
if((rbBHK3.checked==true) && (pr3.value==""))
{

args.IsValid=false;
return args.IsValid;
}
if((rbBHK4.checked==true) && (pr4.value==""))
{

args.IsValid=false;
return args.IsValid;
}

return args.IsValid;

}


function CheckFloors(source, args)
{
args.IsValid = true;
ddlFloors=document.getElementById("ctl00_ContentPlaceHolder1_ddlFloors").value

if(ddlFloors=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}


function CheckLocation(source, args)
{
args.IsValid = true;
ddlLocation=document.getElementById("ctl00_ContentPlaceHolder1_ddlLocation").value

if(ddlLocation=="Select")
{
args.IsValid = false;

}
return args.IsValid;

}



function CheckPrice(source, args)
{
args.IsValid = true;

ddlPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlPrice").value
ddlCAmount=document.getElementById("ctl00_ContentPlaceHolder1_ddlCAmount").value
ddlLAmount=document.getElementById("ctl00_ContentPlaceHolder1_ddlLAmount").value
ddlTAmount=document.getElementById("ctl00_ContentPlaceHolder1_ddlTAmount").value
ddlHAmount=document.getElementById("ctl00_ContentPlaceHolder1_ddlHAmount").value

if((ddlPrice!="0") && (ddlCAmount=="0" && ddlLAmount=="0" && ddlTAmount=="0" && ddlHAmount=="0"))
{
args.IsValid = false;
return args.IsValid;
}
if((ddlPrice=="0") && (ddlCAmount!="0" || ddlLAmount!="0" || ddlTAmount!="0" || ddlHAmount!="0"))
{
args.IsValid = false;
return args.IsValid;
}
return args.IsValid;

}
function CheckSiteArea(source, args)
{
args.IsValid = true;

ddlPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlArea").value
ddlCAmount=document.getElementById("ctl00_ContentPlaceHolder1_txtArea").value
ddlLAmount=document.getElementById("ctl00_ContentPlaceHolder1_TextD1").value
ddlTAmount=document.getElementById("ctl00_ContentPlaceHolder1_TextD2").value
if((ddlPrice=="0") || (ddlCAmount=="" && ddlLAmount=="" && ddlTAmount==""))
{
args.IsValid = false;
return args.IsValid;
}

if((ddlPrice=="1" || ddlPrice=="2") && (ddlCAmount==""))
{
args.IsValid = false;
return args.IsValid;
}
if((ddlPrice=="3" || ddlPrice=="4") && (ddlLAmount=="" || ddlTAmount==""))
{
args.IsValid = false;
return args.IsValid;
}

return args.IsValid;

}

function CheckSiteAreaSearch(source, args)
{
args.IsValid = true;

ddlArea=document.getElementById("ctl00_ContentPlaceHolder1_ddlArea").value
txtMinArea=document.getElementById("ctl00_ContentPlaceHolder1_txtAreaMin").value
txtMaxArea=document.getElementById("ctl00_ContentPlaceHolder1_txtAreaMax").value
TextD1=document.getElementById("ctl00_ContentPlaceHolder1_TextD1").value
TextD2=document.getElementById("ctl00_ContentPlaceHolder1_TextD2").value
if(ddlArea=="0")
{
    if(txtMinArea!="" || txtMaxArea!="" || TextD1!="" || TextD2!="")
    {
    args.IsValid=false;
    }
}
else if(ddlArea=="3")
{
if(TextD1=="" || TextD2=="")
    {
    args.IsValid=false;
    }
}
else
{
if(txtMinArea=="" || txtMaxArea=="")
    {
    args.IsValid=false;
    }

}


return args.IsValid;

}
function ValidBudget(source, args)
{
args.IsValid = true;

ddlMinPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlMinPrice").value
ddlMinPriceUnit=document.getElementById("ctl00_ContentPlaceHolder1_ddlMinPriceUnit").value
ddlMaxPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlMaxPrice").value
ddlMaxPriceUnit=document.getElementById("ctl00_ContentPlaceHolder1_ddlMaxPriceUnit").value
valP=parseInt(ddlMinPrice)*parseInt(ddlMinPriceUnit)
val=parseInt(ddlMaxPrice)*parseInt(ddlMaxPriceUnit)
if(valP>val)
{


args.IsValid = false;
}

return args.IsValid;

}

function CheckBuiltAreaSearch(source, args)
{
args.IsValid = true;

ddlArea=document.getElementById("ctl00_ContentPlaceHolder1_ddlBArea").value
txtMinArea=document.getElementById("ctl00_ContentPlaceHolder1_txtBAreaMin").value
txtMaxArea=document.getElementById("ctl00_ContentPlaceHolder1_txtBAreaMax").value
if((parseInt(ddlArea)!=0) && (txtMinArea=="" || txtMaxArea==""))
{


args.IsValid = false;
}

if(parseInt(ddlArea)==0 && (txtMinArea!="" || txtMaxArea!=""))
{

args.IsValid = false;
}


return args.IsValid;

}

function CheckBudget(source, args)
{
args.IsValid = true;

ddlMinPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlMinPrice").value
ddlMinPriceUnit=document.getElementById("ctl00_ContentPlaceHolder1_ddlMinPriceUnit").value
ddlMaxPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlMaxPrice").value
ddlMaxPriceUnit=document.getElementById("ctl00_ContentPlaceHolder1_ddlMaxPriceUnit").value
if(!((parseInt(ddlMinPriceUnit)==0) && (parseInt(ddlMinPrice)==0) &&(parseInt(ddlMaxPrice)==0) && (parseInt(ddlMaxPriceUnit)==0) ))
{
if((parseInt(ddlMinPriceUnit)==0) || (parseInt(ddlMinPrice)==0) ||(parseInt(ddlMaxPrice)==0) || (parseInt(ddlMaxPriceUnit)==0) )
{


args.IsValid = false;
}
}





return args.IsValid;

}

function CheckBuiltArea(source, args)
{
args.IsValid = true;

ddlPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlBArea").value
ddlCAmount=document.getElementById("ctl00_ContentPlaceHolder1_txtBArea").value

if((ddlPrice!="0") && (ddlCAmount==""))
{
args.IsValid = false;
return args.IsValid;
}
if((ddlPrice=="0") && (ddlCAmount!=""))
{
args.IsValid = false;
return args.IsValid;
}

return args.IsValid;

}
function ChangeArea()
{
ddlPrice=document.getElementById("ctl00_ContentPlaceHolder1_ddlPrice").value
ddlArea=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlArea;

if(ddlPrice=="1")
{
ddlArea.selectedIndex=1;
}
else if(ddlPrice=="2")
{
ddlArea.selectedIndex=2;
}
else
{
ddlArea.selectedIndex=0;
}
}





function EnableControlsSearch(Val)
{
ddlArea=document.aspnetForm.ctl00_ContentPlaceHolder1_ddlArea;

if(Val==3 || Val==4 || Val==12 || Val==20 || Val==22)
{
document.getElementById("divbed").style.display="block";

document.getElementById("divAge").style.display="block";


}
else if(Val==1 || Val==2 || Val==5 || Val==6 || Val==14 || Val==15 || Val==19 || Val==21)
{
document.getElementById("divbed").style.display="none";

document.getElementById("divAge").style.display="none";

}
else
{

document.getElementById("divbed").style.display="none";

document.getElementById("divAge").style.display="block";



}


if(Val==4)
{
if(document.getElementById("divUArea")!=null)
{
document.getElementById("divUArea").style.display="block";
document.getElementById("divbed").style.display="none";
}
}
else
{
if(document.getElementById("divUArea")!=null)
document.getElementById("divUArea").style.display="none";

}
if(document.getElementById("ChangeArea")!=null)
{
if(Val==4)
{
document.getElementById("ChangeArea").innerHTML="Flat Area";
}
else if(Val==6 || Val==15 || Val==19|| Val==20)
{
document.getElementById("ChangeArea").innerHTML="Land Area";
}
else if(Val==8 || Val==9 || Val==10 || Val==11 || Val==16)
{
document.getElementById("ChangeArea").innerHTML="Empty Space Available";

}
else
{
document.getElementById("ChangeArea").innerHTML="Site Area";
}
}


if(Val==15 || Val==16 || Val==17 || Val==18 || Val==19 || Val==20 )
{
    if(ddlArea.length==3)
    {
      var elOptNew = document.createElement('option');
        elOptNew.text = "Acres";
        elOptNew.value = 2;

    ddlArea.add(elOptNew,2); 

    }
   

}
else
{
if(ddlArea.length==4)
ddlArea.remove(2);


}

}


/*
realEstate Ends
*/


/*cars/Bikes*/

function check_DealerInterface(val)
{

val=val.substring(val.lastIndexOf('_btn')-2,val.lastIndexOf('_btn'))
var txtEmail, txtPhone;
txtEmail=document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_txtEmail");
txtPhone=document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_txtMob");
if(!Req_mand(txtEmail,"Email"))
{

return false;
}
if(!Req_mand(txtPhone,"Mobile Number"))
{

return false;
}
if(document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_chkOptions_0").checked || document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_chkOptions_1").checked || document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_chkOptions_2").checked || document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_chkOptions_3").checked || document.getElementById("ctl00_ContentPlaceHolder1_grdNewCars_ctl"+val+"_chkOptions_4").checked)
{


}
else
{
alert("Please Select Any one Options")
return false;
}
return true;
}
