//============jsfunction.js===================================================
//Save this code portion in to a file named "jsfunction.js"
//========================================================================
function viewImg(index){
  document.getElementById("viewmag").src = imgPathArray[index] //set source of the target id to images
  document.getElementById("viewmag").filters.alpha.opacity=10    //decrease opacity
  clean() //set interval
}
function makeclean(){
   if (document.getElementById('viewmag').filters.alpha.opacity<100)
  document.getElementById('viewmag').filters.alpha.opacity+=5      //increase opacity till 100
   else if (window.interval){
  clearInterval(interval)
   }
}
function clean(){
  interval=setInterval("makeclean(viewmag)",130) //
}
function viewImgLink(index,w,h){
  var ele = document.getElementById("hrefid")
  var imgpath = imgViewArray[index]
  var hreflink = ""
  if(imgpath != "#"){
     hreflink   = "javascript:popupwindowh('viewimage_mag.asp?imgpath="+imgpath+"','"+w+"','"+h+"')"
     ele.href = hreflink
  }else{
     hreflink = "#"
     ele.href = hreflink
  }
  document.getElementById("viewmag").alt = "View this"
  document.getElementById("viewmag").src = imgPathArray[index]
  document.getElementById("viewmag").filters.alpha.opacity=10
  clean()
}
function foggy(viewid){
//clearInterval(interval)
document.getElementById(viewid).filters.alpha.opacity=70
}
function light(viewid){
document.getElementById(viewid).filters.alpha.opacity=100
}
function popupwindowh(url, width, height){
 window.open(url,"popWin","toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no,width="+ width +",height="+height);
}

//==============end=======================================================