Kuckuck = {};

Kuckuck.showSofaPicture = function(url)
{
	var w = 640;
	var h = 480;
	var l = (screen.width ? (screen.width - w) / 2 : 0);
	var t = (screen.height ? (screen.height - h) / 2 : 0);
	var o = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+w+',height='+h+',left='+l+',top='+t;
	
	var popup = window.open('', '', o);
	popup.focus();
	popup.document.open();
	with (popup)
	{
		document.clear();
		document.write("<html><head>");
		document.write("<title>Projekt - Sofa</title>");
		document.write("<style type=\"text/css\">");
		document.write(".img{cursor:hand;}");
		document.write("</style>");
		document.write("</head>");
		document.write("<body leftmargin=\"0\" marginheight=\"0\" marginwidth=\"0\" topmargin=\"0\">");
		document.write("<img onclick=\"window.close();\" src=\""+url+"\" title=\"Zum Schlie&szlig;en auf das Foto klicken\">");
		document.write("</body></html>");
	}
}

function init()
{
	var info = com.asual.util.Browser;
	if (info.isMac() && info.isFirefox()) scrollEnabled = false;
	else if (info.isIE() && info.getVersion() < 7) scrollEnabled = false;
	else scrollEnabled = true;
	
	swfEl = document.getElementById(swfID);
	document.body.className = scrollEnabled ? 'flashScroller' : 'flash';
	window.onscroll = onDocumentScroll;
}

function setContentHeight(height)
{
	if (!scrollEnabled) return;
	
	scrollHeight = height;
	var el = document.getElementById('scroller');
	el.style.height = height + 'px';
}


function setScrollPosition(value)
{
	window.scrollTo(0, value * (scrollHeight - Base.UserAgent.getViewportHeight()));
}


function onDocumentScroll()
{
	if (!scrollEnabled) return;
	
	if (swfEl == null) return;
	swfEl.onBrowserScroll(Base.UserAgent.getScrollPosition() / (scrollHeight - Base.UserAgent.getViewportHeight()));
}