//Preloads images specified on product pages
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

window.onload = function () {
	//displayImage('images/NPU_Ext_Switch.png')
}
pop_PrdImage = "";
function openPrdImage(psjs_url){
    if(pop_PrdImage){
        if(pop_PrdImage.closed){
            pop_PrdImage = window.open("product_images/"+psjs_url, "pop_PrdImage", "top=" + ((screen.availHeight/2) - (300 / 2)) + ",left=" + ((screen.availWidth/2) - (820 / 2)) + ",width=820,height=300,resizable=1,toolbar=0,scrollbars=0,location=0,status=0,menubar=0")
        } else {
            pop_PrdImage.focus();
            pop_PrdImage = window.open("product_images/"+psjs_url, "pop_PrdImage", "top=" + ((screen.availHeight/2) - (300 / 2)) + ",left=" + ((screen.availWidth/2) - (820 / 2)) + ",width=820,height=300,resizable=1,toolbar=0,scrollbars=0,location=0,status=0,menubar=0")
        }
    } else {
        pop_PrdImage = window.open("product_images/"+psjs_url, "pop_PrdImage", "top=" + ((screen.availHeight/2) - (300 / 2)) + ",left=" + ((screen.availWidth/2) - (820 / 2)) + ",width=820,height=300,resizable=1,toolbar=0,scrollbars=0,location=0,status=0,menubar=0")
    }
}
function displayImage(file){
	displayDialogBox("<p><img src=\"" + file + "\"></p>","test",700,740);
}
function displayDialogBox(contentData, title, height, width){	
	mainBoxHTML = "<div class=\"topLine\"></div>"+
				  "<div class=\"dialogeContent\">"+
				  "  <p class=\"btnClose\"><a href=\"javascript:closeDialogWindow('dialogWindow')\">CLOSE</a></p>"+
				  contentData + 
				  "</div>"+
				  "<div class=\"bottomLine\"></div>"+
				  "</div>\n";
	document.getElementById('dialogWindow').innerHTML = mainBoxHTML;
	
	document.getElementById('dialogWindow').style.display = 'block';
			
	yc = Math.round((document.body.scrollHeight/2)-(document.getElementById('dialogWindow').clientHeight/2));
	xc = Math.round((document.body.clientWidth/2)-(width/2));
    document.getElementById('dialogWindow').style.left = xc + "px";
    //document.getElementById('dialogWindow').style.top = yc + "px";
	
	var x = xc;
	var y = (posTop()) + 'px';
	moveObjTo('dialogWindow',x,y);
}
function closeDialogWindow(divBox){
	document.getElementById(divBox).style.display = 'none';
}
window.onscroll = function (){
	var x = Math.round((document.body.clientWidth/2)-(740/2));
	var y = (posTop()) + 'px';
	moveObjTo('dialogWindow',x,y);
}
window.onresize = function (){
	var x = Math.round((document.body.clientWidth/2)-(740/2));
	var y = (posTop()) + 'px';
	moveObjTo('dialogWindow',x,y);
}
//-->
