







	function ShowContentStyles(recID, ctype) {

	    var hite = document.getElementById('MainWrapper').offsetHeight;
	    document.getElementById('WindowBlank').style.display = "block";
	    document.getElementById('WindowBlank').style.height = hite + 'px';

	    var arrayPageSize = getPageSize();
	    var arrayPageScroll = getPageScroll();

	   // showContentAjax(recID, ctype);

	    // center loadingImage if it exists
	    if (document.getElementById('WindowMainStyles')) {
	        var divHite = document.getElementById('WindowMainStyles').style.height;
	        var divWid = document.getElementById('WindowMainStyles').style.width;

	        document.getElementById('WindowMainStyles').style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - parseFloat(divHite)) / 2) + 'px');
	        document.getElementById('WindowMainStyles').style.left = (((arrayPageSize[0] - 20 - parseFloat(divWid)) / 2) + 'px');
	        //document.getElementById('WindowMain').innerHTML = '';
	        document.getElementById('WindowMainStyles').style.display = 'block';
	    }



	}







function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}

function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}


function WindowClose()
{
    document.getElementById('WindowContent').innerHTML = '';
	document.getElementById('WindowBlank').style.display = "none";
	document.getElementById('WindowMain').style.display = "none";
	
}


function WindowCloseStyles() {
    document.getElementById('WindowContent').innerHTML = '';
    document.getElementById('WindowBlank').style.display = "none";
    document.getElementById('WindowMainStyles').style.display = "none";

}

function ShowContent2()
	{

	    var hite = document.getElementById('MainWrapper').offsetHeight;
	   
		document.getElementById('WindowBlank').style.display = "block";
		document.getElementById('WindowBlank').style.height = hite+'px';
		    
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
        
       
        
		// center loadingImage if it exists
		if (document.getElementById('WindowMainBox')) {

		
			var browser=navigator.appName;
			var browserVersion=navigator.appVersion;
			 browserVersion=parseFloat(browserVersion);	

			if (browser=="Microsoft Internet Explorer")

  			{
 				spacebuffer=20
  			}
			else
 			{
  				spacebuffer=30
  			}

			var divHite = document.getElementById('WindowMainBox').style.height;
			var divWid = document.getElementById('WindowMainBox').style.width;
	        	
			document.getElementById('WindowMainBox').style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - parseFloat(divHite)) / 2) + 'px');
			document.getElementById('WindowMainBox').style.left = (((arrayPageSize[0] - spacebuffer - parseFloat(divWid)) / 2) + 'px');
			//document.getElementById('WindowMainBox').innerHTML = '';
			document.getElementById('WindowMainBox').style.display = 'block';
		}
		
		

	}




function WindowClose2()
{
    
	document.getElementById('WindowBlank').style.display = "none";
	document.getElementById('WindowMainBox').style.display = "none";
	//document.getElementById('WindowMainBox').innerHTML = "";
	//document.getElementById("MSIE").controls.stop();
	//jwplayer("player").stop();
	document.getElementById('vFrame').src = '/scripts/blank.html'


}




function ajaxMapAJAXData(url) {


    http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) { }
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    http_request.onreadystatechange = alertMapAJAXData;
    http_request.open('GET', url, true);
    http_request.send(null);


}


function alertMapAJAXData() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            var xmldoc = http_request.responseText;
//alert(xmldoc)
            if (xmldoc == 'VALID') {
                WindowClose2()
            } else {

                document.getElementById("WindowMainTextMSG").innerHTML = "Incorrect account information. Please try again.";

            }
        }
        else {
            alert(http_request.status);
            alert('There was a problem with the request.');
        }
    }

}

function keyNum(e) 
{
    var k;
    document.all ? k = e.keyCode : k = e.which;
    
    
    if (k == 13)
    {
        searchListing();
    }
}
