
    var idProdmask = document.getElementById("idProdmask");
    var idProdInfoContainer = document.getElementById("idProdInfoContainer");
    var h = 0;
    var w = 0;

    //Function to close div
    function CloseDiv(){
	    var idProdmask = document.getElementById("idProdmask");
	    var idProdInfoContainer = document.getElementById("idProdInfoContainer");
	    idProdmask.style.display="none";
	    idProdInfoContainer.style.display="none";
	    document.getElementById("imgMask").style.display = "none";
    }


function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}

function changeMask(){

var idProdmask = document.getElementById("idProdmask");
if (idProdmask.style.display == "inline"){



if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	


    // First, determine how much the visitor has scrolled
    var scrolledX, scrolledY;
    if( self.pageYoffset ) {
        scrolledX = self.pageXoffset;
        scrolledY = self.pageYoffset;
    } else if( document.documentElement && document.documentElement.scrollTop ) {
        scrolledX = document.documentElement.scrollLeft;
        scrolledY = document.documentElement.scrollTop;
    } else if( document.body ) {
        scrolledX = document.body.scrollLeft;
        scrolledY = document.body.scrollTop;
    }

    // Next, determine the coordinates of the center of browser's window

    var centerX, centerY;
    if( self.innerHeight ) {
        centerX = self.innerWidth;
        centerY = self.innerHeight;
        

        
    } else if( document.documentElement && document.documentElement.clientHeight ) {
        centerX = document.documentElement.clientWidth;
        centerY = document.documentElement.clientHeight;
        

    } else if( document.body ) {
        centerX = document.body.clientWidth;
        centerY = document.body.clientHeight;
        

    }
        if(centerY > yWithScroll){
            yWithScroll = centerY;
        }


    // Xwidth is the width of the div, Yheight is the height of the
    // div passed as arguments to the function:
    var leftoffset = scrolledX + (centerX - 575) / 2;
    var topoffset = scrolledY + (centerY - 575) / 2;
   
    // The initial width and height of the div can be set in the
    // style sheet with display:none; divid is passed as an argument to // the function
    var o=document.getElementById("idProdInfoContainer");
    var r=o.style;
    r.position='absolute';
    r.top = topoffset + 'px';
    r.left = leftoffset + 'px';
    r.display = "block";
    }


    idProdmask.style.height = yWithScroll + "px";
	idProdmask.style.width = xWithScroll + "px";

}


    function OpenDiv(Xwidth,Yheight,divid) {
   
    addEvent(window, 'resize', changeMask);
   


    document.getElementById("imgMask").style.display = "none";
    
    // First, determine how much the visitor has scrolled
    var scrolledX, scrolledY;
    if( self.pageYoffset ) {
        scrolledX = self.pageXoffset;
        scrolledY = self.pageYoffset;
    } else if( document.documentElement && document.documentElement.scrollTop ) {
        scrolledX = document.documentElement.scrollLeft;
        scrolledY = document.documentElement.scrollTop;
    } else if( document.body ) {
        scrolledX = document.body.scrollLeft;
        scrolledY = document.body.scrollTop;
    }

    // Next, determine the coordinates of the center of browser's window

    var centerX, centerY;
    if( self.innerHeight ) {
        centerX = self.innerWidth;
        centerY = self.innerHeight;
    } else if( document.documentElement && document.documentElement.clientHeight ) {
        centerX = document.documentElement.clientWidth;
        centerY = document.documentElement.clientHeight;
    } else if( document.body ) {
        centerX = document.body.clientWidth;
        centerY = document.body.clientHeight;
    }
    
    var idProdmask = document.getElementById("idProdmask");


if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}


        if(centerY > yWithScroll){
         addEvent(window, 'scroll', changeMask);
        yWithScroll = centerY;
        }

	idProdmask.style.backgroundColor = "#000000";	
	idProdmask.style.position = "absolute";	
	idProdmask.style.height = yWithScroll + "px";
	idProdmask.style.width = xWithScroll + "px";
	idProdmask.style.top = "0px";
	idProdmask.style.left = "0px";
	idProdmask.style.zIndex = "65";
	idProdmask.style.display="inline";
    

    // Xwidth is the width of the div, Yheight is the height of the
    // div passed as arguments to the function:
    var leftoffset = scrolledX + (centerX - Xwidth) / 2;
    var topoffset = scrolledY + (centerY - Yheight) / 2;
   
    // The initial width and height of the div can be set in the
    // style sheet with display:none; divid is passed as an argument to // the function
    var o=document.getElementById(divid);
    var r=o.style;
    r.position='absolute';
    r.top = topoffset + 'px';
    r.left = leftoffset + 'px';
    r.display = "block";
    
    var idProdInfoContainer = document.getElementById("idProdInfoContainer");

    idProdInfoContainer.style.zIndex = "66";
    idProdInfoContainer.style.display="inline";
    
    fadeBGIn();
    
}

var intOpacity1 = 6; 
var intOpacity2 = 0;
var intOpacity3 = 0;
var intOpacityWarn = 0;
var intOpacityPoll = 0;

    

//fade in the image
function fadeBGIn()
{ 

    if (intOpacity1 != 7)
    {
        var BG = document.getElementById("idProdmask");
        intOpacity1 += 1;
        BG.style.opacity = intOpacity1/10;
        BG.style.filter = 'alpha(opacity=' + intOpacity1 * 10 + ')';
        setTimeout(fadeBGIn,1);
    }
}