﻿var intWTPos_x=0;
var intWTPos_y=0;

function CheckObject(Name) {
    
    if(eval($get(Name))) {
        return true;
    } else {
        return false;
    }
}

function ParseQuotes(strName) {
	return strName.replace("//","");
}

function GetTitle(strPropType) {
    var strPropTitle = "";
    
    switch (strPropType) {
        case "RS":
            strPropTitle = "Residential Details";
            break;
        case "CO":
            strPropTitle = "Condo Details";
            break;
        case "MF":
            strPropTitle = "MultiFamily Details";
            break;
        case "CM":
            strPropTitle = "Commercial Details";
            break;
        case "VL":
            strPropTitle = "Vacantland Details";
            break;
        }

        return strPropTitle;
}

function ShowHideTabPanels(varPropType,varOpenHouse) {

    toggleDisplayOff ('gallery-area');
    toggleDisplayOff ('Map');
    
    switch (varPropType) {
        case "RS":
            toggleDisplayOff ('RoomInfo');
            if (!(varOpenHouse.toLowerCase() == "false")) {
                //toggleDisplayOff ('OpenHouse');
                toggleDisplayOff ('subGeneral');
            }
            break;

        case "CO":
            toggleDisplayOff ('RoomInfo');
            if (!(varOpenHouse.toLowerCase() == "false")) {
                //toggleDisplayOff ('OpenHouse');
                toggleDisplayOff ('subGeneral');
            }
            break;

        case "MF":
            toggleDisplayOff ('UnitInfo');
            break;

        case "CM":
            toggleDisplayOff ('BuildingInfo');
            toggleDisplayOff ('BusinessInfo');
            break;

        case "VL":
            toggleDisplayOff ('LotDetails');
            break;
    }

}

function convertQuotesForRemarks(strReplaceAll){
  //return string.replace(/"/g,"'");
  //return string.replace(/|*/g, "'")

    var intIndexOfMatch = strReplaceAll.indexOf( "|*" );
    
    while (intIndexOfMatch != -1){
        // Relace out the current instance.
        strReplaceAll = strReplaceAll.replace( "|*", "'" ) 
        // Get the index of any next matching substring.
        intIndexOfMatch = strReplaceAll.indexOf( "|*" );
    }
    
    intIndexOfMatch = strReplaceAll.indexOf( "|" );
    
    while (intIndexOfMatch != -1){
        // Relace out the current instance.
        strReplaceAll = strReplaceAll.replace( "|", "\"" ) 
        // Get the index of any next matching substring.
        intIndexOfMatch = strReplaceAll.indexOf( "|" );
    }
    return strReplaceAll;
 }

function wordwrap( str, width, brk, cut ) {
 
	brk = brk || '\n';
	width = width || 75;
	cut = cut || false;
		 
	if (!str) { return str; }
		 
	var regex = '.{1,' +width+ '}(\\s|$)' + (cut ? '|.{' +width+ '}|.+$' : '|\\S+?(\\s|$)');
		 
	return str.match( RegExp(regex, 'g') ).join( brk ); 
}

function ClearSubGen(strView){

    if (strView == '0'){		document.getElementById ("subGeneral").innerHTML = convertQuotesForRemarks(strRemarks);	} else {	    	    if (varBrowser != "IE"){		    document.getElementById ("subGeneral").innerHTML = "<img src='images/space.gif' border=0 width=280 height=195/>";		} else {	    		    document.getElementById ("subGeneral").innerHTML ="";		}	}
}

function fncDetailWin(strURL,strWinName){

    window.open(strURL,strWinName,"toolbar=no,status=no,resizable=yes,scrollbars=yes,location=yes,menubar=no,directories=no,width=" + screen.width + ",height=" + screen.height + ",top=0,left=0"); 
}


function SetProgressBarTitle(varType) {
    
    switch(varType) {
        case "1":
            document.getElementById("spnProgressBarTitle").innerHTML = "Processing Listing Search";        
            break;
            
        case "2":
            document.getElementById("spnProgressBarTitle").innerHTML = "Loading Listing Details";        
            break;
        
        case "3":
            document.getElementById("spnProgressBarTitle").innerHTML = "Processing Agent/Office Search";        
            break;
            
        case "4":
        
            document.getElementById("spnProgressBarTitle").innerHTML = "Loading Agent/Office Details";        
            break;
        
        case "5":
            document.getElementById("spnProgressBarTitle").innerHTML = "Loading Open House Details";        
            break;
    }        
    
}

