﻿
var now = new Date();
var startTime = new Date().getTime();
var endTime;
var m_IframeDefaultHeight = 520;
var m_strCityDesc;
var winAddPhoto;
var clientReportMail;
var AgencyReportMail;
var PropertyReportMail;
var SaveSearch;
var PopUp;
var winobj;
var IsLanguageMessage;
var popupWindow;
var winGp;
var payWin;
//Script for google-analytics
//var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//alert(1);
//document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//alert(2);
//var pageTracker = _gat._getTracker("UA-2743859-3");
//alert(3);
//pageTracker._initData();
//pageTracker._trackPageview();
////End script for google-analytics

// JScript File
/// By Nitin Jain on 25 April 
/// This is for displaying the text for the time taken in loading the another page.
// ver = navigator.appVersion.substring(0,1)
//    if (ver >= 4)
//    	{
//    	document.write('<DIV ID="cache"  STYLE="POSITION: absolute;Z-INDEX:5; LEFT: 100px; TOP: 100px;"><TABLE WIDTH=400 BGCOLOR=#000000 BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><TABLE WIDTH=100% BGCOLOR=#FFFFFF BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><FONT FACE="Arial, Verdana" SIZE=2><B><BR>Page Loading......<BR><BR></B></FONT></TD> </TR></TABLE></TD> </TR></TABLE></DIV>');
//    	var navi = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
//    	var HIDDEN = (navi) ? 'hide' : 'hidden';
//    	var VISIBLE = (navi) ? 'show' : 'visible';
//    	var cache = (navi) ? document.cache : document.all.cache.style;
//    	//largeur = screen.width;
//    	cache.visibility = VISIBLE;
//    	}
    function LoadPage(Levelnumber)
        {
//            var m_ob = parent.document.getElementById('imgLoading');
//            m_ob.src="Images/Loading.gif";

            var filename = "Images/Loading.gif";
            if (Levelnumber == 0)
            {
                if(parent.document.form1.img!=null)
                {
                parent.document.form1.img.src=filename;
                parent.document.form1.img.style.visibility="visible";
                }
            }

            if (Levelnumber == 1)
            {
                 if(parent.parent.document.form1.img!=null)
                {parent.parent.document.form1.img.src=filename;
                parent.parent.document.form1.img.style.visibility="visible";
                }
            }

            if (Levelnumber == 2)
            {
                if(parent.parent.parent.document.form1.img!=null)
                {parent.parent.parent.document.form1.img.src=filename;
                parent.parent.parent.document.form1.img.style.visibility="visible";
                
                }
            }
            
//            var m_obj = document.getElementById('lblMessage');
//            if (m_obj != null)
//            {
//
//                m_obj.height = '25';
//                m_obj.width = '125';
//            }
            //startLoad();
        }
        function cacheOffMenu(id)
    	{
    	//alert(id);
//    	if (ver >= 4)
//    		{
//    		cache.visibility = HIDDEN;
//    		}
            //UnloadPage(id);
    	}
    	
    	function cacheOffMenuFromDefaultPage(id)
    	{
    	   // alert(id);
    	    UnloadPage(id);
    	}
    function cacheOff(Levelnumber)
    	{    	
//    	if (ver >= 4)
//    		{
//    		cache.visibility = HIDDEN;
//    		}
            //UnloadPage(0);
            UnloadParentPage(Levelnumber);
            SetLanguageValue(0);
    	} 
    	
    	function SetLanguageValue(value)
    	{ 
    	    IsLanguageMessage = value;
    	}	
    	function GetLanguageValue()
    	{
    	    return  IsLanguageMessage;
    	}
function IsBlank(str) 
	{
		var str;
		var regexp=/ /g;
		str = str.replace( regexp,"");
		if(str!="") return false;
		else return true;
	}			
function checkMoney( textFld, response )
	{
	   if(textFld!=null)
	    {
		    if (textFld.readOnly) return;
		    textFld.value=getNumeric(textFld.value) 
		    if (textFld.value == "" || isNaN(textFld.value))// || getNumeric(textFld.value) > 200000)
			    {
				    switch (response) {
					    case 2:	
							    alert("Invalid number entered");
							    break;
					    case 1:
							    textFld.style.fontStyle.fontColor = "Red";
							    break;
					    case 0:
					    textFld.value = 0;
							    textFld.focus();
					    break;					    
					    default:
							    if(getNumeric(textFld.value) > 200000) alert("Maximum of 200,000 is permitted");
							    textFld.value = 0;
							    textFld.focus();
					    }  // select
			    }
		    else {
				    if (response==1) textFld.style.fontStyle.fontColor = "Black";
				    else if(textFld.value == 0 ) textFld.value = "";
			    }
	  }
	}
	
function getNumeric( textValue )
	{
		var numValue;
		numValue = parseFloat(textValue);
		if(isNaN(numValue)) numValue = 0;
		return numValue;
	}	
	
	
function checkNumeric( textFld, response )
	{
	    if(textFld!=null)
	    {
		    if (textFld.readOnly) return;
		    if (textFld.value == "" || isNaN(textFld.value))
			    {
				    switch (response) {
					    case 2:	
							    alert("Invalid number entered");
							    break;
					    case 1:
							    textFld.style.fontStyle.fontColor = "Red";
							    break;
					    default:
							    //if(getNumeric(textFld.value) > 10000) alert("Maximum of 10,000 is permitted");
							    textFld.value = 0;
					    }  // select
			    }
		    else {
				    if (response==1) textFld.style.fontStyle.fontColor = "Black";
			    }
	    }
	}

