﻿// JScript File
var prefix='ctl00_ContentPlaceHolder1_';
function changeTextRegister()
{
   
    var userType = document.getElementById(prefix+'rblRole_3');
    var spnText = document.getElementById(prefix+'spnText');
    
    if(userType.checked)
    {
        spnText.innerHTML  = 'Email my requirements to Landlord,Broker and Managment Companies in my area';
    }
    else
    {
        spnText.innerHTML  = 'Email my listings to Tenants in my area';
    }
        
}
function clearContents()
{
    document.getElementById(prefix+'txtYourName').innerText="";
    document.getElementById(prefix+'txtEmail').innerText="";
    document.getElementById(prefix+'txtSubject').innerText="";
    document.getElementById(prefix+'txtComments').innerText="";
    document.getElementById(prefix+'rblUserType').selectedindex=-1;
}
function trVisible()
{
    var objTrVirtualTour = document.getElementById(prefix+'trVirtualTour');
    objTrVirtualTour.display = "block";
}

function clearText()
{
    if(document.getElementById("Login1_txtLoginName").value=="Email")
    {
        document.getElementById("Login1_txtLoginName").value="";
    }
        
}
function ShowPassword()
{
    var objPass = document.getElementById("Login1_txtPass");
    var objPassword = document.getElementById("Login1_txtPassword");
    objPassword.style.display = "inline";
    objPass.style.display = "none";
    objPassword.style.display = "inline";
    objPassword.focus();
}
function ShowPropertyType()
{
    var objCheck = document.getElementById(prefix+'cbxMultiUsage');
    var objPropertyType1 = document.getElementById(prefix+'tdProperty1');
    var objPropertyType2 = document.getElementById(prefix+'tdProperty2');
    var objSize = document.getElementById('tdSize');
    var objSize2 = document.getElementById('tdSize2');
    var objLeasingInfo = document.getElementById('tdLeasingInfo');
    var objLeasingInfo2 = document.getElementById('tdLeasingInfo2');
        if(objCheck.checked)
        {
            objPropertyType1.style.display = "";
            objPropertyType2.style.display = "";
            objSize.style.display = "";
            objSize2.style.display = "";
            objLeasingInfo.style.display = "";
            objLeasingInfo2.style.display = "";
        }
        else
            {
                objPropertyType1.style.display = "none";
                objPropertyType2.style.display = "none";
                objSize.style.display = "none";
                objSize2.style.display = "none";
                objLeasingInfo.style.display = "none";
                objLeasingInfo2.style.display = "none";
            }
}
function ShowLogoDialog()
{
    
    var objCheck = document.getElementById(prefix+'cbxUploadLogo');
    var objLogo = document.getElementById(prefix+'fuLogo');
        
        if(objCheck.checked)
        {
            objLogo.style.display = "";
        }
        else
        {
            objLogo.style.display = "none";
        }
}
function GetValidationGroup()
{
    alert(RegExp13.errormessage);
    var objCheck = document.getElementById(prefix+'cbxMultiUsage');
    
    var txtMin_Lease_Price1 = document.getElementById(prefix+'txtMin_Lease_Price1');
    
    var ddlProperty_Type1 = document.getElementById(prefix+'ddlProperty_Type1').selectedIndex;
    var ddlProperty_Type2 = document.getElementById(prefix+'ddlProperty_Type2').selectedIndex;
    
    var rblPrice = document.getElementById(prefix+'rblPrice_0');
    var rblPrice2 = document.getElementById(prefix+'rblPrice2_0');
    var rblPrice3 = document.getElementById(prefix+'rblPrice3_0');
    
    var RegExp13 = document.getElementById(prefix+'RegularExpressionValidator13');
    var RegExp2 = document.getElementById(prefix+'RegularExpressionValidator2');
    var RegExp3 = document.getElementById(prefix+'RegularExpressionValidator3');
    var RegExp4 = document.getElementById(prefix+'RegularExpressionValidator4');
    var RegExp5 = document.getElementById(prefix+'RegularExpressionValidator5');
    var RegExp6 = document.getElementById(prefix+'RegularExpressionValidator6');
    
    var cmpValidator3 = document.getElementById(prefix+'CompareValidator3');
    var cmpValidator7 = document.getElementById(prefix+'CompareValidator7');
    var cmpValidator8 = document.getElementById(prefix+'CompareValidator8');
    var cmpValidator5 = document.getElementById(prefix+'CompareValidator5');
    
    var ReqFld4 = document.getElementById(prefix+'RequiredFieldValidator4');
    var ReqFld5 = document.getElementById(prefix+'RequiredFieldValidator5');
    var ReqFld7 = document.getElementById(prefix+'RequiredFieldValidator7');
    var ReqFld15 = document.getElementById(prefix+'RequiredFieldValidator15');
    var ReqFld13 = document.getElementById(prefix+'RequiredFieldValidator13');
    var ReqFld14 = document.getElementById(prefix+'RequiredFieldValidator14');
    var ReqFld17 = document.getElementById(prefix+'RequiredFieldValidator17');
    var ReqFld18 = document.getElementById(prefix+'RequiredFieldValidator18');
    
    if (rblPrice.checked)
        {
            
            RegExp13.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
            RegExp13.validationExpression.errorMessage = "Mininum Lease Price must be between 0-100 (only digits)";
            RegExp2.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
            RegExp2.errorMessage = "Maximum Lease Price must be between 0-100 (only digits)";
        }
    else
        {
            RegExp13.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
            RegExp2.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
            RegExp13.errorMessage = "Mininum Lease Price must be between 0-1200 (only digits)";
            RegExp2.errorMessage = "Maximum Lease Price must be between 0-1200 (only digits)";
        }
    if (objCheck.checked == false && ddlProperty_Type1 == 0)
        {
            ReqFld4.validationGroup = "asd";
            ReqFld5.validationGroup = "asd";
            ReqFld7.validationGroup = "asd";
            ReqFld15.validationGroup = "asd";
            
            RegExp3.validationGroup = "asd";
            RegExp4.validationGroup = "asd";
            
            cmpValidator3.validationGroup = "asd";
            cmpValidator7.validationGroup = "asd";
            
        }
    else if (objCheck.checked == false && ddlProperty_Type1 > 0)
        {
            ReqFld4.validationGroup = "ASD";
            ReqFld4.validationGroup = "ASD";
            ReqFld7.validationGroup = "ASD";
            ReqFld15.validationGroup = "ASD";
            
            cmpValidator3.validationGroup = "asd";
            cmpValidator7.validationGroup = "asd";
        }
      else
        {
            ReqFld4.validationGroup = "err";
            ReqFld5.validationGroup = "err";
            ReqFld7.validationGroup = "err";
            ReqFld15.validationGroup = "err";
            
            cmpValidator3.validationGroup = "err";
            cmpValidator7.validationGroup = "err";
            
            
            if (rblPrice2.checked)
            {
                //RegExp3.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
                
                RegExp31 = new RegExp("^[0-9]{1}$|^[0-9]{2}$|^100$");
                if(txtMin_Lease_Price1.value.search(RegExp31) == -1)
                {
                    RegExp3.errormessage  = "Mininum Lease Price must be between 0-100 (usage 2)";
                    alert(RegExp31);
                }
                
                
                //RegExp3.errorMessage = "Mininum Lease Price must be between 0-100 (usage 2)";
                RegExp4.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
                RegExp4.errorMessage = "Maximum Lease Price must be between 0-100 (usage 2)";

            }
            else
            {
                RegExp3.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
                RegExp4.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
                RegExp3.errorMessage = "Mininum Lease Price must be between $0-1200 (usage 2)";
                RegExp4.errorMessage = "Maximum Lease Price must be between 0-1200 (usage 2)";
            }
        }
        if (objCheck.checked == false && ddlProperty_Type2 == 0)
        {
            ReqFld13.validationGroup = "asd";
            ReqFld14.validationGroup = "asd";
            ReqFld17.validationGroup = "asd";
            ReqFld18.validationGroup = "asd";
            
            RegExp5.validationGroup = "asd";
            RegExp6.validationGroup = "asd";

            cmpValidator8.validationGroup = "asd";
            cmpValidator5.validationGroup = "asd";
        }
        else if (objCheck.checked == false && ddlProperty_Type2 > 0)
        {
            ReqFld13.validationGroup = "ASD";
            ReqFld14.validationGroup = "ASD";
            ReqFld17.validationGroup = "ASD";
            ReqFld18.validationGroup = "ASD";
            
            cmpValidator8.ValidationGroup = "asd";
            cmpValidator5.ValidationGroup = "asd";
        }
         else
        {
            ReqFld13.validationGroup = "err";
            ReqFld14.validationGroup = "err";
            ReqFld17.validationGroup = "err";
            ReqFld18.validationGroup = "err";

            cmpValidator8.validationGroup = "err";
            cmpValidator5.validationGroup = "err";
            
            if (rblPrice3.checked)
            {
                RegExp5.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
                RegExp5.errorMessage = "Mininum Lease Price must be between 0-100 (usage 3)";
                RegExp6.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^100$";
                RegExp6.errorMessage = "Maximum Lease Price must be between 0-100 (usage 3)";
            }
            else
            {
                RegExp5.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
                RegExp6.validationExpression = "^[0-9]{1}$|^[0-9]{2}$|^[0-9]{3}$|^[0-1]{2}[0-9]{2}$|^1200$";
                RegExp5.errorMessage = "Mininum Lease Price must be between $0-1200 (usage 3)";
                RegExp6.errorMessage = "Maximum Lease Price must be between 0-1200 (usage 3)";
            }
        }
}
function ShowState()
{
    var dropdownIndex = document.getElementById(prefix+'ddlCountry').selectedIndex;
    var dropdownValue = document.getElementById(prefix+'ddlCountry')[dropdownIndex].value;
    var lblText = document.getElementById(prefix+'lblStateProvince');
    
    if(dropdownValue == "US")
    {
        
        
        lblText.innerText = "State:";
        document.getElementById(prefix+'RequiredFieldValidator7').validationGroup = "ASD";
        document.getElementById(prefix+'CompareValidator3').validationGroup = "ASD";
        document.getElementById(prefix+'CompareValidator1').validationGroup = "err";
        document.getElementById(prefix+'ddlStateUs').style.display = "inline";
        document.getElementById(prefix+'ddlStateCan').style.display = "none";
        document.getElementById(prefix+'txtProvinceState').style.display = "none";
    }
    else if(dropdownValue == "CA")
    {
        lblText.innerText = "State:";
        document.getElementById(prefix+'ddlStateCan').style.display = "inline";
        document.getElementById(prefix+'ddlStateUs').style.display = "none";
        document.getElementById(prefix+'txtProvinceState').style.display = "none";
        document.getElementById(prefix+'RequiredFieldValidator7').validationGroup = "ASD";
        document.getElementById(prefix+'CompareValidator1').validationGroup = "ASD";
        document.getElementById(prefix+'CompareValidator3').validationGroup = "err";
    }
    else
    {
        lblText.innerText = "Province/State:";
        document.getElementById(prefix+'txtProvinceState').style.display = "inline";
        document.getElementById(prefix+'ddlStateCan').style.display = "none";
        document.getElementById(prefix+'ddlStateUs').style.display = "none";
        
        document.getElementById(prefix+'RequiredFieldValidator7').validationGroup = "err";
        
        document.getElementById(prefix+'CompareValidator1').validationGroup = "ASD";
        document.getElementById(prefix+'CompareValidator3').validationGroup = "ASD";
    }
}

