// Demo

var preview;
function previewWindow(url,breite,hoehe){
	if(preview&&!preview.closed) preview.close();
	var posx = (screen.width-breite) / 2
	var posy = (screen.height-hoehe) / 2
	preview = window.open(url,'Demo','Toolbar=0,Location=0,Directories=0,Status=0,Menubar=0,scrollbars=0,resizable=0,left='+posx+',top='+posy+',width=' + breite + ',height=' + hoehe + ',alwaysRaised=1', false);
	preview.focus();
}


// Detailvorschau

var newWin;
function neuesFenster(url,breite,hoehe){
	var winContent='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
	winContent+='<html>';
	winContent+='<head>';
	winContent+='<title>Detailansicht</title>';
	winContent+='</head>';
	winContent+='<body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">';
	winContent+='<img src="'+url+'" width="'+breite+'" height="'+hoehe+'" border="0" alt="">';
	winContent+='</body>';
	winContent+='</html>';
	if(newWin&&!newWin.closed) newWin.close();
	var posx = (screen.width-breite) / 2
	var posy = (screen.height-hoehe) / 2
	newWin = window.open('','Detailansicht','Toolbar=0,Location=0,Directories=0,Status=0,Menubar=0,scrollbars=0,resizable=0,left='+posx+',top='+posy+',width=' + breite + ',height=' + hoehe + '');
	newWin.document.open();
	newWin.document.write(winContent);
	newWin.document.close();
	newWin.focus();
}


// Downloadlayer

function checkQuery(){
	var tmp=window.location.search;
	if(tmp!='')toggle('block'+tmp.split("?")[1]+'_on');
}

function hide(objname) {
	document.getElementById(objname).style.display="none";
}

function show(objname) {
	document.getElementById(objname).style.display="block";
}

function toggle(objname) {
	var parts=document.getElementById(objname).id.split("_");

	if (parts[1]=="off") {
		show(objname);
		hide(parts[0]+"_on");
	}
	else if (parts[1]=="on") {
		show(objname);
		hide(parts[0]+"_off");
	}
}

function chgCursor(obj) {
	obj.style.cursor = (document.all) ? 'hand' : 'pointer';
}

window.onload=checkQuery;