function CallHelp(jNo, jTitle, jWidth, jHeight, jTop, jLeft)
    {
         window.showModalDialog("../Help.aspx?HelpNo="+jNo+"&Title="+jTitle+"",'','dialogWidth:'+jWidth+';dialogHeight:'+jHeight+';dialogleft:'+jLeft+';dialogtop:'+jTop+';edge:Raised;center:Yes;help: No; resizable: No; status: No;');
    }
    
function strTrans(strFull,searchFor,replaceWith)
	{
	   // alert(searchFor);
		var srchexp=new RegExp(searchFor,"g")
		return strFull.replace(srchexp,replaceWith)
	}    
	
        
	function CheckFormat(obj, intCurrencySep, intDecimalSep, strSeperator, strDecimalSeperator, intDecimalRequired)
        {
            //checkMoney(obj, 0);
        //alert(strSeperator);
         //   alert(strDecimalSeperator);
            var strValue='';
            strValue = obj.value;
            if(strValue == 0) return;        
//            if (intCurrencySep == 0 && intDecimalSep == 0) return strValue;
//            if (m_strValue == '') return 0;
            var strDecimal = "";
            var str = ".";
            var intDecimalIndex = strValue.indexOf(str);
            //alert(intDecimalIndex);
            if (intDecimalIndex > 0)
            {
                strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
                strValue = strValue.substr(0, intDecimalIndex);
            }
            //alert(strValue);
            //alert(strDecimal);
            if(strSeperator == 'DOT') 
            {
                var intLoop=0;
                for(i=0;i<strValue.length;i++)
                {
                    strValue = strValue + ((strValue.substr(intLoop, 1)=='.') ? '':strValue.substr(intLoop, 1));
                    intLoop++;
                }
            }
            else
            {
                if(strSeperator == 'SPACE') strSeperator=' ';
                strValue = strTrans(strValue,strSeperator,'');
                var numValue = parseFloat(strValue);
		        if(isNaN(numValue))
		        {
		            obj.value=0;
		            return;    
		        }
		    } 
            var intLen = strValue.length/intCurrencySep;
            //alert("intLen : " + intLen);
            
            var intstart=intCurrencySep;
            var str='';
            var index=0;
            index=strValue.length;
//            alert("Value"+ strValue);
//            alert("index : " + index);
            for(i=intLen;i>0;i--)
            {
                var intcnt = index-intstart;
//                alert("intcnt: " + intcnt);
                // Done by Ashutosh
                if(intcnt < 0)
                {
                   intcnt = 0;
                }
                str = strValue.substr((intcnt), ((intcnt>0) ? intCurrencySep:index) ) + ((str=='') ? '' : strSeperator) + str;
               //  alert("substr("+(intcnt)+",("+intcnt+">=0) ? "+intCurrencySep+":"+index+")");
//                alert(str);
                index-=intCurrencySep;
            }
//            alert(str);
            if(intDecimalRequired > 0 && strDecimal.length > 0)
            {
                if (intDecimalSep > 0)
                {
                    if(strDecimal.length == intDecimalSep)
                        str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
                    else if(strDecimal.length < intDecimalSep)
                        {
                            str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
                            for(intDecLoop=0;intDecLoop < (intDecimalSep-strDecimal.length);intDecLoop++)
                            {
                                str = str + '0';
                            }  
                        }                                                                
                }
            }
//            alert(str);
            str = strTrans(str, 'DOT', '.');
            obj.value=str;
        }	