function getScrollXY() {
  
    var scrOfX = 0, scrOfY = 0;
  
    if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
      return scrOfY ;
}

function showProgBar(varType) {
    //alert('in prog');
    
    SetProgressBarTitle(varType);
    
	var mapDiv = document.getElementById("myMap");
	var ListDiv = document.getElementById("divListView");
	
	var progBar = document.getElementById("divProgressBar");
	var windowHeight = pageHeight();
	var windowWidth = pageWidth();
	//alert(windowWidth);
	var barLeft ;
	if (windowWidth < 1300) {
	    barLeft = ((windowWidth - 250) - 400) / 2; 
	} else {
	    barLeft = ((windowWidth - 250) - 400) / 2; 
	}
	var barTop = getScrollXY();
		
	/*mapDiv.disabled = true;
	mapDiv.style.filter = "Alpha(Opacity=40); -moz-opacity:0.4; opacity: 0.4;";
	ListDiv.style.filter = "Alpha(Opacity=40); -moz-opacity:0.4; opacity: 0.4;";*/
	
	grayOut(true);
    
	//progBar.style.display = "block";
	progBar.style.width = "300px";
	//	progBar.style.height = "200px";
	progBar.style.backcolor = "white";
	progBar.style.position = "relative";
	progBar.style.borderwidth = "4px";
	progBar.style.bordercolor = "Navy";
	progBar.style.left = barLeft + "px";
	progBar.style.top = barTop + "px";
	//	//elemOutDivHeader.innerHTML = strOutHtmlHead;
	map.AddControl(progBar);
	map.ShowControl(progBar);
	
	//progBar.style.paddingLeft =screen.width/2;
    //progBar.style.paddingTop= screen.height/2-250;
  /*  
    var IpopTop = (document.body.clientHeight - document.getElementById("divProgressBar").offsetHeight) / 2;
    var IpopLeft = (document.body.clientWidth - document.getElementById("divProgressBar").offsetWidth) / 2;
            
    document.getElementById("divProgressBar").style.left=IpopLeft + document.body.scrollLeft;
    document.getElementById("divProgressBar").style.top=IpopTop + document.body.scrollTop;
            
    document.getElementById("divProgressBar").style.display = "block";
    */
	progBar.style.display="";
	
//bar1.showBar();

}

function showProgBar_Iframe_Ofc_List(varType){
    
    document.getElementById("spnProgressBarTitle_Ofc").innerHTML = "Loading Agent/Office Details";        
    
	var mapDiv = document.getElementById("myMap");
	var ListDiv = document.getElementById("divListView");
	
	var progBar = document.getElementById("divProgressBar_Ofc");
	var windowHeight = pageHeight();
	var windowWidth = pageWidth();
	//alert(windowWidth);
	var barLeft ;
	if (windowWidth < 1300) {
	    barLeft = ((windowWidth - 250) - 400) / 2; 
	} else {
	    barLeft = ((windowWidth - 250) - 400) / 2; 
	}
	var barTop = getScrollXY();
		
	/*mapDiv.disabled = true;
	mapDiv.style.filter = "Alpha(Opacity=40); -moz-opacity:0.4; opacity: 0.4;";
	ListDiv.style.filter = "Alpha(Opacity=40); -moz-opacity:0.4; opacity: 0.4;";*/
	
	grayOut(true);
    
	//progBar.style.display = "block";
	progBar.style.width = "300px";
	//	progBar.style.height = "200px";
	progBar.style.backcolor = "white";
	progBar.style.position = "relative";
	progBar.style.borderwidth = "4px";
	progBar.style.bordercolor = "Navy";
	progBar.style.left = barLeft + "px";
	progBar.style.top = barTop + "px";
	//	//elemOutDivHeader.innerHTML = strOutHtmlHead;
	map.AddControl(progBar);
	map.ShowControl(progBar);
	
	//progBar.style.paddingLeft =screen.width/2;
    //progBar.style.paddingTop= screen.height/2-250;
  /*  
    var IpopTop = (document.body.clientHeight - document.getElementById("divProgressBar").offsetHeight) / 2;
    var IpopLeft = (document.body.clientWidth - document.getElementById("divProgressBar").offsetWidth) / 2;
            
    document.getElementById("divProgressBar").style.left=IpopLeft + document.body.scrollLeft;
    document.getElementById("divProgressBar").style.top=IpopTop + document.body.scrollTop;
            
    document.getElementById("divProgressBar").style.display = "block";
    */
	progBar.style.display="";
	
}


