var tempX = 0;
var tempY = 0;
var myWin
document.onmousemove = getMouseXY;

if (navigator.userAgent.indexOf('Win') == -1) {
        platform = 'MAC';
} else {
        platform = 'WIN';
}

if ((navigator.appName == "Netscape")||(navigator.appName == "Opera")){	// Netscape
	if (parseInt(navigator.appVersion) <= 4){
		myStyles = "";
		myAll = ".";
		myBrowser = "NS";
	}
	else{
		myStyles = "').style";
		myAll = ".getElementById('";
		myBrowser = "NS6";
	}
}
else if (document.all){		//IE
	myStyles = ".style";
	myAll = ".all.";
	myBrowser = "IE";
}

function stdRollover(obj, myColor) {
    obj.style.color = myColor;
    obj.style.textDecoration = "underline";
}

function stdRollout(obj,myColor){
    obj.style.color = myColor
    obj.style.textDecoration = "none";
}

function openNewWindow(winWidth,winHeight,pageRef,myTitle,sb,tb,sc,rs,mu){

	if (navigator.appName == "Netscape"){ // Netscape
		if (parseInt(navigator.appVersion) <= 4){
			myWidth = (screen.width - winWidth) / 2;
			myHeight = (screen.height - winHeight) / 2;
			myBrowser2 = "NS";
		}
		else{
			myWidth = (screen.width - winWidth) / 2;
			myHeight = (screen.height - winHeight) / 2;
			myBrowser2 = "NS6";
		}
	}
	else if (document.all){ //IE
		myWidth = (screen.width - winWidth) / 2;
		myHeight = (screen.height - winHeight) / 2;
		myBrowser2 = "IE";
	}
	myParams = "width=" + winWidth + ",height=" + winHeight + ",status=" + sb + ",toolbar=" + tb + ",scrollbars=" + sc + ",resizable=" + rs + ",menubar=" + mu

 	myWin = window.open("",String(myTitle),String(myParams))
	myWin.moveTo(myWidth,myHeight)
	myWin.focus()
 	myWin.document.location = pageRef

}

function stdEngineRollover(obj){
	obj.style.color = "#FF0000"
}

function stdEngineRollout(obj){
	obj.style.color = "#0000CC"
}

function myEngineRollOver(obj){
	obj.style.backgroundColor = "#8889A5"
	obj.style.color = '#FFFFFF'
	obj.style.bordertop = 'solid 1px #272939'
	obj.style.borderleft = 'solid 1px #383A4C'
	obj.style.borderright = 'solid 1px #E4E7FF'
	obj.style.borderbottom = 'solid 1px #E4E7FF'
}

function myEngineRollOut(obj){
	obj.style.backgroundColor = "#FFFFFF"
	obj.style.color = '#000000'
	obj.style.bordertop = 'solid 1px #E4E7FF'
	obj.style.borderleft = 'solid 1px #E4E7FF'
	obj.style.borderright = 'solid 1px #383A4C'
	obj.style.borderbottom = 'solid 1px #272939'
}

function myGaEngineRollOver(obj) {
    obj.style.backgroundColor = "#3366FF";
	obj.style.color = '#FFFFFF';
	obj.style.borderTop = "solid 1px #9999FF";
	obj.style.borderLeft = "solid 1px #9999FF";
	obj.style.borderRight = "solid 1px #000066";
	obj.style.borderBottom = "solid 1px #000066";
}

function myGaEngineRollOut(obj) {
    obj.style.backgroundColor = "#D4D3E3";
    obj.style.color = '#000000';
    obj.style.borderTop = "solid 2px #D4D3E3";
    obj.style.borderLeft = "solid 2px #D4D3E3";
    obj.style.borderRight = "solid 1px #575668";
	obj.style.borderBottom = "solid 1px #575668";
}