//function CheckFormat(obj, intCurrencySep, intDecimalSep, strSeperator, strDecimalSeperator, intDecimalRequired)
//        {
//            //alert(strDecimalSeperator);
//            var strValue='';
//            strValue = obj.value;
//            if(strValue == 0) return;        
////            if (intCurrencySep == 0 && intDecimalSep == 0) return strValue;
////            if (m_strValue == '') return 0;
//            var strDecimal = "";
//            var str = ".";
//            var intDecimalIndex = strValue.indexOf(str);
//            //alert(intDecimalIndex);
//            if (intDecimalIndex > 0)
//            {
//                strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
//                strValue = strValue.substr(0, intDecimalIndex);
//            }
//            //alert(strValue);
//            //alert(strDecimal);
//            if(strSeperator == '.') 
//            {
//                var intLoop=0;
//                for(i=0;i<strValue.length;i++)
//                {
//                    strValue = strValue + ((strValue.substr(intLoop, 1)=='.') ? '':strValue.substr(intLoop, 1));
//                    intLoop++;
//                }
//            }
//            else
//            {
//                if(strSeperator == 'SPACE') strSeperator=' ';
//                strValue = strTrans(strValue,strSeperator,'');
//                var numValue = parseFloat(strValue);
//		        if(isNaN(numValue))
//		        {
//		            obj.value=0;
//		            return;    
//		        }
//		    } 
//            var intLen = strValue.length/intCurrencySep;
//            var intstart=intCurrencySep;
//            var str='';
//            var index=0;
//            index=strValue.length;
//            for(i=intLen;i>0;i--)
//            {
//                var intcnt = index-intstart;
//                str = strValue.substr((index-intstart), ((intcnt>=0) ? intCurrencySep:index) ) + ((str=='') ? '' : strSeperator) + str;
//                index-=intCurrencySep;
//            }
//            if(intDecimalRequired > 0 && strDecimal.length > 0)
//            {
//                if (intDecimalSep > 0)
//                {
//                    if(strDecimal.length == intDecimalSep)
//                        str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
//                    else if(strDecimal.length < intDecimalSep)
//                        {
//                            str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
//                            for(intDecLoop=0;intDecLoop < (intDecimalSep-strDecimal.length);intDecLoop++)
//                            {
//                                str = str + '0';
//                            }  
//                        }                                                                
//                }
//            }
//            obj.value=str;
//        }	
        // This function takes string value and not the object
        function CheckFormatforValue(objValue, intCurrencySep, intDecimalSep, strSeperator, strDecimalSeperator, intDecimalRequired)
        {
            //alert(strDecimalSeperator);
            var strValue='';
            strValue = objValue;
            if(strValue == 0) return;        
//            if (intCurrencySep == 0 && intDecimalSep == 0) return strValue;
//            if (m_strValue == '') return 0;
            var strDecimal = "";
            var str = ".";
            var intDecimalIndex = strValue.indexOf(str);
            //alert(intDecimalIndex);
            if (intDecimalIndex > 0)
            {
                strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
                strValue = strValue.substr(0, intDecimalIndex);
            }
            //alert(strValue);
            //alert(strDecimal);
            if(strSeperator == '.') 
            {
                var intLoop=0;
                for(i=0;i<strValue.length;i++)
                {
                    strValue = strValue + ((strValue.substr(intLoop, 1)=='.') ? '':strValue.substr(intLoop, 1));
                    intLoop++;
                }
            }
            else
            {
                if(strSeperator == 'SPACE') strSeperator=' ';
                strValue = strTrans(strValue,strSeperator,'');
                var numValue = parseFloat(strValue);
		        if(isNaN(numValue))
		        {
		            objValue=0;
		            return;    
		        }
		    } 
            var intLen = strValue.length/intCurrencySep;
            var intstart=intCurrencySep;
            var str='';
            var index=0;
            index=strValue.length;
            for(i=intLen;i>0;i--)
            {
                var intcnt = index-intstart;
                str = strValue.substr((index-intstart), ((intcnt>=0) ? intCurrencySep:index) ) + ((str=='') ? '' : strSeperator) + str;
                index-=intCurrencySep;
            }
            if(intDecimalRequired > 0 && strDecimal.length > 0)
            {
                if (intDecimalSep > 0)
                {
                    if(strDecimal.length == intDecimalSep)
                        str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
                    else if(strDecimal.length < intDecimalSep)
                        {
                            str = str + ((strDecimalSeperator=='') ? '.' : strDecimalSeperator) + strDecimal;
                            for(intDecLoop=0;intDecLoop < (intDecimalSep-strDecimal.length);intDecLoop++)
                            {
                                str = str + '0';
                            }  
                        }                                                                
                }
            }
            return str;
        }	
        
        function UnloadPage(id)
        {
            //var m_obj = parent.document.getElementById('lblMessage');
            //parent.document.form1.img.src="Images/Blank.gif";
          // parent.document.form1.img.src=""; 
//            if (m_obj != null)
//            {
//                m_obj.height = '0';
//                m_obj.width = '0';
//                m_obj.value = "";
//            }
            endLoad();
            //alert(id);
            if(id == undefined || id==0 || id == null)
                return;
           for (i=1; i<parent.document.getElementById ('hdCount').value; i++) 
            {
                var controlid = 'hl' + i;
                //alert(controlid);
                if(parent.document.getElementById(controlid)!= null)
                {
                    //alert(document.getElementById(controlid).style.backgroundColor);
                    parent.document.getElementById(controlid).style.fontWeight="" ;
                    parent.document.getElementById(controlid).style.color="";
                    parent.document.getElementById(controlid).style.width= "110px";
                }
            }
            if(parent.document.getElementById('hl' + id)!=null)
               {
                //alert(document.all.id);
                parent.document.getElementById('hl' + id).style.fontWeight="bold" ;
                parent.document.getElementById('hl' + id).style.color="#d35603";
                parent.document.getElementById('hl' + id).style.width= "125px";
               }
        }
//        function UnloadPage()
//        {
//            parent.document.form1.img.src=""; 
//            endLoad();
//        }
       function UnloadParentPage(levelnumber)
       {
            if (parent.document.form1 != undefined)
            {
                if (levelnumber==0)
                {
                   // alert(parent.document.form1.img);
                    if(parent.document.form1.img != null)
                    parent.document.form1.img.style.visibility="hidden";                        
                }
                if (levelnumber==1)
                {
                     if(parent.parent.document.form1.img!=null)
                        parent.parent.document.form1.img.style.visibility="hidden";                        
                }

                if (levelnumber==2)
                { 
                    if(parent.parent.parent.document.form1.img!=null)
                        parent.parent.parent.document.form1.img.style.visibility="hidden";                        
                }
                    // commented by nitin on 15th May as we are not showing time so no need to calculate teh time now. 
                    //endLoad();
             }       
       }

        // Called when initiating a new page load.
        function startLoad()
        {
            var m_obj = parent.document.getElementById('tbElapsedTime');
            if (m_obj != null)
            {
                startTime = new Date().getTime();
            }
        }
        
        // Called by the loaded page to terminate any notifications / timer etc.
        function endLoad ()
        {
            var m_obj = parent.document.getElementById('tbElapsedTime');
            if (m_obj != null)
            {
                endTime = new Date().getTime();
                var timeDisplay = parent.document.getElementById('tbElapsedTime');
                timeDisplay.value = time(endTime - startTime);
            }
        }
        //
        //--------  Time Conversion --------------
        function two(x) {return ((x>9)?"":"0")+x}
        function three(x) {return ((x>99)?"":"0")+((x>9)?"":"0")+x}

        function time(ms) {
        var sec = Math.floor(ms/1000)
        ms = ms % 1000
        t = three(ms)

        var min = Math.floor(sec/60)
        sec = sec % 60
        t = two(sec) + ":" + t + " ms"

//        var hr = Math.floor(min/60)
//        min = min % 60
//        t = two(min) + ":" + t

//        var day = Math.floor(hr/60)
//        hr = hr % 60
//        t = two(hr) + ":" + t
//        t = day + ":" + t

        return t
        }
        
 function ValidateRange(obj, jStartNo, jEndNo, jZeroAllowed, strMessage)
        {
         
            if(IsBlank(obj.value)) return;
            checkMoney(obj, 0);
            if(jZeroAllowed ==1) {if(obj.value == 0) return};
            if(obj.value < jStartNo || obj.value > jEndNo)
                {
                    alert(strMessage + ": " + jStartNo + " - " + jEndNo);                    
                    obj.value='';
                    //obj.focus();
                    var timer = setTimeout(function() {obj.focus();}, 0);
                    return false;
                }
        }
