objWindow = null ;

function ChBckPositionOver(element)
{
	element.style.backgroundPosition = '0px -20px';
}
function ChBckPositionOut(element)
{
	element.style.backgroundPosition = '0px 0px';
}
function ChBckPositionClick(element)
{
	element.style.backgroundPosition = '0px -40px';
}

function openLink(url) {
	try {
		objWindow = opener();
		objWindow.location.href = 'http://www.wfmg.de'+url ;
	} catch(e) {
		objWindow = window.open('http://www.wfmg.de'+url,'wfmg');
	}
	objWindow.focus() ;
}

function exporeal2003() {
	e = window.open('http://www.wfmg.de/library/exporeal2003/index.html', 'exporeal2003', 'resizable=no,width=1006,height=708');
	e.focus();
}

function openImmo() {
	window.open('http://www.wfmg.de/immo/immo/','immo','height=700,width=1024,scrollbars=yes,resizable=yes,screenX=150,screenY=150,locationbar=no,statusbar=no');
}

function changeSite(selectedID,dir)
{
	if(selectedID != "0")
	{
		location.href = dir + "/default.aspx?id="+ selectedID;
	}
	else
	{
		location.href = dir + "/default.aspx";
	}
}


function openPopup(intWidth, intHeight, strUrlToGo){
	var intLeft = screen.width/2 - intWidth/2;
	var intTop  = screen.height/2 - intHeight/2;
	var thiswindow = window.open("http://"+ strUrlToGo +"", "WfmgPopUp", "width="+ intWidth +", height="+ intHeight +", left="+ intLeft +", top="+ intTop +", resizable=yes, scrollbars=yes");
	if(thiswindow != null){
		thiswindow.focus();
	}
	return true;
}

function openPopup2(strUrlToGo, intWidth, intHeight, strName, scollbars, resizeable) {
	var intLeft = screen.width/2 - intWidth/2;
	var intTop  = screen.height/2 - intHeight/2;
	var thiswindow = window.open(strUrlToGo, strName, "width="+ intWidth +", height="+ intHeight +", left="+ intLeft +", top="+ intTop +", resizable="+resizeable+", scrollbars="+scollbars);
	if(thiswindow != null){
		thiswindow.focus();
	}
}

function confirmDeleteObject(id, name, typ) {
	if(confirm("Soll das Object '"+name+"' wirklich gelöscht werden?")) {
		document.liste.table_add.value	= "immo_objekt_"+ typ ;
		document.liste.objekt_id.value	= id ;
		document.liste.execute.value	= "delete" ;
		document.liste.submit();
	}
}

function toggleDivDisplay(divID)
{
	var divToToggle = document.getElementById(divID);
	if(divToToggle != null)
	{
		var curDisplay = divToToggle.style.display;
		if(curDisplay == '' || curDisplay == 'block')
		{
			divToToggle.style.display = 'none';
		}
		else
		{
			divToToggle.style.display = 'block';
		}
	}
}

function openWindow(url, w, h)
{
   var padding;
   (navigator.appName == "Microsoft Internet Explorer") ? (padding = 0) : (padding = 0);

   var screenw = screen.availWidth;
   var screenh = screen.availHeight;
   var winw = (w + 15 + padding);
   var winh = (h + 15 + padding);
   var posx = (screenw / 2) - (winw / 2);
   var posy = (screenh / 2) - (winh / 2);

   var mywin = window.open(url,"mywin","top="+posy+",left="+posx+",width="+winw+",height="+winh+",menubar=no,locationbar=no,statusbar=no,resizable=no,toolbar=no,dependent=yes,scrollbars=no");
   mywin.focus();
}

function updateNewsletter ()
{
	var arrP = document.getElementsByTagName ('p');
	for (var i = 0; i < arrP.length; i++)
	{
		if (arrP[i].innerHTML.substr (0, 4) == "Hier")
		{
			arrP[i].innerHTML.replace ("sich", "sich die");
			break;
		}
	}
	
	var arrNews = document.getElementsByTagName ("a");
	
	for (i = 0; i < arrNews.length; i++)
	{
		if (arrNews[i].href = "newsletterarchiv.aspx?news_id=78")
		{
			arrNews[i].parentNode.parentNode.parentNode.removeChild (arrNews[i].parentNode.parentNode);
			break;
		}
	}
}

updateNewsletter();