// JavaScript Document
function animbtndown(id){document.getElementById('roll').innerHTML=id;posinit=document.getElementById(id).style.backgroundPosition.replace("0px ","").replace("px","");num=0;vspeed=20;yPath=new Array (27,23,20,15,11,10,14,19,30,55,65,85,125,155,165,169,174,176,175,172,168,167,171,170);if (posinit == 27) {animY(id,'yPath',vspeed,num);}}

function moveIt(y,id){document.getElementById(id).style.backgroundPosition="0px "+y+"px";}

function animY(id,arrayY,vspeed,num){arrayYr = new Array();	arrayYr = eval(arrayY);	arrayY = "'"+arrayY+"'"; if(num<arrayYr.length)	{ moveIt(arrayYr[num],id); 	if (document.getElementById('roll').innerHTML != id) { return false; } else {num++;} setTimeout("animY('"+id+"',"+arrayY+","+vspeed+","+num+")",vspeed);}}
function animbtnup(id2){num2=0;vspeed2=10;yPath2=new Array (170,171,167,168,172,175,176,174,169,165,155,125,85,65,55,30,19,14,10,11,15,20,23,27);animY2(id2,'yPath2',vspeed2,num2,0);}

function animY2(id2,arrayY2,vspeed2,num2,action){posinit2=document.getElementById(id2).style.backgroundPosition.replace("0px ","").replace("px","");arrayYr2 = new Array();arrayYr2 = eval(arrayY2);arrayY2 = "'"+arrayY2+"'"; if(num2<arrayYr2.length) {	if (action==0) {	if (posinit2==arrayYr2[num2]) {action=1;}};	if (action==1) {moveIt(arrayYr2[num2],id2);};num2++;setTimeout("animY2('"+id2+"',"+arrayY2+","+vspeed2+","+num2+","+action+")",vspeed2);}}

function autoup()
{

}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
	  for(var i=0; i<document.images.length; i++)
	  {
		 var img = document.images[i]
		 var imgName = img.src.toUpperCase()
		 if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		 {
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		 }
	  }
   }    
}

window.attachEvent("onload", correctPNG);

