
var baseopacity=100

function initButtons() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
						var imagetest=new Image()
						window.status=this.alt
						imagetest.src=this.getAttribute('hsrc')					
						if (imagetest.complete)
            					 this.setAttribute('src',this.getAttribute('hsrc'))
            					 this.style.cursor="pointer"
            					
        }
        imgarr[i].onmouseout = function() {
						var imagetest=new Image()
						window.status=''
						imagetest.src=imgOriginSrc
						if (imagetest.complete)
					           this.setAttribute('src',imgOriginSrc)
					        
        }
        if (imgarr[i].getAttribute('url')) {
		imgarr[i].onclick = function() {
		    if (this.getAttribute('url') != ""){
 		     window.location.href=this.getAttribute('url');
 		    }
		}        
       }
    }
  }
}


function slowhigh(which2){
  imgobj       = which2;
  browserdetect= which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
  instantset(baseopacity)
  highlighting = setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
  cleartimer()
  instantset(baseopacity)
}

function instantset(degree){
  if (browserdetect=="mozilla")
    imgobj.style.MozOpacity=degree/100
  else if (browserdetect=="ie")
    imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
 if (window.highlighting) 
  clearInterval(highlighting)
}

function gradualfade(cur2){
 if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
   cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)-0.1, 0.99)
 else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
   cur2.filters.alpha.opacity-=10
 else if (window.highlighting)
  clearInterval(highlighting)
}

