/*
Programming by Thomas Mack, thomasmack@gmail.com
Created for Pandemonium Charters
Updated: March 15th, 2008
Description: This is a basic menu highlight script. 
It basically preloads images so when a user hovers
over the menu item they won't see a small loading
image first. 

*/

var imgNormal = new Array();
var imgOver = new Array();
var bLoaded = false;

Preload();

function ChangeImg(picture, source) {
    picture.src = source;
}

function Preload() {
    if (document.images) { // Do we support this object?
        imgNormal[0] = new Image();
        imgNormal[0].src = "images/home_normal.png";
        imgOver[0] = new Image();
        imgOver[0].src = "images/home_over.png";

        imgNormal[1] = new Image();
        imgNormal[1].src = "images/pricing_normal.png";
        imgOver[1] = new Image();
        imgOver[1].src = "images/pricing_over.png";

        imgNormal[2] = new Image();
        imgNormal[2].src = "images/photos_normal.png";
        imgOver[2] = new Image();
        imgOver[2].src = "images/photos_over.png";

        imgNormal[3] = new Image();
        imgNormal[3].src = "images/contact_normal.png";
        imgOver[3] = new Image();
        imgOver[3].src = "images/contact_over.png";

        imgNormal[4] = new Image();
        imgNormal[4].src = "images/links_normal.png";
        imgOver[4] = new Image();
        imgOver[4].src = "images/links_over.png";

        bLoaded = "true"; // OK, our image is loaded
    }
}

function OnOver(picture, index) {
    if (document.images && bLoaded == "true") {
        picture.src = imgOver[index].src;
        return (true);
    }
}

function OnOut(picture, index) {
    if (document.images && bLoaded == "true") {
        picture.src = imgNormal[index].src;
    }
}

function reload() {
    document.getElementById("captcha").src = 'captcha.aspx?refresh=t' + Date();
}

function popUp(URL) {
    var bName = navigator.appName;
    var wHeight = 380;
    var wWidth = 570;

    if (bName == "Microsoft Internet Explorer") {
        wHeight = 400;
        wWidth = 600;
    }

    window.open(URL, 'viewimage', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=1,width='+wWidth+',height='+ wHeight);
}