
function lightup(imgName)
	{
	if (document.images)
	{
		//alert("lightup")
		imgOn=eval(imgName + "on.src");
		//alert("lightup2")
		document[imgName].src= imgOn;
		//alert("lightup3")
	}
	}

function turnoff(imgName)
	{
	if (document.images)
	{
		imgOff=eval(imgName + "off.src");
		document[imgName].src= imgOff;
	}
	}
	
function popup(w,h,site) {
	x = screen.availWidth/2-w/2;
	y = screen.availHeight/2-h/2;
	var popupWindow = window.open(
		'','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=yes');
	popupWindow.document.write(site);
}

function getObject(id){
	if(document.getElementById){
		layer_obj = document.getElementById(id).style;
	}
	if(document.all){
		layer_obj = document.all[id].style;
	}
	return(layer_obj);
}

function showLayer(id){
	getObject(id).visibility = "visible";
}

function hideLayer(id){
	getObject(id).visibility = "hidden";
}

function showLayerDisplay(id){
	getObject(id).display = "block";
}

function hideLayerDisplay(id){
	getObject(id).display = "none";
}

function getElem(id){
	if(document.getElementById){
		_obj = document.getElementById(id);
	}
	else{
		_obj = document.all[id];
	}
	return(_obj);
}

function GetInfoNewsletter() {
	CMS_Template.NewsletterDetail.GetInfo(GetInfoNewsletter_callback);
}

function GetInfoNewsletter_callback(res) {
	var myInfo = res.value;

	getElem("InfoWrapper").innerHTML = myInfo.sInfo;
	if (myInfo.sInfo == '')
		hideLayerDisplay("InfoWrapper");
	else
		showLayerDisplay("InfoWrapper");
		
	getElem("FortschrittWrapper").innerHTML = myInfo.sFortschritt;
	if (myInfo.sFortschritt == '')
		hideLayerDisplay("FortschrittWrapper");
	else
		showLayerDisplay("FortschrittWrapper");

	if (myInfo.nSendenStatus == 1)
	{
		setTimeout("GetInfoNewsletter();",10);
	}
	res = null;
}

function GetSucheInfo(sSuchbegriff, sID) {
	CMS_Template.SeitenSuche.GetSucheInfo(sSuchbegriff, sID, GetSucheInfo_callback);
}

function GetSucheInfo_callback(res) {
	var myInfo = res.value;

	if (myInfo.sSucheHtml != '')
		showLayer('sucheIndex');
	else
		hideLayer('sucheIndex');
		
	getElem('sucheIndex').innerHTML = myInfo.sSucheHtml;
	
	if (document.getElementById)
	{
		document.getElementById('sucheIndex').style.left = document.getElementById('sucheWrapper').offsetLeft;
		document.getElementById('sucheIndex').style.top = document.getElementById('sucheWrapper').offsetTop;
	}
	else if (document.all)
	{
		document.all['sucheIndex'].style.left = document.all['sucheWrapper'].offsetLeft;
		document.all['sucheIndex'].style.top = document.all['sucheWrapper'].offsetTop;
	}
	
	res = null;
}

function SetSuchbegriff(sSuchbegriff, sID) {
	CMS_Template.SeitenSuche.SetSuchbegriff(sSuchbegriff);
	hideLayer('sucheIndex');
	getElem(sID).value = sSuchbegriff;
}

function hideSuche() {
	setTimeout("hideLayer('sucheIndex');", 200);
}

function GetVersionHtml() {
	CMS_Template.Index.GetVersionHtml(GetVersionHtml_callback);
	/*
	popupwidth = 360;
	popupheight = 180;
	breite = screen.width;
	hoehe = screen.height;
	xps = ((breite/2)-popupwidth/2);
	yps = ((hoehe/2)-popupheight/2);
	url = 'version.htm';
	param = 'resizable=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,toolbar=0,copyhistory=0,width=' + popupwidth + ',height=' + popupheight + ',top=' + yps + ',left=' + xps
	window.open(url,'Hilfe',param);
	*/
}

function GetVersionHtml_callback(res) {
	var sHtml = res.value;
	if (getElem('version') != null)
	{
		getElem('version').innerHTML = sHtml;
		showLayerDisplay('version');
	}
	
	res = null;
}

function HideVersion()
{
	hideLayerDisplay('version');
}