function validateChkList()
{    
    var check=document.getElementById(prefix+"cbxAgree");
    if(check.checked)
    {
        document.getElementById(prefix+"lblAlert").innerHTML = ""; 
    }
    else
    {
        document.getElementById(prefix+"lblAlert").innerHTML = "Please Agree the Terms and Conditons.";
        return false;
    }
}
function openWindow(url, title)
{
    var x;
    nsw = (screen.width)/2+200; 
    nsh = (screen.height)/2+150; 
    myLeft = (screen.width-nsw)/2; 
    myTop = (screen.height-nsh)/2; 
    window.open(url,title,'width='+nsw+',height='+nsh+',left='+myLeft+',top='+myTop+',resizable=0,scrollbars=1,toolbar=0,location=0,directories=0,status=1,menubar=0,copyhistory=0');
    return false;
}
function PrintResults(textid)
{
var sOption="toolbar=yes,location=no,directories=yes,m enubar=yes,";
sOption+="scrollbars=yes,width=750,height=600,left =100,top=25";

var sWinHTML = document.getElementById(textid).innerHTML;

var winprint=window.open("","",sOption);
winprint.document.open();
winprint.document.write("<HTML><Head><link href='../css/StyleSheet.css' type='text/css' rel ='stylesheet' /></Head><Body onload=window.print()>")
//winprint.document.write("<a href='javascript:;'onClick='window.print();return false'>Print This Page.</a><br>");
winprint.document.write(sWinHTML);
winprint.document.write("</Body></HTML>")
winprint.document.close();
return false;
//winprint.focus();
//winprint.close();
}
function PrintResultsWithLogo(textid)
{
var sOption="toolbar=yes,location=no,directories=yes,m enubar=yes,";
sOption+="scrollbars=yes,width=750,height=600,left =100,top=25";

var sWinHTML = document.getElementById(textid).innerHTML;

//FOR IE
sWinHTML = sWinHTML.replace(/<TR class=Pager align=middle>/g,'<TR style="display:none;" align="center">');//Removes Paging from header
sWinHTML = sWinHTML.replace(/<TR class=Pager align=middle>/g,'<TR style="display:none;" align="center">');//Removes Paging from footer

//FOR FIREFOX
sWinHTML = sWinHTML.replace(/<tr class="Pager" align="center">/g,'<tr style="display:none;" align="center">');//Removes Paging from header
sWinHTML = sWinHTML.replace(/<tr class="Pager" align="center">/g,'<tr style="display:none;" align="center">');//Removes Paging from footer
var winprint=window.open("","",sOption);
winprint.document.open();
winprint.document.write("<HTML><Head><link href='css/StyleSheet.css' type='text/css' rel ='stylesheet' /></Head><Body onload=window.print()>")
//winprint.document.write("<a href='javascript:;'onClick='window.print();return false'>Print This Page.</a><br>");
winprint.document.write("<div style='text-align:left;'><img src='images/logo_new.png' alt='SpaceForLease' ></div>");
winprint.document.write(sWinHTML);
winprint.document.write("</Body></HTML>")
winprint.document.close();
return false;
//winprint.focus();
//winprint.close();
}
function GetTableInnerHTML()
{
    
    //alert(window.location.protocol + "//" + window.location.host + window.location.pathname);
//    var str=window.location.href;
//    var name=str.match(/\w+\.htm|html|aspx/);
//    alert(name);
//    var arr = windowm.location.href;
//    var arr2 =arr[0].split('/');
//    alert(arr2[arr2.length-1]);
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/'));
    //alert(sPage);
    var basePath = window.location.protocol + "//" + window.location.host + window.location.pathname.replace(sPage,'');
    //alert(basePath);
    var tdBody = document.getElementById(prefix+'tdBody');
    
    while(tdBody.innerHTML.indexOf('class=bodyTextBold') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=bodyTextBold','style="font-size:12px;font-family:Arial; text-align:justify; font-weight:bold; color:#333333;"');
    while(tdBody.innerHTML.indexOf('class=Line') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=Line','style="width:100%;background-color:Gray; height:1px; background-repeat:repeat-x;vertical-align:top;"');
    while(tdBody.innerHTML.indexOf('class=bodyText') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=bodyText','style="font-family:Arial; font-size:12px;color:#333333;text-decoration:none;text-align:left;"');
    while(tdBody.innerHTML.indexOf('class=tableBorderHome') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=tableBorderHome','style="border-right: #CBCAD0 1px solid; border-top: #CBCAD0 1px solid; border-left: #CBCAD0 1px solid; border-bottom: #CBCAD0 1px solid;	vertical-align:top;"');
    while(tdBody.innerHTML.indexOf('class=userMainHeading') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=userMainHeading','style="font-family:Arial; font-weight:bold; color:#1a51a6; font-size:16px;"');
    while(tdBody.innerHTML.indexOf('class=userSubHeading') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=userSubHeading','style="font-family:Arial; font-weight:bold; color:#1a51a6; font-size:12px;"');
    while(tdBody.innerHTML.indexOf('class=userBodyText') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=userBodyText','style="font-family:Arial; font-size:12px; color:#333333;text-decoration:none;"');
    while(tdBody.innerHTML.indexOf('class=PropertiesGridPrint') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=PropertiesGridPrint','style="font-size:11px; font-family:Tahoma; color:#000000; text-decoration:none;"');
    while(tdBody.innerHTML.indexOf('class=LeftBorder') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=LeftBorder','style="border-left:solid 1px gray; width:1px;"');
    while(tdBody.innerHTML.indexOf('class=EmailTenantLine') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=EmailTenantLine','style="border-left:solid 1px gray; width:1px;font-family:Arial; font-size:12px;color:#333333;text-decoration:none;text-align:left;"');
    while(tdBody.innerHTML.indexOf('class=FirstCapitalHeading') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class=FirstCapitalHeading','style="font-family:Arial;font-weight:bold; color:#1a51a6; font-size:16px; text-transform:capitalize;"');
        
    while(tdBody.innerHTML.indexOf('class="bodyTextBold"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="bodyTextBold"','style="font-size:12px;font-family:Arial; text-align:justify; font-weight:bold; color:#333333;"');
    while(tdBody.innerHTML.indexOf('class="Line"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="Line"','style="width:100%;background-color:Gray; height:1px; background-repeat:repeat-x;vertical-align:top;"');
    while(tdBody.innerHTML.indexOf('class="bodyText"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="bodyText"','style="font-family:Arial; font-size:12px;color:#333333;text-decoration:none;text-align:left;"');
    while(tdBody.innerHTML.indexOf('class="tableBorderHome"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="tableBorderHome"','style="border-right: #CBCAD0 1px solid; border-top: #CBCAD0 1px solid; border-left: #CBCAD0 1px solid; border-bottom: #CBCAD0 1px solid;	vertical-align:top;"');
    while(tdBody.innerHTML.indexOf('class="userMainHeading"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="userMainHeading"','style="font-family:Arial; font-weight:bold; color:#1a51a6; font-size:16px;"');
    while(tdBody.innerHTML.indexOf('class="userSubHeading"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="userSubHeading"','style="font-family:Arial; font-weight:bold; color:#1a51a6; font-size:12px;"');
    while(tdBody.innerHTML.indexOf('class="userBodyText"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="userBodyText"','style="font-family:Arial; font-size:12px; color:#333333;text-decoration:none;"');
    while(tdBody.innerHTML.indexOf('class="PropertiesGridPrint"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="PropertiesGridPrint"','style="font-size:11px; font-family:Tahoma; color:#000000; text-decoration:none;"');
    while(tdBody.innerHTML.indexOf('class="LeftBorder"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="LeftBorder"','style="border-left:solid 1px gray; width:1px;"');
    while(tdBody.innerHTML.indexOf('class="EmailTenantLine"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="EmailTenantLine"','style="border-left:solid 1px gray; width:1px;font-family:Arial; font-size:12px;color:#333333;text-decoration:none;text-align:left;"');
    while(tdBody.innerHTML.indexOf('class="FirstCapitalHeading"') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('class="FirstCapitalHeading"','style="font-family:Arial;font-weight:bold; color:#1a51a6; font-size:16px; text-transform:capitalize;"');
        
    while(tdBody.innerHTML.indexOf('src="Logos') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('src="Logos','src="'+basePath+'/Logos');
    while(tdBody.innerHTML.indexOf('src="Images') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('src="Images','src="'+basePath+'/Images');
    while(tdBody.innerHTML.indexOf('src="images') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('src="images','src="'+basePath+'/Images');
    while(tdBody.innerHTML.indexOf('src="Photos') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('src="Photos','src="'+basePath+'/Photos');
    while(tdBody.innerHTML.indexOf('"PropertyDetail.aspx') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('"PropertyDetail.aspx','"'+basePath+'/PropertyDetail.aspx');
    while(tdBody.innerHTML.indexOf('"Default.aspx') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('"Default.aspx','"'+basePath+'/Default.aspx');
    while(tdBody.innerHTML.indexOf('"ViewAdsDetail.aspx') != -1)
        tdBody.innerHTML = tdBody.innerHTML.replace('"ViewAdsDetail.aspx','"'+basePath+'/ViewAdsDetail.aspx');
    document.getElementById(prefix+'txtBody').value = tdBody.innerHTML;
    //alert(document.getElementById(prefix+'txtBody').value);
    //alert(tdBody.innerHTML);
}
function select_deselectAll (chkVal, idVal) 
{ 
    var frm = document.forms[0];
    // Loop through all elements
    for (i=0; i<frm.length; i++) 
    {
        // Look for our Header Template's Checkbox
        if (idVal.indexOf ('CheckAll') != -1) 
        {
            // Check if main checkbox is checked, then select or deselect datagrid checkboxes 
            if(chkVal == true) 
            {
                frm.elements[i].checked = true;
            } 
            else 
            {
                frm.elements[i].checked = false;
            }
            // Work here with the Item Template's multiple checkboxes
        } 
        else if (idVal.indexOf ('chkContactID') != -1) 
        {
            // Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
            if(frm.elements[i].checked == false) 
            {
                frm.elements[1].checked = false; //Uncheck main select all checkbox
            }
        }
    }

}
function NoDataSelect()
{
    var frm = document.forms[0];
    var idVal="chkContactID";
    var flag =0;
    for (i=0; i<frm.length; i++) 
    {
        if(frm.elements[i].checked == true)
        {
	        return true;
	        flag = 1;
        }
    }
    if (flag == 0)
	{
		alert('None of the record is selected');
		return false;
	}
}
function redirectTo(targetPage, querystring)
{
   var b1 = document.getElementById("b1");
   if (0 < targetPage.length)
   {
      b1.style.cursor="wait";
      location.replace(targetPage + querystring);
   }    
}
function removeComma()
{
    while(document.getElementById(prefix+'txtMin_Lease_Price1').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMin_Lease_Price1').value = document.getElementById(prefix+'txtMin_Lease_Price1').value.replace(',','');
    while(document.getElementById(prefix+'txtMax_Lease_Price1').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMax_Lease_Price1').value = document.getElementById(prefix+'txtMax_Lease_Price1').value.replace(',','');
    while(document.getElementById(prefix+'txtMin_Lease_Price2').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMin_Lease_Price2').value = document.getElementById(prefix+'txtMin_Lease_Price2').value.replace(',','');
    while(document.getElementById(prefix+'txtMax_Lease_Price2').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMax_Lease_Price2').value = document.getElementById(prefix+'txtMax_Lease_Price2').value.replace(',','');
    while(document.getElementById(prefix+'txtMin_Lease_Price3').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMin_Lease_Price3').value = document.getElementById(prefix+'txtMin_Lease_Price3').value.replace(',','');
    while(document.getElementById(prefix+'txtMax_Lease_Price3').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMax_Lease_Price3').value = document.getElementById(prefix+'txtMax_Lease_Price3').value.replace(',','');
        
    while(document.getElementById(prefix+'txtMinimumLeasePrice').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMinimumLeasePrice').value = document.getElementById(prefix+'txtMinimumLeasePrice').value.replace(',','');
    while(document.getElementById(prefix+'txtMaximumLeasePrice').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMaximumLeasePrice').value = document.getElementById(prefix+'txtMaximumLeasePrice').value.replace(',','');
}
function removeCommaTenant()
{
    while(document.getElementById(prefix+'txtMinimumLeasePrice').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMinimumLeasePrice').value = document.getElementById(prefix+'txtMinimumLeasePrice').value.replace(',','');
    while(document.getElementById(prefix+'txtMaximumLeasePrice').value.indexOf(',') != -1)
        document.getElementById(prefix+'txtMaximumLeasePrice').value = document.getElementById(prefix+'txtMaximumLeasePrice').value.replace(',','');
}



