﻿function open(name) {
    var id = new String(name);
    id = id.substr(1) - 1;
    var which = new Array();
    which[0] = "home.aspx";
    which[1] = "overview-specifications.aspx";
    which[2] = "inventory-media-manager.aspx";
    which[3] = "iphone-integration.aspx";
    which[4] = "workbench-f-and-i.aspx";
    which[5] = "sales-history-crm.aspx";
    which[6] = "commissions-charge-backs.aspx";
    which[7] = "ar-bhph.aspx";
    which[8] = "payables-check-writing.aspx";
    which[9] = "cash-receipts.aspx";
    which[10] = "general-ledger.aspx";
    which[11] = "service-department.aspx";
    which[12] = "parts-department-pos.aspx";
    which[13] = "employees-security.aspx";
    which[14] = "third-party-integrators.aspx";
    which[15] = "bureaus-reporting.aspx";
    which[16] = "kelleys-nada-values.aspx";
    which[17] = "Downloads.aspx";
    which[18] = "SignUp.aspx";
    which[19] = "contact.aspx";

    var win = getWindow();
    win.setUrl(which[id] + "?m=t");
    win.show();        
}

function insertAccordion() {
    document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" id=\"accordion\" width=\"996\" height=\"316\">");
    document.write("<param name=\"movie\" value=\"Flash/accordion.swf\">");
    document.write("<param name=\"bgcolor\" value=\"#131313\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<param name=\"seamlesstabbing\" value=\"false\">");
    document.write("<param name=\"allowscriptaccess\" value=\"samedomain\">");
    document.write("<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"");
    document.write("name=\"accordion\" width=\"996\" height=\"316\" src=\"Flash/accordion.swf\" bgcolor=\"#131313\"");
    document.write("quality=\"high\" wmode=\"transparent\" seamlesstabbing=\"false\" allowscriptaccess=\"samedomain\">");
    document.write("<noembed>");
    document.write("</noembed>");
    document.write("</embed>");
    document.write("</object>");
}
function insertPhone() {
    document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\"");
    document.write("id=\"iphone\" width=\"394\" height=\"492\">");
    document.write("<param name=\"movie\" value=\"Flash/iphone.swf\">");
    document.write("<param name=\"bgcolor\" value=\"#000000\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<param name=\"seamlesstabbing\" value=\"false\">");
    document.write("<param name=\"allowscriptaccess\" value=\"samedomain\">");
    document.write("<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"");
    document.write("name=\"iphone\" width=\"394\" height=\"492\" src=\"Flash/iphone.swf\" bgcolor=\"#000000\"");
    document.write("quality=\"high\" wmode=\"transparent\" seamlesstabbing=\"false\" allowscriptaccess=\"samedomain\">");
    document.write("<noembed>");
    document.write("</noembed>");
    document.write("</embed>");
    document.write("</object>");
}
function insertDownloads() {
    document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\"");
    document.write("id=\"downloads\" width=\"971\" height=\"613\">");
    document.write("<param name=\"movie\" value=\"Flash/Downloads.swf\">");
    document.write("<param name=\"bgcolor\" value=\"#000000\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<param name=\"seamlesstabbing\" value=\"false\">");
    document.write("<param name=\"allowscriptaccess\" value=\"samedomain\">");
    document.write("<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"");
    document.write("name=\"downloads\" width=\"971\" height=\"613\" src=\"Flash/Downloads.swf\" bgcolor=\"#000000\"");
    document.write("quality=\"high\" wmode=\"transparent\" seamlesstabbing=\"false\" allowscriptaccess=\"samedomain\">");
    document.write("<noembed>");
    document.write("</noembed>");
    document.write("</embed>");
    document.write("</object>");
}
function insertMoney() {
    //style=\"width:100%;height:100%;position:absolute;\"
    document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\"");
    document.write("id=\"money\" width=\"100%\" height=\"100%\" style=\"left:0;top:0;right:0;bottom:0;\">");
    document.write("<param name=\"movie\" value=\"../Flash/money.swf\">");
    document.write("<param name=\"bgcolor\" value=\"#000000\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<param name=\"seamlesstabbing\" value=\"false\">");
    document.write("<param name=\"allowscriptaccess\" value=\"samedomain\">");
    document.write("<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"");
    document.write("name=\"money\" width=\"100%\" height=\"100%\" src=\"../Flash/money.swf\" bgcolor=\"#000000\"");
    document.write("quality=\"high\" wmode=\"transparent\" seamlesstabbing=\"false\" allowscriptaccess=\"samedomain\">");
    document.write("<noembed>");
    document.write("</noembed>");
    document.write("</embed>");
    document.write("</object>");

    var h, w;

    h = getScreenDimensions().h;
    w = getScreenDimensions().w;

    var o = document.getElementById("money");
    o.style.width = w + "px";
    o.style.height = h + "px";
}
function insertContact() {
    document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\"");
    document.write("id=\"downloads\" width=\"971\" height=\"613\">");
    document.write("<param name=\"movie\" value=\"Flash/Contact.swf\">");
    document.write("<param name=\"bgcolor\" value=\"#000000\">");
    document.write("<param name=\"quality\" value=\"high\">");
    document.write("<param name=\"wmode\" value=\"transparent\">");
    document.write("<param name=\"seamlesstabbing\" value=\"false\">");
    document.write("<param name=\"allowscriptaccess\" value=\"samedomain\">");
    document.write("<embed type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"");
    document.write("name=\"downloads\" width=\"971\" height=\"613\" src=\"Flash/Contact.swf\" bgcolor=\"#000000\"");
    document.write("quality=\"high\" wmode=\"transparent\" seamlesstabbing=\"false\" allowscriptaccess=\"samedomain\">");
    document.write("<noembed>");
    document.write("</noembed>");
    document.write("</embed>");
    document.write("</object>");
}
function insertDemoVideos(w, d) {
    var vid = "";
    vid += "<OBJECT ID=\"MediaPlayer\" WIDTH=\"500\" HEIGHT=\"500\" CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\"";
    vid += "STANDBY=\"Loading Windows Media Player components...\" TYPE=\"application/x-oleobject\">";
    vid += "<PARAM NAME=\"FileName\" VALUE=\""+ w +"\">";
    vid += "<PARAM name=\"autostart\" VALUE=\"false\">";
    vid += "<PARAM name=\"ShowControls\" VALUE=\"true\">";
    vid += "<param name=\"ShowStatusBar\" value=\"true\">";
    vid += "<PARAM name=\"ShowDisplay\" VALUE=\"true\">";
    vid += "<EMBED TYPE=\"application/x-mplayer2\" SRC=\"" + w + "\" NAME=\"MediaPlayer\"";
    vid += "WIDTH=\"500\" HEIGHT=\"500\" ShowControls=\"1\" ShowStatusBar=\"1\" ShowDisplay=\"1\" autostart=\"1\"> </EMBED>";
    vid += "</OBJECT>";

    try {
        if (!d.innerHTML)
            d = document.getElementById(d);
    }
    catch (e) {
        d = document.getElementById(d);
    }
    finally {
        d.innerHTML = vid;
    }
}
function toggleMoney(w, p) {
    var m = document.getElementById("moneyAd");
    var d = document.getElementById("demo");

    var mSetting;
    var dSetting;

    switch (w) {
        case 0:
            mSetting = "";
            dSetting = "none";
            break;
        case 1:
            mSetting = "none";
            dSetting = "";
            break;
    }

    m.style.display = mSetting;
    insertDemoVideos(p, "demo_vid");
    d.style.display = dSetting;
}
function betaMessage() {
    alert("There are no more available beta accounts at this time.");
}
function getScreenDimensions() {
    if (typeof (window.innerWidth) == 'number') {
        //Non-IE
        width = window.innerWidth;
        height = window.innerHeight;
    } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
        //IE 6+ in 'standards compliant mode'
        width = document.documentElement.clientWidth;
        height = document.documentElement.clientHeight;
    } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
        //IE 4 compatible
        width = document.body.clientWidth;
        height = document.body.clientHeight;
    }

    return { w: width, h: height };
}