﻿// JScript File
function printThisPage(){ 
    var oldText = document.getElementById("printContent").innerHTML;
    var newText = oldText.replace('var so = new SWFObject("/flash/usmap.swf", "stateMap", "100%", "100%", "8", "#FFF");', '');
    
    newText = newText.replace('so.write("flashMap")', '');
    
    var printPage = '<html xmlns="http://www.w3.org/1999/xhtml">\n<head>\n<title>Williams &#38; Williams - Real Estate Auctions</title>\n';
        printPage += '<script type="text/javascript" src="/js/ebubble.js"></script>\n';
        printPage += '<link type="text/css" rel="stylesheet" href="/css/styles_print.css" />\n';
        printPage += '<style type="text/css">\n';
        printPage += '*{margin: 0px;font-size: 11px;}\n';
        printPage += 'body{background:#FFF url(\'/images/bkgd_top.jpg\') repeat-x left top;}\n';
        printPage += 'img{border: 0px;}\n';
        printPage += '#printPage{visibility: hidden; height: 0px;}\n';
        printPage += '#printMe{float: right; margin-right: 0px; margin-bottom: 0px;}\n';
        printPage += '.theTbl{margin: 15px; padding-top: 0px;font-face: tahoma;}\n';
        printPage += '.theTbl td{vertical-align: top;}\n';        
        printPage += '#GoogleFlash{visibility: hidden; height: 0px;}\n';
        printPage += '#map{visibility: hidden; height: 0px; width: 0px;}\n';        
        printPage += 'a, a:hover, a:active, a:visited{color:#FB9605; text-decoration: none;}\n';
        printPage += '#header{margin-bottom: 0px;font-size:14pt;font-weight:bold;color:#000000;}\n';
        printPage += '</style>\n';
        printPage += '</head>\n<body onload=\"window.print();\">\n';
        printPage += '<div id="header">\n<img src="/images/printMeBanner.png" alt="Williams & Williams Auction" />\n</div>\n';
        printPage += '<table class="theTbl">\n<tr>\n<td>\n'
        printPage += newText;
        printPage += '\n</div>\n</td>\n</tr>\n</table>\n';
        printPage += '</body>\n</html>';
    
    var winFeatures = "toolbar=yes,location=no,directories=no,menubar=no,scrollbars=yes,width=650,height=600,left=100,top=25"; 
    var win = window.open("","",winFeatures); 
    win.document.open(); 
    win.document.write(printPage); 
    
    win.document.close(); 
    win.focus(); 
}    

function goThere(loc)
{
    window.location.href=loc;
}

function isNumberKey(evt)
{
 var charCode = (evt.which) ? evt.which : event.keyCode
 if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;

 return true;
}

function toggleSection(section, link)
{
    control=document.getElementById(section);
    if (control.className=='collapsedsection') {
        control.className='expandedsection';
        link.innerHTML=link.innerHTML.replace('Show', 'Hide');
    } else {
        control.className='collapsedsection';
        link.innerHTML=link.innerHTML.replace('Hide', 'Show');
    }
}

function popSalesSiteInfo(SaleSiteID)
{
    window.open('saleSite.aspx?SaleSiteID=' + SaleSiteID,'SaleSiteInfo','width=600,height=625,scrollbars=1');
}  

function showFinancingInfo()
{
    window.open('/popup/financing.aspx','Financing','width=600,height=520');
}  

function readMore(section, link)
{
    control=document.getElementById(section);
    
    if (control.className == 'collapsedsection')
    {
        control.className = 'expandedsection';
        link.innerHTML=link.innerHTML.replace('Read More', 'Collapse');
    }
    else
    {
        control.className='collapsedsection';
        link.innerHTML=link.innerHTML.replace('Collapse', 'Read More');
    }
}