﻿var PositionX = 100;
var PositionY = 100;

var AutoClose = false;

var imgWin = null;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4)
{
    var isNN=(navigator.appName=="Netscape") ? 1 : 0;
    var isIE=(navigator.appName.indexOf("Microsoft")!=-1) ? 1 : 0;
}

function closeWin(){
	if (imgWin != null){
		if(!imgWin.closed)
			imgWin.close();
	}
}

function popImage(imageURL, imageTitle, width, height, cssPath)
{
    closeWin ();
    
    // differences for html design (borders, etc.
    var plusWidth = 24; 
    var plusHeight = 24;
    
    var opt='scrollbars=no,width='+eval(width+plusWidth)+',height='+eval(height+plusHeight)+',left='+PositionX+',top='+PositionY;

    imgWin=window.open('about:blank','ProductImage',opt);
    
    with (imgWin.document)
    {
        writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
        writeln('<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Betöltés...</title>');
        writeln('<link href="'+cssPath+'" rel="stylesheet" type="text/css" />');

        writeln('<sc'+'ript>');
        writeln('function doTitle(){document.title="'+imageTitle+'";}');
        writeln('</sc'+'ript>');

        if (!AutoClose)
            writeln('</head><body style="background:#fff" scroll="no" onload="doTitle();self.focus()">')
        else
            writeln('</head><body bgcolor=000000 scroll="no" onload="doTitle();self.focus()" onblur="self.close()">');

        writeln('<div class="popup">');
        writeln('<a href="javascript:window.close();">');
        writeln('<img alt="'+imageTitle+'" style="display:block" src='+imageURL+' /></a></div></body></html>');

        close();		
    }
    
    //cancel the default link action if pop-up activated
    if (window.event) 
	{
	    window.event.returnValue = false;
    	window.event.cancelBubble = true;
	} 
}

