// Preload main nav images.

if (document.images) {
    commfocusoff = new Image();
    commfocusoff.src = "/img/nav/commfocus_off.gif";
    speccentersoff = new Image();
    speccentersoff.src = "/img/nav/speccenters_off.gif";
    physiciansoff = new Image();
    physiciansoff.src = "/img/nav/physicians_off.gif";
    servicesoff = new Image();
    servicesoff.src = "/img/nav/services_off.gif";
    careersoff = new Image();
    careersoff.src = "/img/nav/careers_off.gif";
    educationoff = new Image();
    educationoff.src = "/img/nav/education_off.gif";
    aboutusoff = new Image();
    aboutusoff.src = "/img/nav/aboutus_off.gif";

    commfocusover = new Image();
    commfocusover.src = "/img/nav/commfocus_over.gif";
    speccentersover = new Image();
    speccentersover.src = "/img/nav/speccenters_over.gif";
    physiciansover = new Image();
    physiciansover.src = "/img/nav/physicians_over.gif";
    servicesover = new Image();
    servicesover.src = "/img/nav/services_over.gif";
    careersover = new Image();
    careersover.src = "/img/nav/careers_over.gif";
    educationover = new Image();
    educationover.src = "/img/nav/education_over.gif";
    aboutusover = new Image();
    aboutusover.src = "/img/nav/aboutus_over.gif";

    commfocuson = new Image();
    commfocuson.src = "/img/nav/commfocus_on.gif";
    speccenterson = new Image();
    speccenterson.src = "/img/nav/speccenters_on.gif";
    physicianson = new Image();
    physicianson.src = "/img/nav/physicians_on.gif";
    serviceson = new Image();
    serviceson.src = "/img/nav/services_on.gif";
    careerson = new Image();
    careerson.src = "/img/nav/careers_on.gif";
    educationon = new Image();
    educationon.src = "/img/nav/education_on.gif";
    aboutuson = new Image();
    aboutuson.src = "/img/nav/aboutus_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://fpdownload.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="#000000" />');
    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('</object>');
}