function fixPNG(element) {
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) {
		var src;
		if (element.tagName=='IMG') {
			if (/\.png$/.test(element.src)) {
				src = element.src;
				element.src = basedir+"_images/ico/blank.gif";
			}
		} else {
			src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i);
			if (src) {
				src = src[1];
				element.runtimeStyle.backgroundImage="none";
			}
		}
		if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
	}
}


menu = function() {
	var arr = document.getElementById("menu").getElementsByTagName("TD");
	var len=arr.length;

	for (var i=0, len; i<len; i++) {
		switch (i) {
			case 0 :
				if (arr[i].className.indexOf("active")!=-1) arr[i].className=arr[i].className.replace("active", "active-first");
				else {
					arr[i].className+=" first";
					arr[i].onmousedown=function() {this.className+=" active-first go1px";}
					arr[i].onmouseup=function() {this.className=this.className.replace("active-first go1px", "");}
					arr[i].onmouseout=function() {this.className=this.className.replace("active-first go1px", "");}
				}
			break;
			case len-1 :
				if (arr[i].className.indexOf("active")!=-1) arr[i].className=arr[i].className.replace("active", "active-last");
				else {
					arr[i].className+=" last";
					arr[i].onmousedown=function() {this.className+=" active-last go1px";}
					arr[i].onmouseup=function() {this.className=this.className.replace("active-last go1px", "");}
					arr[i].onmouseout=function() {this.className=this.className.replace("active-last go1px", "");}
				}
			break;
			default :
				if (arr[i].className.indexOf("active")==-1) {
					arr[i].onmousedown=function() {this.className+=" active go1px";}
					arr[i].onmouseup=function() {this.className=this.className.replace("active go1px", "");}
					arr[i].onmouseout=function() {this.className=this.className.replace("active go1px", "");}
				}

		}
	}
}

window.onload = function () {menu();}