function myGaEngineRollDown(obj) {
    obj.style.backgroundColor = "#3366FF";
    obj.style.color = '#99CCFF';
    obj.style.borderTop = "solid 1px #000066";
    obj.style.borderLeft = "solid 1px #000066";
    obj.style.borderRight = "solid 1px #9999FF";
    obj.style.borderBottom = "solid 1px #9999FF";
}

function myGrEngineRollOver(obj){
	obj.style.backgroundColor = "#00CC00"
	obj.style.color = '#FFFFFF'
	obj.style.borderTop = 'solid 2px #99FF99'
	obj.style.borderLeft = 'solid 2px #99FF99'
	obj.style.borderRight = 'solid 1px #003300'
	obj.style.borderBottom = 'solid 1px #003300'
}

function myGrEngineRollOut(obj){
	obj.style.backgroundColor = "#00CC00"
	obj.style.color = '#003300'
	obj.style.borderTop = 'solid 2px #99FF99'
	obj.style.borderLeft = 'solid 2px #99FF99'
	obj.style.borderRight = 'solid 1px #003300'
	obj.style.borderBottom = 'solid 1px #003300'
}

function myGrEngineRollDown(obj){
	obj.style.backgroundColor = "#00CC00"
	obj.style.color = '#003300'
	obj.style.borderTop = 'solid 2px #003300'
	obj.style.borderLeft = 'solid 2px #003300'
	obj.style.borderRight = 'solid 1px #99FF99'
	obj.style.borderBottom = 'solid 1px #99FF99'
}

function myBlEngineRollOver(obj){
	obj.style.backgroundColor = "#3366FF"
	obj.style.color = '#FFFFFF'
	obj.style.borderTop = 'solid 1px #9999FF'
	obj.style.borderLeft = 'solid 1px #9999FF'
	obj.style.borderRight = 'solid 1px #000066'
	obj.style.borderBottom = 'solid 1px #000066'
}

function myBlEngineRollDown(obj){
	obj.style.backgroundColor = "#3366FF"
	obj.style.color = '#99CCFF'
	obj.style.borderTop = 'solid 1px #000066'
	obj.style.borderLeft = 'solid 1px #000066'
	obj.style.borderRight = 'solid 1px #9999FF'
	obj.style.borderBottom = 'solid 1px #9999FF'
}

function myBlEngineRollOut(obj){
	obj.style.backgroundColor = "#FFFFFF"
	obj.style.color = '#000000'
	obj.style.borderTop = 'solid 1px #FFFFFF'
	obj.style.borderLeft = 'solid 1px #FFFFFF'
	obj.style.borderRight = 'solid 1px #CCCCCC'
	obj.style.borderBottom = 'solid 1px #CCCCCC'
}

function myRedEngineRollOver(obj){
	obj.style.backgroundColor = "#FF0000"
	obj.style.color = '#FFFFFF'
	obj.style.borderTop = 'solid 1px #FF9999'
	obj.style.borderLeft = 'solid 1px #FF9999'
	obj.style.borderRight = 'solid 1px #660000'
	obj.style.borderBottom = 'solid 1px #660000'
}

function myRedEngineRollOut(obj){
	obj.style.backgroundColor = "#FF4646"
	obj.style.color = '#FFF17D'
	obj.style.borderTop = 'solid 1px #FF9999'
	obj.style.borderLeft = 'solid 1px #FF9999'
	obj.style.borderRight = 'solid 1px #660000'
	obj.style.borderBottom = 'solid 1px #660000'
}

function myRedEngineRollDown(obj){
	obj.style.backgroundColor = "#FF4646"
	obj.style.color = '#FFF17D'
	obj.style.borderTop = 'solid 1px #660000'
	obj.style.borderLeft = 'solid 1px #660000'
	obj.style.borderRight = 'solid 1px #FF9999'
	obj.style.borderBottom = 'solid 1px #FF9999'
}

function format(expr, decplaces){

	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces))
	while (str.length <= decplaces){
		str = "0" + str
	}
	var decpoint = str.length - decplaces
	return str.substring(0,decpoint) + "." + str.substring(decpoint,str.length)
}