function showProgBarAgt(varType,strType) {
    
    SetProgressBarTitle(varType);
    
	//var mapDiv = document.getElementById("myMap");
	var ListDiv = document.getElementById("divListView");
	
	var progBar = document.getElementById("divProgressBar");
	var windowHeight = pageHeight();
	var windowWidth = pageWidth();
	var barLeft = (windowWidth + 250 ) / 2;
	var barTop = getScrollXY() + 20;
			
	grayOut(true,strType);
    
	progBar.style.display = "block";
	progBar.style.width = "300px";
	//	progBar.style.height = "200px";
	progBar.style.backcolor = "white";
	progBar.style.position = "absolute";
	progBar.style.borderwidth = "4px";
	progBar.style.bordercolor = "Navy";
	//progBar.style.left = barLeft + "px";
	progBar.style.Left= barLeft + "px";
	//progBar.style.Top = barTop + "px";

    progBar.style.paddingTop = barTop + "px"; //screen.height/2-250;
 
	progBar.style.display="";
	
//bar1.showBar();

}

function HideProgBarAgt() {
	var progBar = document.getElementById("divProgressBar");
	//var mapDiv = document.getElementById("myMap");
	var ListDiv = document.getElementById("divListView");
	
	//mapDiv.disabled = false;
	//mapDiv.style.filter = "";
	ListDiv.style.filter = "";

	progBar.style.display = "none";
	
	//map.HideControl(progBar);
	grayOut(false);
	
	//bar1.hideBar();


}

function HideProgBarHome() {
	var progBar = document.getElementById("divProgressBar");
	
	progBar.style.display = "none";
	
	//map.HideControl(progBar);
	grayOut(false);
	
	//bar1.hideBar();


}

function HideProgBar() {
	var progBar = document.getElementById("divProgressBar");
	var mapDiv = document.getElementById("myMap");
	var ListDiv = document.getElementById("divListView");
	
	mapDiv.disabled = false;
	mapDiv.style.filter = "";
	ListDiv.style.filter = "";

	progBar.style.display = "none";
	
	map.HideControl(progBar);
	grayOut(false);
	
	//bar1.hideBar();


}

function HideProgBar_Parent() {

        var progBar = parent.document.getElementById("divProgressBar");
	    var mapDiv = parent.document.getElementById("myMap");
	    var ListDiv = parent.document.getElementById("divListView");
	
	    mapDiv.disabled = false;
	    mapDiv.style.filter = "";
	    ListDiv.style.filter = "";
    
    
	progBar.style.display = "none";
	
	//map.HideControl(progBar);
	grayOut(false);
	
	//bar1.hideBar();

}

function HideProgBar_Parent_List_Ofc() {

    var progBar = parent.document.getElementById("divProgressBar_Ofc");
	var mapDiv = parent.document.getElementById("myMap");
	var ListDiv = parent.document.getElementById("divListView");
	
	mapDiv.disabled = false;
	mapDiv.style.filter = "";
	ListDiv.style.filter = "";
        
	progBar.style.display = "none";
	
	//map.HideControl(progBar);
	grayOut(false);
	
	//bar1.hideBar();

}


