﻿// JScript File

function DoFade(colorId, targetId) {
var FadeInterval = 60;
var FadeSteps = new Array();
	FadeSteps[1] = "#786F5E"
	FadeSteps[2] = "#A7823E";
	FadeSteps[3] = "#C18C2B";
	FadeSteps[4] = "#DA9619";
	FadeSteps[5] = "#F09F0A";
    if (colorId >= 1) {
		document.getElementById(targetId).style.backgroundColor = FadeSteps[colorId];
        if (colorId==1) {
            document.getElementById(targetId).style.backgroundColor = "transparent";
		}
        colorId--;
        setTimeout("DoFade("+colorId+",'"+targetId+"')", FadeInterval);
	}
}

var screenW = 1024, screenH = 768;
if (parseInt(navigator.appVersion)>3) {
 screenW = screen.width;
 screenH = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 screenW = jScreenSize.width;
 screenH = jScreenSize.height;
}

function getphotoBoxobj(){
    if (document.getElementById)
    return document.getElementById("photoBox").style
    else if (document.all)
    return document.all.photoBox.style
}

function getphotoBoxObjstyle(){
    if (document.getElementById)
    return document.getElementById("photoBox")
    else if (document.all)
    return document.all.photoBox
}

function closePicbox() {

	getphotoBoxobj().left="-1000px";
	getphotoBoxObjstyle().visibility="hidden";
}

function openPictureBox(img) {
     
    loadImage('IMAGES/GENERIC/spacerBar.gif');
    loadImage(img);
    
    var offset = 0;
    
    if (document.documentElement.scrollTop != undefined) {
        offset = document.documentElement.scrollTop;
    }
    
    var topLoc = offset;
    
    if (topLoc <0) {
        topLoc = 0;
    }
    
    topLoc = (screenH - 630) / 2
    
    if (topLoc > 50) {
    
        topLoc = topLoc - 50;
    
    }
    
    //alert(offset);
        
    getphotoBoxobj().top=offset + topLoc + 'px';
	getphotoBoxobj().left=(screenW - 810) / 2 + 'px';
	getphotoBoxObjstyle().visibility="visible";
}

function loadImage(img) {

    document.getElementById("pbImg").style.visibility="hidden";

    if (document.getElementById) {
        document.getElementById("pbImg").src = img;
        } else if (document.all) {
        document.all.pbImg.src = img;
    }
    
    document.getElementById("pbImg").style.visibility="visible";
}

function getphotoObj(){
    if (document.getElementById)
    return document.getElementById("Panel2")
    else if (document.all)
    return document.all.Panel2
}

function openPictureModal(img) {

    if (document.getElementById) {
        //document.getElementById("bandImg").style.visibility="hidden";
        document.getElementById("bandImg").src = img;
    } else if (document.all) {
        //document.all.bandImg.style.visibility="hidden";
        document.all.bandImg.src = img;
    }
}

function imgSizeChange() {

    if (document.getElementById) {
        document.getElementById("bandImg").style.top = ((600-document.getElementById("bandImg").height)/2) + "px";
        document.getElementById("bandImg").style.visibility="visible"; 
    } else if (document.all) {
        document.all.bandImg.style.top = ((600-document.all.bandImg.height)/2) + "px";
        document.all.bandImg.style.visibility="visible"; 
    }
}

function showCloseImage() {

    document.getElementById("bandImg").src = "IMAGES/GENERIC/spacerBar.gif";

}