function displayLink(url){
	if (url != "#"){
		if (url.indexOf("http") == -1){
			window.open("/Images/Links/" + url)
		}
		else{
			window.open(url)
		}
	}
}

function galleryImageUpdate(iRef, iName){
	imgRef = iRef
	$get("sImage").src = "/images/gallery/" + imgRef
	if (iName == "0"){
		iName = "&nbsp;"
		$get("sImage").alt = ""
	}
	else{
	    $get("sImage").alt = iName
	}
	document.getElementById('first2').innerHTML = iName
}

var fSize
fSize = 0

function updateFontSize(val) {
	if (val == '0'){
		if (fSize < 0){
			val = fSize * -1
		}
		else if (fSize > 0){
			val = 0 - fSize
		}
	}
	fSize = parseInt(fSize) + parseInt(val)
	var s = document.styleSheets[0].cssRules || document.styleSheets[0].rules;

	for(var i=0, n=s.length; i<n; i++) {
		var z = s[i].selectorText;
		if (s[i].style.cursor == ""){
			if (s[i].style.fontSize != ""){
				s[i].style.fontSize = (parseInt(s[i].style.fontSize) + parseInt(val)) + "pt"
			}
		}
	}
	getElementsByClassName(document,"td", val)
}

function getElementsByClassName(oElm, strTagName, val){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var oElement;
	for(var i=0; i<arrElements.length; i++){
		oElement = arrElements[i];
		arrReturnElements.push(oElement);
	}

	for(i=0;i<arrReturnElements.length;i++){
		if (arrReturnElements[i].style.cursor == ""){
			if (arrReturnElements[i].style.fontSize != ""){
				arrReturnElements[i].style.fontSize = (parseInt(arrReturnElements[i].style.fontSize) + parseInt(val)) + "pt"
			}
		}
	}

}

function showGalleryPage(catId){
	$get("galleryCategoryId").value = catId
	__doPostBack('galleryCategory', 'Gallery Category Change');
}

function scrollChange(){
	if (String(eval("document" + myAll + "overlay")) != "undefined"){
		if (eval("document" + myAll + "overlay" + myStyles + ".visibility") == "visible"){
			getPageSizeWithScroll()
		}
	}
}
function getPageSizeWithScroll(){

	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	}
	else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	}
	else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
	}
	eval("document" + myAll + "overlay" + myStyles + ".height='" + yWithScroll + "'")
	eval("document" + myAll + "overlay" + myStyles + ".width='" + xWithScroll + "'")

	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);

    	return arrayPageSizeWithScroll;
}
 
function showMenuLayer(mId){
	hideMenuLayers()
	if (document.getElementById("menuLyr" + mId) != null){
		eval("document" + myAll + "menuLyr" + mId + myStyles + ".visibility='visible'")
	}
}
 
function showSMenuLayer(mId){
	if (document.getElementById("menuLyr" + mId) != null){
		eval("document" + myAll + "menuLyr" + mId + myStyles + ".visibility='visible'")
	}
}
 
function hideMenuLayers(){
	var inputs = document.getElementsByTagName("div");
	for (var i=0; i < inputs.length; i++) {
		if (inputs[i].id.indexOf("menuLyr") != -1){
			eval("document" + myAll + inputs[i].id + myStyles + ".visibility='hidden'")
		}
	}
} 

function hideSubMenuLayers(){
	var inputs = document.getElementsByTagName("div");
	for (var i=0; i < inputs.length; i++) {
		if (inputs[i].id.indexOf("menuLyrs") != -1){
			eval("document" + myAll + inputs[i].id + myStyles + ".visibility='hidden'")
		}
	}
}

function doNothing(){
}

function showMgtPage(pageName) {
    closeHelp();
    document.location = "/Mgt/" + pageName;
}