function grayOut(vis, strType,options) {  
    
    // Pass true to gray out screen, false to ungray  
    // options are optional.  This is a JSON object with the following (optional) properties  
    // opacity:0-100         
    // Lower number = less grayout higher = more of a blackout   
    // zindex: #             
    // HTML elements with a higher zindex appear on top of the gray out  
    // bgcolor: (#xxxxxx)    
    // Standard RGB Hex color code  
    // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});  
    // Because options is JSON opacity/zindex/bgcolor are all optional and can appear  
    // in any order.  Pass only the properties you need to set.  
    var options = options || {};   
    var zindex = options.zindex || 50;  
    var opacity = 40//options.opacity || 70;  
    var opaque = 0.8 //(opacity / 100);  
    var bgcolor = options.bgcolor || '#000000';  
    var dark=document.getElementById('darkenScreenObject');  
    if (!dark) {    
        // The dark layer doesn't exist, it's never been created.  So we'll    // create it here and apply some basic styles.    
        // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917    
        var tbody = document.getElementsByTagName("body")[0];    
        var tnode = document.createElement('div');           
        // Create the layer.        
        tnode.style.position='absolute';                 // Position absolutely        
        tnode.style.top='0px';                           // In the top        
        tnode.style.left='0px';                          // Left corner of the page        
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars                    
        tnode.style.display='none';                      // Start out Hidden        
        tnode.id='darkenScreenObject';                   // Name it so we can find it later    
        tbody.appendChild(tnode);                            // Add it to the web page    
        dark=document.getElementById('darkenScreenObject');  // Get the object.  
    }  
    if (vis) {    
        // Calculate the page width and height     
        if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {        
            var pageWidth = document.body.scrollWidth+'px';        
            var pageHeight = document.body.scrollHeight+'px';    
        } else if( document.body.offsetWidth ) {      
            var pageWidth = document.body.offsetWidth+'px';      
            var pageHeight = document.body.offsetHeight+'px';    
        } else {       
            var pageWidth='100%';       
            var pageHeight='100%';    
        }     
        pageHeight = '2100px';
        if (strType == "0") {
            var pageWidth='100%';       
            var pageHeight='100%';    
        }  
        
        //set the shader to cover the entire page and make it visible.    
        dark.style.opacity=opaque;                          
        dark.style.MozOpacity=opaque;                       
        if (varBrowser == "IE") dark.style.filter='alpha(opacity='+opacity+')';     
        dark.style.zIndex=zindex;            
        dark.style.backgroundColor=bgcolor;      
        dark.style.width= pageWidth;    
        dark.style.height= pageHeight;    
        dark.style.display='block';                            
  } else {     
    dark.style.display='none';  }
}

function GetCurrentPageName (){
    var sPath = window.location.pathname;
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    
    return sPage;
} 


/*****************************************************************************************************************************************/
/*                                              NEW WORKING DIALOGUE FUNCTIONS 
/*****************************************************************************************************************************************/

  var newTop;
  var newLeft;
  
      
    function showLoadingMessage_Home(strType) {
            
        SetWorkingImage(strType);
        
        GreyOutScreen();
        //grayOut(true);
        var progBar = document.getElementById("loading");
        progBar.style.display =""; 
        progBar.style.zIndex ="101";
        
        if (navigator.appName == "Microsoft Internet Explorer") {
            document.getElementById("loading").style.top = document.body.scrollTop;
        } else{
            document.getElementById("loading").style.top = window.pageYOffset;
        }
                        
        chkLoadingMessage(strType)   

    }
        
    function showLoadingMessage(e,strType) {
            
        SetWorkingImage(strType);
        
        GreyOutScreen();
        //grayOut(true);
        var progBar = document.getElementById("loading");
        progBar.style.display =""; 
        
        if (navigator.appName == "Microsoft Internet Explorer") {
            document.getElementById("loading").style.top = document.body.scrollTop + 20;
        } else{
            //alert('in nonie=' + window.pageYOffset);
            document.getElementById("loading").style.top = "1500px";
            document.getElementById("loading").style.left= "500px";
        }
                
        map.AddControl(progBar);
	    map.ShowControl(progBar);
                
        chkLoadingMessage(e,strType)
        //setTimeout("chkLoadingMessage()",1);

    }
    
       
    function chkLoadingMessage(e,strType) {
        
        //alert('in loading regular win');
        
        var progBar = document.getElementById("loading");
        
        if (navigator.appName == "Microsoft Internet Explorer") {
            document.getElementById("loading").style.top = document.body.scrollTop + 350;
            document.getElementById("loading").style.left = document.body.scrollLeft + 550;
        } else{                
                document.getElementById("loading").style.top = window.pageYOffset + 300;
                //document.getElementById("loading").style.left = document.body.scrollLeft + 550;
            }            
              
            PositionWorkingDialog(e,'loading',strType);
            //alert(width + ";" + height);
            //setTimeout("chkLoadingMessage()",1);
       // }
    }
    
     function hideLoadingMessage(){
        loading_message = false;
        document.getElementById ('loading').style.display = 'none';
    }

    function SetWorkingImage(strType){
            
            switch (strType) {
                
                case "ListView":
                    document.getElementById ("imgWorking").src = "images/Working_ListView_1.gif"; 
                    break;
                
                case "PropDetLB":
                    document.getElementById ("imgWorking").src = "images/Working_Loading.gif";             
                    break;
                    
                case "OfficeLB":
                    document.getElementById ("imgWorking").src = "images/Searching_WT.gif"; 
                    break;
                        
            }
            
    }

    function GreyOutScreen() {
        
        var cvr = document.getElementById("cover");    
        cvr.style.display = "block";
        
        var progBar = document.getElementById("loading");
        progBar.style.display = "block";
        
        if (varBrowser !="IE") {
            var mapDiv = document.getElementById("myMap");	    	
	        mapDiv.style.filter =  "alpha(opacity=200); ";
	        
	        //mapDiv.style.filter = "";
        }
        
        //if (document.body.style.overflow = "hidden") {
	        cvr.style.width = "100%";
	        cvr.style.height = "2100px";
	    //}
	        
	    //setTimeout("closePopUp()",1000);
    }
    
    function SetNormalScreen() {
        var cvr = document.getElementById("cover");        
        cvr.style.display = "none";
        
        //grayOut(false);         
        
        hideLoadingMessage();
        if (varBrowser != "IE") {
            document.body.style.overflowY = "visible";
            var mapDiv = document.getElementById("myMap");	    	
	        mapDiv.style.disabled = false ;
        }
    }

    function SetNormalScreen_Parent() {

        var progBar = parent.document.getElementById("loading");
	    var mapDiv = parent.document.getElementById("myMap");
	    var ListDiv = parent.document.getElementById("divListView");
	
	    mapDiv.disabled = false;
	    mapDiv.style.filter = "";
	    ListDiv.style.filter = "";    
    
	    progBar.style.display = "none";
	
    	 var cvr = parent.document.getElementById("cover");
        //var dlg = document.getElementById(el)
        cvr.style.display = "none";
	
}

