/*
'=====================================================
' Project:      Mainstreet ECommerce SampleWebsite
' Programmer:   Derek Souers
' File:         scripts.js
' Description:
' Created:      11/12/08
' Last Updated: 02/19/09
'=====================================================
*/
var collapsePrevious = "yes";

function PrintThisDiv(print_area,pageTitle)
{
    var pp = window.open();
    pp.document.writeln('<html><head><title>' + pageTitle + ': Print Preview</title>');
    pp.document.writeln('<base target="_self">');
    pp.document.writeln('<link media="print" href="print.css" type="text/css" rel="stylesheet" />');
    pp.document.writeln('</head>');
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
    pp.document.writeln('<form method="post">');
    pp.document.writeln('<table width=100%><tr><td></td></tr><tr><td align=right>');
    pp.document.writeln('<input id="PRINT" type="button" value="Print" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
    pp.document.writeln('<input id="CLOSE" type="button" value="Close" class="NoPrint" onclick="window.close();">');
    pp.document.writeln('</td></tr><tr><td></td></tr></table>');
    pp.document.writeln('<div align="center">');
    pp.document.writeln(document.getElementById(print_area).innerHTML);
    pp.document.writeln('</div>');
    pp.document.writeln('</form>');
    pp.document.writeln('<script type="text/javascript">');
    pp.document.writeln('<!--');
    pp.document.writeln('window.print();');
    pp.document.writeln('-->');
    pp.document.writeln('</script>');
    pp.document.writeln('</body></html>');
}


function HideShowContent(obj)
{
    document.getElementById(obj).style.display = (document.getElementById(obj).style.display != "block") ? "block" : "none";
}


function ContractContent(omit)
{
    var inc = 0;
    while (ccollect[inc])
    {
        if (ccollect[inc].id != omit)
            ccollect[inc].style.display = "none";
        inc++;
    }
}


function ExpandContent(cid)
{
    if (typeof ccollect != "undefined")
    {
        if (collapsePrevious == "yes")
            ContractContent(cid);
        document.getElementById(cid).style.display = (document.getElementById(cid).style.display != "block") ? "block" : "none";
    }
}


function CopyToClipboard(obj)
{
    document.forms[0].item(obj).focus();
    document.forms[0].item(obj).select();
    CopiedTxt = document.selection.createRange();
    CopiedTxt.execCommand("Copy");
}


function PopUp(pageUrl)
{
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(pageUrl, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=595,height=600,left = 300,top = 0');");
}