function openHelp(refId) {
        if (refId == 3) {
            top.document.getElementById('mainFrame').cols = "*,250"
            top.help.document.location = "/mgt/help/useful-html.aspx";
        }
        else if (refId == 2) {
            top.document.getElementById('mainFrame').cols = "*,250"
            top.help.document.location = "/mgt/help/help-home.aspx";
        }
        else if (refId == 4) {
            openNewWindow(1000, 700, '/mgt/help/help-visual-layout.aspx', "Help", 0, 0, 1, 1, 0)
        }
        else {
            if (top.document.getElementById('mainFrame').cols == "*,0"){
        	top.document.getElementById('mainFrame').cols = "*,250"
                var helpPage = top.menu.document.location;
                helpPage = helpPage + "";
                if (helpPage.indexOf("mgt") != -1) {
                    helpPage = helpPage.replace(/mgt/, "help//help");
                }
                else {
                    helpPage = "/mgt/help/help-home.aspx";
                }
                top.help.document.location = helpPage;
            }
            else {
        	top.document.getElementById('mainFrame').cols = "*,0"
            }
        }
}

function closeHelp() {
    top.document.getElementById('mainFrame').cols = "*,0"
}

var lyrOpen
lyrOpen = ""

function showPage(mId, pId, exLink) {
    if (isNaN(exLink) == false) {
        if ($get("prodId") != null) {
            $get("prodId").value = "0";
        }
        $get("mwEvent").value = "";
        obj = document.form1
        if (exLink == "0") {
            obj.mId.value = mId
        }
        else {
            obj.mId.value = exLink
        }
        obj.pId.value = pId
        obj.action = "default.aspx"
        obj.submit();
    }
    else {
        window.open(exLink)
    }
}

function showLayer(mId) {
    hideLayers()
    if (document.getElementById("mLyr" + mId) != null) {
        if ($get("mLyr" + mId).style.zIndex == "2") {

            var pX = findPos($get("B" + mId))[0] - getDynamicButtonExtra(3,0);
            var pY = findPos($get("B" + mId))[1] + $get("B" + mId).offsetHeight + getDynamicButtonExtra(3,0);

            eval("document" + myAll + "mLyr" + mId + myStyles + ".left=" + pX + "")
            eval("document" + myAll + "mLyr" + mId + myStyles + ".top=" + pY + "")
            eval("document" + myAll + "mLyr" + mId + myStyles + ".visibility='visible'")
        }
        else {
            if (findPos($get("B" + mId))[0] > (document.body.offsetWidth / 2)) {
                //RIGHT SIDE MENU
                var pX = (findPos($get("B" + mId))[0] - $get("B" + mId).offsetWidth) - getDynamicButtonExtra(2,1);
                var pY = findPos($get("B" + mId))[1] - getDynamicButtonExtra(2,0);
            }
            else {
                //LEFT SIDE MENU
                var pX = findPos($get("B" + mId))[0] + ($get("B" + mId).offsetWidth + getDynamicButtonExtra(1,0));
                var pY = findPos($get("B" + mId))[1] - getDynamicButtonExtra(2,0);
            }
            eval("document" + myAll + "mLyr" + mId + myStyles + ".left=" + pX + "")
            eval("document" + myAll + "mLyr" + mId + myStyles + ".top=" + pY + "")
            eval("document" + myAll + "mLyr" + mId + myStyles + ".visibility='visible'")
            lyrOpen = "mLyr" + mId
        }
    }
}