function SetNormalScreen_Parent_H() {

        var progBar = parent.document.getElementById("loading");
	    var mapDiv = parent.document.getElementById("myMap");
	    	
	    mapDiv.disabled = false;
	    mapDiv.style.filter = "";
	        
	    progBar.style.display = "none";
	
    	 var cvr = parent.document.getElementById("cover");
        //var dlg = document.getElementById(el)
        cvr.style.display = "none";
	
}

function SetNormalScreen_Parent_NoMap() {

        var progBar = parent.document.getElementById("loading");
	   	       
	    progBar.style.display = "none";
	
    	 var cvr = parent.document.getElementById("cover");
        //var dlg = document.getElementById(el)
        cvr.style.display = "none";
	
}

function PositionWorkingDialog(evt,popup,strType)
{
    //document.getElementById(popup).style.display='block';
    
    if(document.all)
    {
        height=document.body.offsetHeight;
        width=document.body.offsetWidth;
        divHeight=document.getElementById(popup).offsetHeight;
        divWidth=document.getElementById(popup).offsetWidth;
    }
    else
    {
        if(document.getElementById)
        {
            height=window.innerHeight;
            width=window.innerWidth;
            divHeight=document.getElementById(popup).offsetHeight;
            divWidth=document.getElementById(popup).offsetWidth;
        }
    }
    
    getViewportScrollY = function() {
      var scrollY = 0;
      if( document.documentElement && document.documentElement.scrollTop ) {
        scrollY = document.documentElement.scrollTop;
      }
      else if( document.body && document.body.scrollTop ) {
        scrollY = document.body.scrollTop;
      }
      else if( window.pageYOffset ) {
        scrollY = window.pageYOffset;
      }
      else if( window.scrollY ) {
        scrollY = window.scrollY;
      }
      return scrollY;
    };
        
    var WTTop  = getViewportScrollY();
    newTop = WTTop +(height/2)-(divHeight/2);
    var nonIEnewTop = WTTop/2 + (height/2);
    var nonIENewLeft = (width/2);
    newLeft = (width/2)-(divWidth/2);
    
    var PageName = GetCurrentPageName();
    var intMapHt = 0;
    
    if (currPageName =="ListView.aspx") intMapHt = parseInt(document.getElementById('myMap').style.height);
        
    var intPostTop = 0;
    
    if (varBrowser == "IE") {
        if (strType == "ListView") {
            if (WTTop > 500) intPostTop = 250;
            if (WTTop < 200 ) intPostTop = -150;
            if (WTTop > 200 && WTTop < 500) intPostTop = 150;
            document.getElementById(popup).style.top= WTTop - intPostTop;
        } else {
            document.getElementById(popup).style.top = WTTop + 200;
        }
        
        document.getElementById(popup).style.left = newLeft + 300;
    } else {      
        var e = (typeof( window.event ) != "undefined" ) ? window.event : evt;
        
       var x = (window.Event) ? e.pageX : event.clientX;
       var y = (window.Event) ? e.pageY : event.clientY;
       //alert("x=" + x + ";y=" + y );    
       //alert(window.pageXOffset + ";" + window.pageYOffset);
       //alert('in position WT 1');
       if (x == undefined || y==undefined) {           		
        //alert('in position WT 2');
         //   alert(x + "," + y)
            //alert(WTTop + "," + newLeft)
            document.getElementById(popup).style.top=  WTTop + 250 + "px";
            document.getElementById(popup).style.left = newLeft + 100 + "px";                    
             
       } else { 
        //alert('in position WT 3');
       //alert(y - window.pageYOffset );           
            if (x > 1000) x= x- 380;
            if (y - window.pageYOffset < 120 ) y = y+70;
            if (y - window.pageYOffset > 200 && y - window.pageYOffset < 300) y = y-100;            
            if (y - window.pageYOffset > 300 && y - window.pageYOffset < 400) y = y-120;            
            if (y - window.pageYOffset > 400 && y - window.pageYOffset < 500) y = y-200;            
            if (y - window.pageYOffset > 500) y = y-300;
            document.getElementById(popup).style.top=  y  + "px";
            document.getElementById(popup).style.left = x + "px";
            
       }     
        
    }
    
}

