﻿var dontCrossFade;
function openingScreen_click(openingScreen) {
    openingScreen.style.display = "none";
    dontCrossFade = true;
}

var opacity = 0;
var timeout = 50;
var step = 5;
function crossFade() {
    if (dontCrossFade) return;
    
    var f2 = document.getElementById("ctl00_openingScreen");
    var f1 = document.getElementById("ctl00_panelContent");

	//internet explorer
	f1.style.filter = "alpha(opacity=" + opacity + ")"; 
	f2.style.filter = "alpha(opacity=" + ((opacity - 100) * -1) + ")";

	//firefox
	f1.style.opacity = opacity / 100;
	f2.style.opacity = (opacity - 100) * -1 / 100;

	opacity += step;

	if (opacity <= 100) {
		setTimeout("crossFade()", timeout);
	} else {
	    openingScreen_click(f2);
	}
}

var currentButtonId = null;
var strong = false;
function button_mouseover(button) {
    if ((button.id != "btnClients") && (button.id != "btnPhotos")) {
        if (!strong) {
            button.style.backgroundPosition = "top right";
            setTimeout("button_overstate2('" + button.id + "')", 350);
        }
        currentButtonId = button.id;
    }
}

function button_mouseout(button) {
    if ((button.id != "btnClients") && (button.id != "btnPhotos")) {
        strong = false;
        currentButtonId = null;
        button.style.backgroundPosition = "top left";
    }
}

function button_overstate2(buttonId) {
    if (buttonId = currentButtonId) {
        var button = document.getElementById(buttonId);
        button.style.backgroundPosition = "bottom right";
        button.style.cursor = "pointer";
    }
}
