// not work on mac ie 5.2

/*
function so_applyStyleString(obj,str) {
	if(document.all && !window.opera) {
		//for win ie
		obj.style.setAttribute("cssText",str);
	} else {
		//for other browsers
		obj.setAttribute("style",str);
	}
}*/

function so_applyStyleString(obj,str) {
	if (window.opera) {
		obj.setAttribute("style",str);
	}
	else {
		//not work in opera
		obj.style.cssText = str;
	}
}

function Obj(hotspotId, windowOuterId, windowInnerId) {
	this.button = document.getElementById(hotspotId);
	this.button.windowOuter = document.getElementById(windowOuterId);
	this.button.windowInner = document.getElementById(windowInnerId);

	this.button.onmouseover = function() {
		this.style.backgroundColor
		so_applyStyleString(this,"opacity: .7; filter: alpha(opacity=70);");
		so_applyStyleString(this.windowOuter,"visibility:visible;");
		so_applyStyleString(this.windowInner,"visibility:visible;");
	}
	this.button.onmouseout = function() {
		so_applyStyleString(this,"opacity: .5; filter: alpha(opacity=50);");
		so_applyStyleString(this.windowOuter,"visibility:hidden;");
		so_applyStyleString(this.windowInner,"visibility:hidden;");
	}

}

function initialize(idPrefix,length) {
	for (var i=1; i<=length; i++) {
		new Obj(idPrefix+"Hotspot"+i, idPrefix+"WindowOuter"+i, idPrefix+"WindowInner"+i);
	}
}

function imagePopup( img, w, h, cssUrl ) {

	var sUrl = '';
	var iTipHeight = (h>600) ? 600 : h+30;
	var iTipWidth = (w>750) ? 750 : w+40;
	var iTipLeft = 0;
	var iTipTop = 0;
	var sTipScrollbars = "yes";

	//closeImagePopup();

	//window.sTipText = sTipText;

	var sParams = "width=" + iTipWidth + ",height=" + iTipHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + sTipScrollbars + ",resizable=yes,left=" + iTipLeft + ",top=" + iTipTop;

	wndImage = window.open( '', 'GFX', sParams );
	wndImage.document.write( '<html>' );
	wndImage.document.write( '<head>' );
	wndImage.document.write( '<link rel="stylesheet" type="text/css" href="'+cssUrl+'" />' );
	wndImage.document.write( '</head>' );
	wndImage.document.write( '<body>' );
	wndImage.document.write( '<img src="'+img+'" width="'+w+'" height"'+h+'" border="0">' );
	/*
	wndImage.document.write( '<table width="100%"><tr><td>' );
	wndImage.document.write( '<!-- PageNavigator -->' );
	wndImage.document.write( '<table width="100%" id="pageNavigator" cellspacing="0" cellpadding="0" border="0"><tr><td><a href="javascript:window.close();">Fenster schließen</a></td><td>&nbsp;</td><td class="right"><a href="javascript:window.print();">Drucken</a></td></tr></table>' );
	wndImage.document.write( '<!-- PageNavigator -->' );
	wndImage.document.write( '</td></tr></table>' );
	*/
	wndImage.document.write( '</body></html>' );
	wndImage.document.bgColor = "white";
	wndImage.document.close();
	wndImage.focus();

	return false;

}