/*********************************************************************/

function ShowLoadingMessage_ShowPrompt(strType) {
    
    GreyOutScreen_Prompt();
    
    //showPromptClick_WorkingDialog(e,'loading_Prompt',400,0,e.clientX,e.clientY-5,50,i,sFld);    		    
    showPromptClick_WorkingDialog('loading_Prompt',strType);    		    
    
}

function showPromptClick_WorkingDialog(PromptID,strType) { 
    
	var prompt = document.getElementById (PromptID);
	prompt.style.pixelLeft = 0;
	prompt.style.pixelTop = 0;
        	
	var pX = 0;
	var pY = 0;
        	
	prompt.style.display = 'inline';    
    SetWorkingImage_Prompt(strType);

	// Get visible area on screen        	
	var intPosTop = 0;
	var intPgHt = 0;
	
	intPosTop = posTop();	
	intPgHt = pageHeight()/2;	
	pY = intPosTop+intPgHt -105;	
    pX = pageWidth()/2-250;		       
	
	//alert("pX=" + pX + ";pY=" + pY);
	//alert("y=" + pY + ";posBottom=" + posBottom() + ";intPosTop=" + intPosTop + ";pX=" + pX );
	 
	if (varBrowser == "IE" ){
        prompt.style.left= pX-100 + "px";
	} else {
	    prompt.style.left= pX-200 + "px";
	}
	prompt.style.pixelTop = pY ;
	    
	prompt.style.zIndex = 600;	
		
}

function showPromptClick_WorkingDialog_Old(e,PromptID, width, hdirection, x, y, vdirection,i,sFld) { 
    
    //cross-browser compatibility - window.event doesn't work on mozilla.
	var sender = (typeof( window.event ) != "undefined" ) ? e.srcElement : e.target;
	var evt = (typeof( window.event ) != "undefined" ) ? window.event : e;
        	
	var prompt = document.getElementById (PromptID);
	prompt.style.pixelLeft = 0;
	prompt.style.pixelTop = 0;
        	
	var pX = 0;
	var pY = 0;
        	
	if (showPromptClick_WorkingDialog.arguments.length < 4) {
	    pX = evt.clientX>0 ? ((evt.clientX+width<document.body.clientWidth) ? evt.clientX : evt.clientX - width) : 20;
		pY= evt.clientY+document.body.scrollTop;
	} else {
        if (hdirection<1) {
		    pX= x>0 ? ((x+width<document.body.clientWidth) ? x : x - width) : 0;
			pY=y+document.body.scrollTop;
		} else {
		    pX = hdirection==1 ? x - width : x;
			pY = y+document.body.scrollTop;
		}
	}
	prompt.style.display = 'inline';
    
    //if (sFld == "") sFld = "myMap";
    
    SetWorkingImage_Prompt("ListView");
    
  /*  if (varBrowser != "IE" ) {
        FindAbsolutePosition_WorkingDialog(sFld);        
       
        pX = intWTPos_x;
        pY = intWTPos_y - 100;        
    } else {    
	    pX = mouseX(evt);
	    pY = mouseY(evt);	    
	}*/
	
	//alert("pX = " + pX + ";width=" + pageWidth() + ";posRight=" + posRight() + ";posleft=" + posLeft())
	//alert("pY = " + pY + ";pageHt=" + pageHeight() + ";posTop=" + posTop() + "; posBottom()=" + posBottom())
	// not fully visible on screen        
	//if (pY + 345 > posBottom()) pY = pY - 300;	
	var intPosTop = 0;
	intPosTop = posTop();
	var intPgHt = 0;
	intPgHt = pageHeight()/2;
	//alert('y=' + (intPosTop+intPgHt));
	pY = intPosTop+intPgHt -105;//parseInt(posTop()) + parseInt(pageHeight()/2) + "px";	
	//pX = posLeft() + pageWidth()/2 + 60 + "px";	
	//alert(pageWidth()/2);
	       
	//prompt.style.pixelLeft = pX ;
	prompt.style.left= pageWidth()/2-250 + "px";
	prompt.style.pixelTop = pY ;
	
	
	    
	prompt.style.zIndex = 600;
	
	//alert('in show promt');
	
}

