/****************************************************************
 *                                                              *
 * Moc 10 Media                                                 *
 * A Division of The Working Man Group, L.L.C.                  *
 * http://www.moc10media.com/                                   *
 *                                                              *
 * Script Name: scripts.js                                      *
 * Script Version: 1.0                                          *
 * Script Info: Basic Config/Load Scripts                       *
 *                                                              *
 ****************************************************************/

// Function to preload images.

function preLoad() {
    collectionsoff = new Image();
    collectionsoff.src = "/img/nav/collections_off.gif";
	sizeoff = new Image();
    sizeoff.src = "/img/nav/size_off.gif";
    storelocatoroff = new Image();
    storelocatoroff.src = "/img/nav/store_locator_off.gif";
    contactoff = new Image();
    contactoff.src = "/img/nav/contact_off.gif";
    homeoff = new Image();
    homeoff.src = "/img/nav/home_off.gif";
	
    collectionon = new Image();
    collectionon.src = "/img/nav/collections_on.gif";
	sizeon = new Image();
    sizeon.src = "/img/nav/size_on.gif";
    storelocatoron = new Image();
    storelocatoron.src = "/img/nav/store_locator_on.gif";
    contacton = new Image();
    contacton.src = "/img/nav/contact_on.gif";
    homeon = new Image();
    homeon.src = "/img/nav/home_on.gif";
}


// Function to create dynamic pop up window, currently set to center window on screen.

function newWindow(url, name, wid, hgt, scr, res, stat, loc, mnu, tool, x, y) {
    if (screen) {
        widthOfScreen = screen.width;
        heightOfScreen = screen.height;
    }
    midX = widthOfScreen / 2;
    midY = heightOfScreen / 2;
    midWid = wid / 2;
    midHgt = hgt / 2;
    x = midX - midWid;
    y = midY - midHgt;
    windowOpts = "width=" + wid + ",height=" + hgt + ",scrollbars=" + scr + ",resizable=" + res + ",status=" + stat + ",location=" + loc + ",menubar=" + mnu + ",toolbar=" + tool + ",left=" + x + ",top=" + y;
    popUpWindow = window.open(url, name, windowOpts);
}

// Function to dynamically write out the flash code to work around the IE flash "white box" issue.

function flashBanner(name, width, height) {
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + name + '" align="middle">');
    document.write('    <param name="allowScriptAccess" value="sameDomain" />');
    document.write('    <param name="movie" value="/swf/' + name + '.swf" />');
    document.write('    <param name="quality" value="high" />');
	document.write('    <param name="wmode" value="transparent" />');
    document.write('    <param name="bgcolor" value="#ffffff" />');
    document.write('    <embed src="/swf/' + name + '.swf" quality="high" wmode="transparent" bgcolor="#000000" width="' + width + '" height="' + height + '" name="' + name + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('    </embed>');
    document.write('</object>');
}