function KeyDownHandlerwithoutDecimal(obj, e)
         {
         //alert(jDecimalPlace);
            var evt=(e) ? e:(window.event) ? window.event:null; 
            if(evt)
            { 
                if(navigator.appName == "Microsoft Internet Explorer")
                {
                   //var key=(evt.charCode)?evt.charCode: ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));  
                   var key = (evt.charCode)? evt.charCode: ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0)); 
                   if((key > 47 && key < 58) || (key == 127 || key == 8 ||key == 9))
                        return true;
                }
                else
                {
                    var charCode = (evt.charCode)?evt.charCode:0; 
                    //alert(charCode);                         
                    var keyCode = (evt.keyCode)?evt.keyCode:0;
                    //alert(keyCode);
                 
                    if((charCode > 47 && charCode < 58) ||(keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40))
                        return true;
                }
                
            }
            evt.cancel=true;
            evt.returnValue=false;
            return false;
         }          
function KeyDownHandlerwithDecimal(obj, jDecimalPlace, e)
         {
         //alert(jDecimalPlace);
            var evt=(e) ? e:(window.event) ? window.event:null; 
            if(evt)
            { 
                if(navigator.appName == "Microsoft Internet Explorer")
                {
                   //var key=(evt.charCode)?evt.charCode: ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));  
                   var key = (evt.charCode)? evt.charCode: ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0)); 
                   if((key > 47 && key < 58) || (key == 46 || key == 127 || key == 8 ||key == 9))
                        return true;
                }
                else
                {
                    var charCode = (evt.charCode)?evt.charCode:0; 
                    //alert(charCode);                         
                    var keyCode = (evt.keyCode)?evt.keyCode:0;
                    //alert(keyCode);
                 
                    if((charCode > 47 && charCode < 58) || (charCode == 46) || (keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40 || keyCode == 46))
                        return true;
                }
                
            }
//            if((key == 127 || key == 8))
//                return true;
                
            if ((jDecimalPlace > 0 && key == 46) || (key > 47 && key < 58)||(key == 9)||(key == 8))
            {
                var strValue='';
                strValue = obj.value;
                //alert(intDecimalIndex);
                var strDecimal = "";
                var str = ".";
                //alert(intDecimalIndex);
                var intDecimalIndex = strValue.indexOf(str);
                //alert(intDecimalIndex);
                if(key == 46 && intDecimalIndex > 0)
                    return false;
                if (intDecimalIndex > 0)
                {
                    strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
                    //alert(intDecimalIndex);
                    if(strDecimal.length == jDecimalPlace)
                        return false;
                    //alert(intDecimalIndex);    
                }
                //alert(intDecimalIndex);
                return true;
            }
            
            evt.cancel=true;
            evt.returnValue=false;
            return false;
         }  
         
function StringToDate(datestring, format)
{
    var datestring, mSep = "\\";
    var anarray;
    var somedate = new Date();
    if ( datestring.indexOf("/") > 0 ) mSep = "/";
    else if ( datestring.indexOf("-") > 0 ) mSep = "-";
    else if ( datestring.indexOf(".") > 0 ) mSep = ".";
    anarray = datestring.split(mSep);
    switch (format) {
    case "5" :
        // mm/dd

        if(anarray.length>0) somedate.setMonth( getNumeric(anarray[0])-1 );

        if(anarray.length>1) somedate.setDate( getNumeric(anarray[1]) );

        break;
    case "4" :
        // dd/mm

        if(anarray.length>0) somedate.setDate( getNumeric(anarray[0]) );

        if(anarray.length>1) somedate.setMonth( getNumeric(anarray[1])-1 );

        break;
    case "3" :
        // mm/yyyy

        somedate.setDate( 1 );

        if(anarray.length>0) somedate.setMonth( getNumeric(anarray[0])-1 );

        if(anarray.length>1) somedate.setFullYear( getNumeric(anarray[1]) );

        break;
    case "2" :
        // mm/dd/yyyy

        if(anarray.length>0) somedate.setMonth( getNumeric(anarray[0])-1 );

        if(anarray.length>1) somedate.setDate( getNumeric(anarray[1]) );

        if(anarray.length>2) somedate.setFullYear( getNumeric(anarray[2]) );

        break;
    default :
        // dd/mm/yyyy
//        if(anarray.length>0) somedate.setDate( getNumeric(anarray[0]) );

//        if(anarray.length>1) somedate.setMonth( getNumeric(anarray[1])-1 );

//        if(anarray.length>2) somedate.setFullYear( getNumeric(anarray[2]) );
//        alert(getNumeric(anarray[0]));
//        alert(somedate);
        var strDate=anarray[1] + "/" + anarray[0] + "/" +  anarray[2];
        //alert(strDate);
        somedate= new Date(strDate);
        //alert(somedate);
        }
        return somedate;
        
}

