﻿
//------------------------------------------------------------------------------
//	Funktion zum Aufruf des Produkte Bild Fenster. Die Umsetzung des Fensters
//	basiert auf der Scriptlibrary von Dynamic Drive
//	
//	Autor: 		Thomas Brodbeck
//	Version:	1.0
//------------------------------------------------------------------------------

function openInlineWin(imageName, leftPos, topPos, themeImagePath)
{
	var format = "left=" + leftPos + "px,top=" + topPos + "px,resize=0,scrolling=0"
	
	if(typeof inlinewin!='undefined')
	{ 
		
		if( inlinewin.isClosed )
		{
			inlinewin=dhtmlwindow.open("broadcastbox", "inline", "<a class=\"ProductWindow\">" + "<img id=\"productImage\" onClick=\"inlinewin.close();\" src=\"" + imageName +"\"/>" + "</a>", "Artikelbild", format, themeImagePath)
			adjustWindowSize();
		}
		else
		{
			inlinewin.load("inline", "<a class=\"ProductWindow\">" + "<img id=\"productImage\" onClick=\"inlinewin.close();\" src=\"" + imageName +"\"/>" + "</a>", themeImagePath, "Artikelbild")
			adjustWindowSize();
		}
	}
	else
	{
		inlinewin=dhtmlwindow.open("broadcastbox", "inline", "<a class=\"ProductWindow\">" + "<img id=\"productImage\" onClick=\"inlinewin.close();\" src=\"" + imageName +"\"/>" + "</a>", "Artikelbild", format, themeImagePath);
		adjustWindowSize();
	}
}

function adjustWindowSize()
{
    document.getElementById('productImage').onload = function() {
        adjustSize( document.getElementById('productImage') )
    }
}		

function adjustSize(bild)
{
		inlinewin.setSize( bild.width + 4, bild.height );
}
