﻿var imgNormal = new Array();
var imgOver = new Array();
var bLoaded = false;
var path = "../";

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/readfull.png";
        imgOver[0] = new Image();
        imgOver[0].src = "../images/readfull_over.png";

        imgNormal[1] = new Image();
        imgNormal[1].src = "~/images/goback.png";
        imgOver[1] = new Image();
        imgOver[1].src = "~/images/goback_over.png";

        imgNormal[2] = new Image();
        imgNormal[2].src = "../images/login_normal.png";
        imgOver[2] = new Image();
        imgOver[2].src = "../images/login_over.png";
        
        
        imgNormal[3] = new Image();
        imgNormal[3].src = "../images/logout_normal.png";
        imgOver[3] = new Image();
        imgOver[3].src = "../images/logout_over.png";
        
        bLoaded = "true"; // OK, our image is loaded
    }
}

function OnOver(picture, index) {
    if (document.images && bLoaded == "true") {
       // picture.src = path;
        picture.src = imgOver[index].src;
       // alert(picture.src);
        return (true);
    } else
        return (false);
}

function OnOut(picture, index) {
    if (document.images && bLoaded == "true") {
        //picture.src = path;
        picture.src = imgNormal[index].src;
    }
}

function reload() {
    document.getElementById("captcha").src = 'captcha.aspx?refresh=t' + Date();
}