function compareDate(dt1,dt2,format)
{
    var actdate, nowdate ;
      
    jDate1 = StringToDate( dt1, format);
    jDate2 = StringToDate( dt2, format);
    //alert(jDate1 + ' versus ' + jDate2 + ' = '+ jDate1 < jDate2);
    if(jDate1 < jDate2) return -1;
    else if(jDate1 > jDate2) return 1;
    else return 0
}         
 function allTrim(strVal)
	{
		return lTrim(rTrim(strVal));
	}

 function lTrim(strVal)
	{
		var i;
		if(strVal!=null)
		{
		for(i=0;i<strVal.length && strVal.substr(i,1) == ' ';i++);
		strVal = strVal.substr(i);
		}
		return strVal;
	}

 function rTrim(strVal)
	{
		var i;
		if(strVal!=null)
		{
		for(i=strVal.length-1;i>=0 && strVal.substr(i,1) == ' ';i--);
		if(i<0) strVal = '';
			else strVal = strVal.substr(0,i+1);
	    }
		return strVal;
	}
	
    function KeyDownHandlerNumericTextbox(e, obj, objectlen)
            {
                var evt=(e)?e:(window.event)?window.event:null; 
            
            if(evt)
            {       //alert(navigator.userAgent);
                if(navigator.appName == "Microsoft Internet Explorer")
                {
                   var key=(evt.charCode)?evt.charCode: ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));  
                    if(obj.value.length > objectlen)
                    {
                        if(key == 127 || key == 8 ||key == 9)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                 
                    if((key > 47 && key < 58) || (key == 127 || key == 8 ||key == 9))
                        return true;
                }
                else
                {
                    var charCode = (evt.charCode)?evt.charCode:0; 
                    //alert(charCode);                         
                    var keyCode = (evt.keyCode)?evt.keyCode:0;
                    //alert(keyCode);
                    
                    if(obj.value.length > objectlen)
                    {
                        if(keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                 
                    if((charCode > 47 && charCode < 58) || (keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40 || keyCode == 46))
                        return true;
                }
            }
            return false;
            }

function echeck(str)
 {
        //alert(str);
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function checkemail(str)
{
    var testresults

//    var str=document.validation.emailcheck.value
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str))
        testresults=true
    else
    {
        alert("Please input a valid email address!")
        testresults=false
    }
    return (testresults)
}

function ValidateEmail(str)
{
    if(str == '') return true;
    var testresults
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(str))
        return true;
    else
    {
        return false;
    }
}        

function ResizeIframe(AdditionalHeight)
{
        var iframeobject = parent.document.getElementById('WgipIFrame');
        if (iframeobject != null)
        {
            //alert(m_IframeDefaultHeight);
            iframeobject.height=m_IframeDefaultHeight;
            //var the_height=iframeobject.contentWindow.document.body.scrollHeight;
            //change the height of the iframe
            iframeobject.height= eval(iframeobject.height)+ eval(AdditionalHeight);
            //alert(iframeobject.height);
        }
        cacheOff(0);
}

function ResizeIframe1(AdditionalHeight)
{
        var iframeobject = parent.parent.document.getElementById('WgipIFrame');
        //alert(iframeobject);
        if (iframeobject != null)
        {
            //alert(m_IframeDefaultHeight);
            iframeobject.height=m_IframeDefaultHeight;
            //var the_height=iframeobject.contentWindow.document.body.scrollHeight;
            //change the height of the iframe
            iframeobject.height= eval(iframeobject.height)+ eval(AdditionalHeight);
            //alert(eval(iframeobject.height)+ eval(AdditionalHeight));
            //alert(iframeobject.height);
        }
}

 function Resize(obj, intSize)
    {     
      //alert(intHeight1);
     var intHeight = 0;     
     intHeight = getElementHeight(obj);
      //alert(intHeight);
     //ResizeIframe(intHeight);
        var iframeobject = parent.document.getElementById('WgipIFrame');
        if (iframeobject != null)
        {
            iframeobject.height= eval(intHeight)+ eval(intSize);
            //alert(iframeobject.height);
        }     
    }
    
    
 function Resize1(obj, intSize)
    {
      //alert(intHeight1);
     var intHeight = 0;     
     intHeight = getElementHeight(obj);
     //intHeight = intHeight-intSize;
    //alert(intHeight);
    // ResizeIframe1(intHeight);
        var iframeobject = parent.parent.document.getElementById('WgipIFrame');
        if (iframeobject != null)
        {
        //alert(intSize);
            iframeobject.height= eval(intHeight)+ eval(intSize);
           // alert(iframeobject.height);
        }     
    
    }
    
function getElementHeight(Elem)
{
  //alert(document.getElementById(Elem));
  var elem =null;
  if(document.getElementById) 
  {
         elem = document.getElementById(Elem);
  //  alert(elem);
  } 
  else if (document.all)
  {
        elem = document.all[Elem];
  }
  var xPos=0;
  if(elem!=null)
    xPos = elem.offsetHeight;
  //alert(xPos);
    return xPos;
   
}
//Added by Ashutosh on 30-01-2008 for AutoComplete
var actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out)
var actb_lim = 10;    // Number of elements autocomplete can show (-1: no limit)
var actb_firstText = true; // should the auto complete be limited to the beginning of keyword?

var actb_bgColor = '#ffffff';
var actb_textColor = '#000000';
var actb_hColor = '#e1eeff';
var actb_fFamily = 'Verdana';
var actb_fSize = '11px';
var actb_hStyle = 'text-decoration:underline;font-weight="bold"';

var actb_keywords = new Array();
var actb_display = false;
var actb_pos = 0;
var actb_total = 0;
var actb_curr = null;
var actb_rangeu = 0;
var actb_ranged = 0;
var actb_bool = new Array();
var actb_pre = 0;
var actb_toid;
var actb_tomake = false;



