isIE6 = (navigator.appVersion.indexOf("MSIE") > -1 && !window.XMLHttpRequest);

function changeImage(img_name,img_src) {
document[img_name].src=img_src;
}

function ChangeStyle(eid)
{
	document.cat3.all.style.fontSize = "14pt";
  //document.getElementById(eid).style.fontSize = "14pt";
  document.getElementById(eid).style.fontWeight = "bold";
  //document.getElementById("MyTag").style.color = "red";
}

var fade_dir = "";
var fade_callback = null;
function call_fade_callback() {
	if (fade_callback) {
		fade_callback();
		fade_callback = null;
	}
	fade_dir = "";
}
function fade(id, inout, millisec, callback) {
    //speed for each frame
	var speed = Math.round(millisec / 100);
    var timer = 0;
	if (callback) {fade_callback = callback;}
	//if (fade_dir == "") {
		fade_dir = inout;
		//determine the direction for the blending, if start and end are the same nothing happens
		if (inout == "in") {
			for(i = 0; i <= 100; i++) {
				setTimeout("changeOpac(" + i + ",'" + id + "'" + ((i==100)?", true":"")+")",(timer * speed));
				timer++;
			}
		} else {
			for(i = 100; i >= 0; i--) {
				setTimeout("changeOpac(" + i + ",'" + id + "'" + ((i==0)?", true":"")+")",(timer * speed));
				timer++;
			}
		}
	//} else {
		//setTimeout("fade('"+id+"', '"+inout+"', "+millisec+")", 100);
	//}
}

function opacity() {
    //speed for each frame
    var millisec=7000;
	var speed = Math.round(millisec / 100);
    var timer = 0;
	var id='fadeImg';
    //determine the direction for the blending, if start and end are the same nothing happens
        for(i = 100; i >= 0; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
}

//change the opacity for different browsers
function changeOpac(opacity, id, callback) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
	if (callback) {
		call_fade_callback();
	}
}

//fix site top margin:
function fixTopMargin(id) {
	var h = screen.height;
	var w = document.getElementById(id);
	if (w) {
		if (h > 768 && h < 900) {
			w.style.marginTop = "0px";
		} else if (h >900 && h < 1000) {
			w.style.marginTop = "50px";
		} else if (h >= 1024) {
			w.style.marginTop = "90px";
		}
	}
}
try {  document.execCommand('BackgroundImageCache', false, true);} catch(e) {}