function FindAbsolutePosition_WorkingDialog(obj) 
{
    var posX = 0;
    var posY = 0;
    // alert("obj=" + obj.id + ";" + posX + ";" + posY); 
    while (obj != null)
    {
        posX += obj.offsetLeft;
        posY += obj.offsetTop;
        obj = obj.offsetParent;
    }
     //alert(posX + ";" + posY);
     intWTPos_x = posX;
     intWTPos_y = posY;
     
	//return {top:posY, left:posX};
}


function SetWorkingImage_Prompt(strType){
            
    switch (strType) {
                
        case "ListView":
            document.getElementById ("imgWorking_Prompt").src = "images/Working_ListView_1.gif"; 
            break;
                
        case "PropDetLB":
            document.getElementById ("imgWorking_Prompt").src = "images/Working_Loading.gif";             
            break;
                    
        case "OfficeLB":
            document.getElementById ("imgWorking_Prompt").src = "images/Searching_WT.gif"; 
            break;
                        
    }            
}

function hideLoadingMessage_Prompt(){
    loading_message = false;
    //alert('in hide');
    document.getElementById ('loading_Prompt').style.display = 'none';
    //document.getElementById ('imgWorking_Prompt').style.display = 'none';
    
    
}

function SetNormalScreen_Prompt() {
    
    var cvr = document.getElementById("cover");        
    cvr.style.display = "none";
        
    //grayOut(false);         
        
    hideLoadingMessage_Prompt();
    if (varBrowser != "IE") {
        document.body.style.overflowY = "visible";
        var mapDiv = document.getElementById("myMap");	    	
	    mapDiv.style.disabled = false ;
    }
}

function SetNormalScreen_Parent_Prompt() {

    var progBar = parent.document.getElementById("loading_Prompt");	   
	progBar.style.display = "none";
    
    var cvr = parent.document.getElementById("cover");        
    cvr.style.display = "none";	
    
}


 function GreyOutScreen_Prompt() {
        
    var cvr = document.getElementById("cover");    
    cvr.style.display = "block";
    intPageHt = "2100px" ;       
    
    var currPageName = GetCurrentPageName();
    
    if (currPageName =="ListView.aspx") {
        var intRecsPerPage = document.getElementById ("lstRecsPerPage").value;    
    
        switch (intRecsPerPage){
        
        case "25":        
            intPageHt = "4100px" ;       
            break; 
        
        case "50":
            intPageHt = "8100px" ;       
            break;
            
        case "75":
            intPageHt = "12100px" ;       
            break;
         
        case "100":
            intPageHt = "15100px" ;       
            break;
        }
    }
    
    //if (document.body.style.overflow = "hidden") {
	    cvr.style.width = "100%";
	    cvr.style.height = intPageHt;
    //}
	        
	//setTimeout("closePopUp()",1000);
}
    
    
function fncToggleCloseBtnGraphic(strType){
    if (strType== "0") {
        document.getElementById ("imgCloseBtn").src = "images/generic/DetailPopupClose_02.png";
    } else {
        document.getElementById ("imgCloseBtn").src = "images/generic/DetailPopupClose_01.png";
    }
}