function actb_parse(n){
    var t = escape(actb_curr.value);
    var tobuild = '';
    var i;
    
    if (actb_firstText){
        var re = new RegExp("^" + t, "i");
    }else{
        var re = new RegExp(t, "i");
    }
    var p = n.search(re);
    
    for (i=0;i<p;i++){
        tobuild += n.substr(i,1);
    }
    tobuild += ""
    for (i=p;i<t.length+p;i++){
        tobuild += n.substr(i,1);
    }
    tobuild += "";
    for (i=t.length+p;i<n.length;i++){
        tobuild += n.substr(i,1);
    }
    return tobuild;
}
function actb_generate(){

    if (document.getElementById('tat_table')) 
    document.body.removeChild(document.getElementById('tat_table'));
    a = document.createElement('table');
    a.cellSpacing='1px';
    a.cellPadding='2px';
    a.style.borderColor = "#000000";
    a.style.border = "1px";
    a.style.borderStyle = "solid";
    a.style.position='absolute';
    a.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
    a.style.left = curLeft() + "px";
    a.style.backgroundColor=actb_bgColor;
    a.style.zIndex = "100000000";
    a.style.width = "20%";
    
    a.id = 'tat_table';
    document.body.appendChild(a);
    var i;
    var first = true;
    var j = 1;

    var counter = 0;
    for (i=0;i<actb_keywords.length;i++){
        if (actb_bool[i]){
            counter++;
            r = a.insertRow(-1);
            if (first && !actb_tomake){
                r.style.backgroundColor = actb_hColor;
                first = false;
                actb_pos = counter;
            }else if(actb_pre == i){
                r.style.backgroundColor = actb_hColor;
                first = false;
                actb_pos = counter;
            }else{
                r.style.backgroundColor = actb_bgColor;
            }
            r.id = 'tat_tr'+(j);
            c = r.insertCell(-1);
            c.style.color = actb_textColor;
            c.style.fontFamily = actb_fFamily;
            c.style.fontSize = actb_fSize;
            var text="<a href='javascript:void(0);' onmousedown='javascript:actb_pos="+j+";actb_penter();' style='text-decoration:none;' >"+actb_parse(actb_keywords[i])+"</a>";
            c.innerHTML = text;
               // c.innerHTML = actb_parse(actb_keywords[i]);            c.id = 'tat_td'+(j);
            j++;
        }
        if (j - 1 == actb_lim && j < actb_total){
            r = a.insertRow(-1);
            r.style.backgroundColor = actb_bgColor;
            c = r.insertCell(-1);
            c.style.color = actb_textColor;
            c.style.fontFamily = 'arial narrow';
            c.style.fontSize = actb_fSize;
            c.align='center';
            //c.innerHTML = '\\/';
            // c.innerHTML ="";
             //c.innerHTML = "<a href='javascript:void(0);' onmousedown='actb_godown();' style='text-decoration:none;' >\\/</a>";
            break;
        }
    }
    actb_rangeu = 1;
    actb_ranged = j-1;
    actb_display = true;
    if (actb_pos <= 0) actb_pos = 1;
}
function curTop(){
    actb_toreturn = 0;
    obj = actb_curr;
    while(obj){
        actb_toreturn += obj.offsetTop;
        obj = obj.offsetParent;
    }
    return actb_toreturn;
}
function curLeft(){
    actb_toreturn = 0;
    obj = actb_curr;
    while(obj){
        actb_toreturn += obj.offsetLeft;
        obj = obj.offsetParent;
    }
    return actb_toreturn;
}
function actb_remake(){
  
//alert('1');
    if(document.getElementById('tat_table'))
        document.body.removeChild(document.getElementById('tat_table'));
    
    a = document.createElement('table');
    a.cellSpacing='1px';
    a.cellPadding='2px';
    a.style.borderColor = "#000000";
    a.style.border = "1px";
    a.style.borderStyle = "solid";
    a.style.position='absolute';
    a.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
    a.style.left = curLeft() + "px";    
    a.style.backgroundColor=actb_bgColor;
    a.id = 'tat_table';
    a.style.zIndex = "100000000";
    a.style.width = "20%";
    
    document.body.appendChild(a);
    
    
    var i;
    var first = true;
    var j = 1;
    if (actb_rangeu > 1){
        r = a.insertRow(-1);
        r.style.backgroundColor = actb_bgColor;
        c = r.insertCell(-1);
        c.style.color = actb_textColor;
        c.style.fontFamily = 'arial narrow';
        c.style.fontSize = actb_fSize;
        c.align='center';
       // c.innerHTML = '/\\';
               //c.innerHTML = "<a href='javascript:void(0);' onmousedown='actb_godown();' style='text-decoration:none;' >/\\</a>";

    }
    
    
    for (i=0;i<actb_keywords.length;i++){
        if (actb_bool[i]){
            if (j >= actb_rangeu && j <= actb_ranged){
                r = a.insertRow(-1);
                r.style.backgroundColor = actb_bgColor;
                r.id = 'tat_tr'+(j);
                c = r.insertCell(-1);
                c.style.color = actb_textColor;
                c.style.fontFamily = actb_fFamily;
                c.style.fontSize = actb_fSize;
                var text="<a href='javascript:void(0);' onmousedown='javascript:actb_pos="+j+";actb_penter();' style='text-decoration:none;' >"+actb_parse(actb_keywords[i])+"</a>";
                c.innerHTML = text;
               // c.innerHTML = actb_parse(actb_keywords[i]);            c.id = 'tat_td'+(j);
                c.id = 'tat_td'+(j);
                j++;
            }else{
                j++;
            }
        }
        if (j > actb_ranged) break;
    }
    
    if (j-1 < actb_total){
        r = a.insertRow(-1);
        r.style.backgroundColor = actb_bgColor;
        c = r.insertCell(-1);
        c.style.color = actb_textColor;
        c.style.fontFamily = 'arial narrow';
        c.style.fontSize = actb_fSize;
        c.align='center';
        //c.innerHTML ="";
        //c.innerHTML = "<a href='javascript:void(0);' onmousedown='actb_godown();' style='text-decoration:none;' >\\/</a>";
    }
    
}
function actb_goup(){
    if (!actb_display) return;
    if (actb_pos == 1) return;
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
    actb_pos--;
    if (actb_pos < actb_rangeu) actb_moveup();
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hColor;
    if (actb_toid) clearTimeout(actb_toid);
    if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
}
function actb_godown(){
    if (!actb_display) return;
    if (actb_pos == actb_total) return;
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
    actb_pos++;
    if (actb_pos > actb_ranged) actb_movedown();
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hColor;
    if (actb_toid) clearTimeout(actb_toid);
    //alert('df2');
    if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
    //alert('d');
}
function actb_movedown(){
    actb_rangeu++;
    actb_ranged++;
    actb_remake();
}
function actb_moveup(){
    actb_rangeu--;
    actb_ranged--;
    actb_remake();
}

