// JavaScript Document

function alphaFixIE() {
var s, i, j;
// CSS: background 
for (i=0; i<document.styleSheets.length; i++) { 
	var pos = document.styleSheets[i].href.lastIndexOf("/"); 
	var cssDir = (pos != -1) ? document.styleSheets[i].href.substring(0, pos + 1) : "";
	for (j=0; j<document.styleSheets[i].rules.length; j++) { 
		var style = document.styleSheets[i].rules[j].style;
		var filename = style.backgroundImage.substring(4, style.backgroundImage.length - 1);
		if (style.backgroundImage.toLowerCase().indexOf(".png") != -1) {
			if (filename.indexOf("http://") != 0 && filename.indexOf("/") != 0) filename = cssDir + filename;
			style.backgroundImage = "none";
			style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + filename + "', sizingMethod='crop');";
		}
	}
}
// IMG
var els = document.getElementsByTagName("IMG"); for (i=0; i<els.length; i++) {
	s = els[i].src;
	if (s.toLowerCase().indexOf(".png") != -1) {
		els[i].src = "site_images/spacer.gif";
		els[i].width=1;
		els[i].height=1;
		els[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + s + "', sizingMethod='image');";
	}
}
}

if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("MSIE 7.0") == -1 && (navigator.userAgent.indexOf("MSIE 6.0") != -1 || navigator.userAgent.indexOf("MSIE 5.5") != -1) && navigator.userAgent.indexOf("Windows") != -1) {
	window.attachEvent("onload", alphaFixIE);
}

function getWindowWidth() {
	var width;
	if (navigator.userAgent.indexOf("MSIE") != -1) width=document.body.clientWidth || document.documentElement.clientWidth;
	else width=window.innerWidth;
	if (width<1000) width=1000;
	return width;
}

function getWindowHeight() {
	var height;
	if (navigator.userAgent.indexOf("MSIE") != -1) height=document.body.clientHeight || document.documentElement.clientHeight;
	else height=window.innerHeight;
	if (height<700) height=700;
	return height;
}

function init() {

}

var timer=new Array(0,0,0,0,0,0);

function select(bt) {
	var frame=document.getElementById("bt_menu_frame_"+bt);
	var left=frame.style.left.substr(0,frame.style.left.indexOf("p"));
	var width=frame.width;
	clearTimeout(timer[bt]);
	timer[bt]=0;
	left++;
	if (left%2==0) width--;
	if (left<15) {
		frame.style.left=left+"px";
		frame.width=width;
		frame.height="24";
		timer[bt]=setTimeout("select('"+bt+"')",5);
	}
	else {
		frame.src="site_images/button_frame_hl.png";
		frame.style.left="0px";
		frame.width="156";
		frame.height="24";
	}
}

function deselect(bt) {
	var frame=document.getElementById("bt_menu_frame_"+bt);
	var left=frame.style.left.substr(0,frame.style.left.indexOf("p"));
	var width=frame.width;
	clearTimeout(timer[bt]);
	timer[bt]=0;
	if (width==156) {
		frame.src="site_images/button_frame.png";
		frame.style.left="16px";
		frame.width="148";
		frame.height="24";
		timer[bt]=setTimeout("deselect('"+bt+"')",25);
	}
	left--;
	if (left%2==0) width++;
	if (left>0) {
		frame.style.left=left+"px";
		frame.width=width;
		frame.height="24";
		timer[bt]=setTimeout("deselect('"+bt+"')",25);
	}
}