function getDynamicButtonExtra(sideRef, doubleRef){
    var extraHeight = 0;
    for (var S = 0; S < document.styleSheets.length; S++) {

        if (document.styleSheets[S]['rules']) {
            cssRules = 'rules';
        } else if (document.styleSheets[S]['cssRules']) {
            cssRules = 'cssRules';
        } else {
            //no rules found... browser unknown
        }

        for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
            if (document.styleSheets[S][cssRules][R].selectorText == ".dy-table") {
                if (document.styleSheets[S][cssRules][R].style["border"]) {
                    sAry = document.styleSheets[S][cssRules][R].style["border"].split(' ');
                    	for (v=0;v<sAry.length;v++){
                    		if (sAry[v].indexOf('px') > -1){
		                    	if (doubleRef == 1) {
		                    		extraHeight = extraHeight + parseInt(sAry[v]) + parseInt(sAry[v]);
			                }
			                else{
		                    		extraHeight = extraHeight + parseInt(sAry[v]);
		                    	}
	                    	}
                    	}
                }
            }
            if (document.styleSheets[S][cssRules][R].selectorText == ".dy-back-table") {
                if (document.styleSheets[S][cssRules][R].style["border"]) {
                    sAry = document.styleSheets[S][cssRules][R].style["border"].split(' ');
                    	for (v=0;v<sAry.length;v++){
                    		if (sAry[v].indexOf('px') > -1){
		                    	if (sideRef == 1) {
		                    		extraHeight = extraHeight + parseInt(sAry[v]) + parseInt(sAry[v]);
			                }
			                else{
		                    		extraHeight = extraHeight + parseInt(sAry[v]);
		                    	}
		                }
		       }
                }
            }
            if (sideRef == 1) {
                //LEFT
                if (document.styleSheets[S][cssRules][R].selectorText == ".left-table") {
                    if (document.styleSheets[S][cssRules][R].style["border"]) {
                        sAry = document.styleSheets[S][cssRules][R].style["border"].split(' ');
                    	for (v=0;v<sAry.length;v++){
                    		if (sAry[v].indexOf('px') > -1){
                        		extraHeight = extraHeight + parseInt(sAry[v]);
                        	}
                        }
                    }
                }
            }
            else if (sideRef == 2) {
                //RIGHT
                if (document.styleSheets[S][cssRules][R].selectorText == ".right-table") {
                    if (document.styleSheets[S][cssRules][R].style["border"]) {
                        sAry = document.styleSheets[S][cssRules][R].style["border"].split(' ');
                    	for (v=0;v<sAry.length;v++){
                    		if (sAry[v].indexOf('px') > -1){
                        		extraHeight = extraHeight + parseInt(sAry[v]);
                        	}
                       }
                    }
                }
            }
            else if (sideRef == 3) {
                //RIGHT
                if (document.styleSheets[S][cssRules][R].selectorText == ".top-table") {
                    if (document.styleSheets[S][cssRules][R].style["border"]) {
                        sAry = document.styleSheets[S][cssRules][R].style["border"].split(' ');
                    	for (v=0;v<sAry.length;v++){
                    		if (sAry[v].indexOf('px') > -1){
                        		extraHeight = extraHeight + parseInt(sAry[v]);
                        	}
                        }
                    }
                }
            }
        }
    }
    return extraHeight;
}

function getMouseXY(e) {
    // Detect if the browser is IE or not.
    // If it is not IE, we assume that the browser is NS.
    var IE = document.all ? true : false

    // If NS -- that is, !IE -- then set up for mouse capture
    if (!IE) {
        document.captureEvents(Event.MOUSEMOVE)
    }
    if (IE) { // grab the x-y pos.s if browser is IE
        tempX = event.clientX + document.body.scrollLeft
        tempY = event.clientY + document.body.scrollTop
    } else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX
        tempY = e.pageY
    }
    
    // catch possible negative values in NS4
    if (tempX < 0) { tempX = 0 }
    if (tempY < 0) { tempY = 0 }

    return true
}