function actb_penter(){

    if (!actb_display) return;
    actb_display = 0;
    var word = '';
    var c = 0;
    for (var i=0;i<=actb_keywords.length;i++){
        if (actb_bool[i]) c++;
        if (c == actb_pos){
            word = actb_keywords[i];
            break;
        }
    }
    a = word;
    
    //alert('a=' + a);
    if(a != "" && a != undefined )
    {
        actb_curr.value = a;
        m_strCityDesc=a;
    }
    actb_removedisp();
    
}

function actb_removedisp(){
    //alert('df3');
    actb_display = 0;
    if (document.getElementById('tat_table')) document.body.removeChild(document.getElementById('tat_table'));
    if (actb_toid) clearTimeout(actb_toid);
}
function actb_checkkey(evt){

    a = evt.keyCode;
    //alert(a);
    if (a == 38){ 
        actb_goup();
        return true;
    }else if(a == 40){ 
        actb_godown();
        return true;
    }else if(a == 13){
        actb_penter();
        //document.getElementById(" + actb_curr.id + ").focus();
        return false;
    }else if(a == 9){
        actb_penter();
        return true;
    }
    return true;
   // alert(actb_curr.id);
}
function actb_tocomplete(sndr,evt,arr){
    //alert('df1');
        
    if (arr) actb_keywords = arr;
    if (evt.keyCode == 38 || evt.keyCode == 40 || evt.keyCode == 13 || evt.keyCode == 27) return;
    var i;
    if (actb_display){ 
        var word = 0;
        var c = 0;
        for (var i=0;i<=actb_keywords.length;i++){
            if (actb_bool[i]) c++;
            if (c == actb_pos){
                word = i;
                break;
            }
        }
        actb_pre = word;
    }else{ actb_pre = -1};
    
    if (!sndr) var sndr = evt.srcElement;
    actb_curr = sndr;

    if (sndr.value == ''){
        actb_removedisp();
        return;
    }
    var t = sndr.value;
    if (actb_firstText){
        var re = new RegExp("^" + t, "i");
    }else{
        var re = new RegExp(t, "i");
    }
    
    actb_total = 0;
    actb_tomake = false;
    for (i=0;i<actb_keywords.length;i++){
        actb_bool[i] = false;
        if (re.test(actb_keywords[i])){
            actb_total++;
            actb_bool[i] = true;
            if (actb_pre == i) actb_tomake = true;
        }
    }
    if (actb_toid) clearTimeout(actb_toid);
    if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
    
//    actb_bool = "true";
//    alert(actb_bool);
//alert('dsfdf');
    actb_generate(actb_bool);
   }
//End additon Autocomplete



//Added by Ashutosh on 29-01-2008 for Autocomplete currently not used
var isOpera = navigator.userAgent.indexOf("Opera") > -1;
var isIE = navigator.userAgent.indexOf("MSIE") > 1 && !isOpera;
var isMoz = navigator.userAgent.indexOf("Mozilla/5.") == 0 && !isOpera;

function textboxSelect (oTextbox, iStart, iEnd) { 

   switch(arguments.length) { 
       case 1: 
           oTextbox.select(); 
           break; 

       case 2: 
           iEnd = oTextbox.value.length; 
           /* falls through */ 
            
       case 3:          
           if (isIE) { 
               var oRange = oTextbox.createTextRange(); 
               oRange.moveStart("character", iStart); 
               oRange.moveEnd("character", -oTextbox.value.length + iEnd);      
               oRange.select();                                              
           } else if (isMoz){ 
               oTextbox.setSelectionRange(iStart, iEnd); 
           }                     
   } 

   oTextbox.focus(); 
} 

function textboxReplaceSelect (oTextbox, sText) { 

   if (isIE) { 
       var oRange = document.selection.createRange(); 
       oRange.text = sText; 
       oRange.collapse(true); 
       oRange.select();                                 
   } else if (isMoz) { 
       var iStart = oTextbox.selectionStart; 
       oTextbox.value = oTextbox.value.substring(0, iStart) + sText + oTextbox.value.substring(oTextbox.selectionEnd, oTextbox.value.length); 
       oTextbox.setSelectionRange(iStart + sText.length, iStart + sText.length); 
   } 

   oTextbox.focus(); 
} 

function autocompleteMatch (sText, arrValues) { 

   for (var i=0; i < arrValues.length; i++) { 
   var strArray = arrValues[i].toUpperCase();
   var strsText = sText.toUpperCase();  
        
       if (strArray.indexOf(strsText) == 0) { 
           return arrValues[i]; 
       } 
   } 

   return null; 

} 

