﻿function SetImageFilter(imgId, opacity, imagepath)
{
    var img = document.getElementById(imgId);
    //alert(imgId);
    var sPath = window.location.pathname;
    //var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
    var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
    if("Home.aspx" != sPage)
    {
        var objLinkToProductDetail = document.getElementById("aProductDetail");
        objLinkToProductDetail.href = "ProductDetail.aspx?ID=" + imgId;
    }
   
    if(imagepath != null && imagepath != "")
    {
        var imgMain = document.getElementById("main");
        imgMain.src = imagepath;
    }
    if (navigator.appName.indexOf ("Microsoft") !=-1) 
    {
	   // return window[objFlash];
	   img.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + opacity + ");";
	   //alert("IE");
	
    } else 
    {
        
        opacity = parseInt(opacity, 10) / 100;
        //img.style.MozOpacity = 0;
        if(opacity == 1)
        {
            img.style.MozOpacity =  1;
        }
        else
        {
            img.style.MozOpacity =  0.5;
        }
        //alert("Firefox: " + opacity);
	    //return window.document[objFlash];
    
    }
    
}


function makevisible(cur,which){
strength=(which==0)? 1 : 0.2;
if (cur.style.MozOpacity)
cur.style.MozOpacity=strength;
else if (cur.filters)
cur.filters.alpha.opacity=strength*100;
}