function showDyLayer(mId, pId) {
    lyrs = lyrOpen.split(";")
    if (document.getElementById("mLyr" + mId) != null) {
        //eval("document" + myAll + "mLyr" + mId + myStyles + ".visibility='visible'")
        if (lyrOpen == "") {
            lyrOpen = "mLyr" + mId
        }
        else {
            if (lyrs[lyrs.length - 1] != "mLyr" + mId) {
                lyrOpen = lyrOpen + ";mLyr" + mId
            }
        }

	var pX = findPos($get("B" + mId))[0] + ($get("B" + mId).offsetWidth + getDynamicButtonExtra(1,0));
	var pY = findPos($get("B" + mId))[1] - getDynamicButtonExtra(2,0);
	
	eval("document" + myAll + "mLyr" + mId + myStyles + ".left=" + pX + "")
	eval("document" + myAll + "mLyr" + mId + myStyles + ".top=" + pY + "")
	eval("document" + myAll + "mLyr" + mId + myStyles + ".visibility='visible'")
    }
    else {
        if (lyrs[lyrs.length - 1] != "mLyr" + pId) {
            if (document.getElementById(lyrs[lyrs.length - 1]) != null) {
                eval("document" + myAll + lyrs[lyrs.length - 1] + myStyles + ".visibility='hidden'")
                lyrOpen = ""
                for (i = 0; i < lyrs.length - 1; i++) {
                    if (lyrOpen == "") {
                        lyrOpen = lyrs[i]
                    }
                    else {
                        lyrOpen = lyrOpen + ";" + lyrs[i]
                    }
                }
                hideLayers()
                lyrs = lyrOpen.split(";")
                for (i = 0; i < lyrs.length; i++) {
                    eval("document" + myAll + lyrs[i] + myStyles + ".visibility='visible'")
                }
            }
        }
    }
}

function hideLayers() {
    var inputs = document.getElementsByTagName("div");
    for (var i = 0; i < inputs.length; i++) {
        if (inputs[i].id.indexOf("mLyr") != -1) {
            if (inputs[i].id != "first2") {
                eval("document" + myAll + inputs[i].id + myStyles + ".visibility='hidden'")
            }
        }
    }
}

function findPos(obj) {
    var curleft = curtop = 0;
    if (obj.offsetParent) {
        do {
            curleft += obj.offsetLeft;
            curtop += obj.offsetTop;
        } while (obj = obj.offsetParent);
    }
    return [curleft,curtop];
}


function goLinkCategories(mId) {
    __doPostBack('exchangeBack', 'Back to Link Exchange Page')
}

//------SEARCH ENGINE--------------------------------
function searchCount() {
    __doPostBack('maxResultsPage', 'Max Results Per Search Page')
}

function changePrevPage() {
    sPage = $get("pageCount").value
    sPage = parseInt(sPage) - 1
    $get("pageCount").value = sPage
    __doPostBack('goPreviousPage', 'Go Previous Page')
}

function changeNextPage() {
    sPage = $get("pageCount").value
    sPage = parseInt(sPage) + 1
    $get("pageCount").value = sPage
    __doPostBack('goNextPage', 'Go Next Page')
}

function goToPage() {
    obj = document.sRes
    if ($get("pSel").options[$get("pSel").selectedIndex].value != "0") {
        $get("pageCount").value = $get("pSel").options[$get("pSel").selectedIndex].value
        __doPostBack('jumpPage', 'Jump Page')
    }
}

function showMoreInfo(aId) {
    if ($get("searchLyr" + aId) != null) {
        if ($get("searchLyr" + aId).style.visibility == 'visible') {
            $get("searchLyr" + aId).style.display = 'none';
            $get("searchLyr" + aId).style.visibility = 'hidden';
        }
        else {
            $get("searchLyr" + aId).style.display = '';
            $get("searchLyr" + aId).style.visibility = 'visible';
        }
    }
    else {
        $get("ansId").value = aId
        __doPostBack('showSearchDetails', 'Show Search Details')
    }
}

function backToresults() {
    $get("ansId").value = "0"
    __doPostBack('backSearchResults', 'Back Search Results')
}
//---------------------------------------------------

function showLnkExchange(exCat) {
    $get("exCat").value = exCat;
    __doPostBack('exchangeCategory', 'Link Exchange Category')
}

function showReviewLayer(idRef) {
    if ($get("hiddenLyr" + idRef).style.visibility == 'visible') {
        $get("hiddenLyr" + idRef).style.display = 'none';
        $get("hiddenLyr" + idRef).style.visibility = 'hidden';
    }
    else {
        $get("hiddenLyr" + idRef).style.display = '';
        $get("hiddenLyr" + idRef).style.visibility = 'visible';
    }
}