function autocomplete(oTextbox, oEvent, arrValues) { 

   switch (oEvent.keyCode) { 
       case 38: //up arrow  
       case 40: //down arrow 
       case 37: //left arrow 
       case 39: //right arrow 
       case 33: //page up  
       case 34: //page down  
       case 36: //home  
       case 35: //end                  
       case 13: //enter  
       case 9: //tab  
       case 27: //esc  
       case 16: //shift  
       case 17: //ctrl  
       case 18: //alt  
       case 20: //caps lock 
       case 8: //backspace  
       case 46: //delete 
           return true; 
           break; 

       default: 
           textboxReplaceSelect(oTextbox, String.fromCharCode(isIE ? oEvent.keyCode : oEvent.charCode)); 
           var iLen = oTextbox.value.length; 

           var sMatch = autocompleteMatch(oTextbox.value, arrValues); 

           if (sMatch != null) { 
               oTextbox.value = sMatch; 
               textboxSelect(oTextbox, iLen, oTextbox.value.length); 
           }  
           
           return false; 
   } 
} 
//End Addition
function PriceKeyDownHandler(e, obj)
        {
            var evt=(e)?e:(window.event)?window.event:null; 
            
            if(evt)
            {       //alert(navigator.userAgent);
                if(navigator.appName == "Microsoft Internet Explorer")
                {
                   var key=(evt.charCode)?evt.charCode: ((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));  
                    if(obj.value.length > 8)
                    {
                        if(key == 127 || key == 8 ||key == 9)
                        {
                            return true;
                        }
                        else
                        {
                            evt.cancel=true;
                            evt.returnValue=false;
                            return false;
                        }
                    }
                 
                    if((key > 47 && key < 58) || (key == 127 || key == 8 ||key == 9))
                        return true;
                }
                else
                {
                    var charCode = (evt.charCode)?evt.charCode:0; 
                    //alert(charCode);                         
                    var keyCode = (evt.keyCode)?evt.keyCode:0;
                    //alert(keyCode);
                    if(obj.value.length > 9)
                    {
                        if(keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40)
                        {
                            return true;
                        }
                        else
                        {
                            evt.cancel=true;
                            evt.returnValue=false;
                            return false;
                        }
                    }
                 
                     var key=(e.charCode)?e.charCode: ((e.keyCode)?e.keyCode:((e.which)?e.which:0));  
//                          alert(key);
                 
                    //if((charCode > 47 && charCode < 58) || (keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40 || keyCode == 46))
                     if((key > 47 && key < 58) || (key == 127 || key == 8 ||key == 9))
                        return true;
                }
            }
            evt.cancel=true;
            evt.returnValue=false;
            return false;
        }

/* Added by Nitin Jain on 18th June 2008*/        
function closeAllPopups()
{   
    closePopup("winAddPhoto"); 
    closePopup("PopUp");
    closePopup("clientReportMail");
    closePopup("AgencyReportMail");
    closePopup("PropertyReportMail");
    closePopup("SaveSearch");
    closePopup("winGp");
    closePopup("popupWindow");  
    closePopup("payWin");     
}

function closePopup(popupHandle)
{
    if (window[popupHandle] && !window[popupHandle].closed)
        window[popupHandle].close();
}


function KeyDownHandlerwithDot(obj, e,jDecimalPlace)
{
    var evt=(e) ? e:(window.event) ? window.event:null; 
    if(evt)
    { 
       if(navigator.appName == "Microsoft Internet Explorer")
       {
           var key = (evt.charCode)? evt.charCode: ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0)); 
           //var key=(e.charCode)?e.charCode: ((e.keyCode)?e.keyCode:((e.which)?e.which:0));  
           if ((jDecimalPlace > 0 && key == 46) || (key > 47 && key < 58)||(key == 9)||(key == 8))
            {
                var strValue='';
                strValue = obj.value;
                var strDecimal = "";
                var str = ".";
                var intDecimalIndex = strValue.indexOf(str);
                if(key == 46 && intDecimalIndex > 0)
                {
                    evt.cancel=true;
                    evt.returnValue=false;    
                    return false;
                    
                }
                if (intDecimalIndex > 0)
                {
                    strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
                    if(strDecimal.length == jDecimalPlace)
                    {
                         evt.cancel=true;
                    evt.returnValue=false;     
                        return false;
                        
                     }
                }
                return true;
            }
       }      
       else
       {
            var charCode = (evt.charCode)?evt.charCode:0; 
            var keyCode = (evt.keyCode)?evt.keyCode:0;
            //if((charCode > 47 && charCode < 58) ||(charCode == 46)||(keyCode == 127 || keyCode == 8 ||keyCode == 9 || keyCode == 37 || keyCode == 38 || keyCode == 39 || keyCode == 40 ||  keyCode == 110 || keyCode == 46))
            var key=(e.charCode)?e.charCode: ((e.keyCode)?e.keyCode:((e.which)?e.which:0));  
            if ((jDecimalPlace > 0 && key == 46) || (key > 47 && key < 58)||(key == 9)||(key == 8))
            {
                var strValue='';
                strValue = obj.value;
                //alert(strValue);
                var strDecimal = "";
                var str = ".";
                var intDecimalIndex = strValue.indexOf(str);
                //alert(intDecimalIndex);
                if(key == 46 && intDecimalIndex > 0)
                {
                    evt.cancel=true;
                    evt.returnValue=false;  
                    return false;
                    
                 }  
                  
                if (intDecimalIndex > 0)
                {
                    strDecimal = strValue.substr((intDecimalIndex + 1), (strValue.length -(intDecimalIndex + 1)));
                    //alert(intDecimalIndex);
                    //alert(strDecimal);
                    if(strDecimal.length == jDecimalPlace)
                    {
                        evt.cancel=true;
                        evt.returnValue=false;   
                        return false;
                    }
                }
                return true;
            }
       }
       
    }
    evt.cancel=true;
    evt.returnValue=false;
    return false;
}      