function showLargeGalleryImage(pWidth, pHeight, pPercent) {
    if (pPercent != "0") {
        pWidth = (parseInt(pWidth) / 100) * parseInt(pPercent)
        pHeight = (parseInt(pHeight) / 100) * parseInt(pPercent)
        $get("lImages").width = parseInt(pWidth);
        $get("lImages").height = parseInt(pHeight);
        $get("largeImageClose").style.width = parseInt(pWidth);
    }
    getPageSizeWithScroll()
    $get("lImages").src = $get("sImage").src;
    eval("document" + myAll + "overlay" + myStyles + ".visibility='visible'")
    eval("document" + myAll + "iOverlay" + myStyles + ".visibility='visible'")
    document.location = "#top";
}

function hideLargeImage() {
    eval("document" + myAll + "overlay" + myStyles + ".height='100%'")
    eval("document" + myAll + "overlay" + myStyles + ".width='100%'")
    eval("document" + myAll + "overlay" + myStyles + ".visibility='hidden'")
    eval("document" + myAll + "iOverlay" + myStyles + ".visibility='hidden'")
}

function showPropertyDetails(propId) {
    if ($get("propLyr" + propId) != null) {
        if ($get("propLyr" + propId).style.visibility == 'visible') {
            $get("propLyr" + propId).style.display = 'none';
            $get("propLyr" + propId).style.visibility = 'hidden';
        }
        else {
            $get("propLyr" + propId).style.display = '';
            $get("propLyr" + propId).style.visibility = 'visible';
        }
    }
    else {
        $get("propertyId").value = propId;
        __doPostBack('viewPropertyDetails', 'View Property Details')
    }
}

function showFPropertyDetails(propId, pageId) {
    $get("mId").value = pageId;
    $get("propertyId").value = propId;
    __doPostBack('viewPropertyDetails', 'View Property Details')
}

function showLargePropertyImage(propId, pWidth, pHeight, pPercent) {
    if (pPercent != "0") {
        pWidth = (parseInt(pWidth) / 100) * parseInt(pPercent)
        pHeight = (parseInt(pHeight) / 100) * parseInt(pPercent)
        $get("lImages").width = parseInt(pWidth);
        $get("lImages").height = parseInt(pHeight);
        $get("largeImageClose").style.width = parseInt(pWidth);
    }
    else {
        $get("lImages").width = parseInt(pWidth);
        $get("lImages").height = parseInt(pHeight);
    }
    getPageSizeWithScroll()
    $get("lImages").src = $get("mainPropImage" + propId).src;
    eval("document" + myAll + "overlay" + myStyles + ".visibility='visible'")
    eval("document" + myAll + "iOverlay" + myStyles + ".visibility='visible'")
    document.location = "#top";
}


function upDatePropImage(iName, iId) {
    $get("mainPropImage" + iId).src = "/Images/Listings/" + iName;
}

function showMyOrders() {
    if ($get("orderEmail").value != "") {
        if (!checkEmail($get("orderEmail"))) {
            return;
        }
    }
    else {
        alert("E-mail Address may not be blank");
        $get("orderEmail").focus();
        $get("orderEmail").select();
        return;
    }
    if ($get("orderPhone").value == "") {
        alert("Phone Number may not be left blank.");
        return;
    }
    $get("mwEvent").value = "VIEWORDERS";
    __doPostBack('viewOrderHistory', 'Login to View Order History')
}

function showOrderHistoryInfo(idRef) {
    if ($get("orderInfo" + idRef).style.visibility == 'visible') {
        $get("orderInfo" + idRef).style.display = 'none';
        $get("orderInfo" + idRef).style.visibility = 'hidden';
    }
    else {
        $get("orderInfo" + idRef).style.display = '';
        $get("orderInfo" + idRef).style.visibility = 'visible';
    }
}
