function winPop(url, w, h, myName)
{
	var fenster = window.open(url, myName,'width=' + w + ',height=' + h + ',top=50,left=50,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=yes,location=no');
	fenster.focus();
}

		
function miet()
{
	F1 = window.open("http://www.wohngeld.de/wohngeld.de_neu/portal/mstsuche9.aspx?popup=2","Fenster1","width=810,height=450,left=0,top=0");
	F1.focus();
}


function saveOpenerValues()
{
	if (window.document.Form1.jsPostBack.value == "0")
	{
		window.document.Form1.ddZeitEinh.value = window.opener.document.Form1.ddZeitEinh.value;
		window.document.Form1.txtBetrag.value = window.opener.document.Form1.txtBetrag.value;
	}
}


function checkCookies()
{				
	var cookieValue;
	createCookie('WgCalcCookie','ok');
	cookieValue = readCookie('WgCalcCookie');
	//alert(cookieValue);
	if(cookieValue!='ok')
	{
		//alert('Bitte Cookies aktivieren!');
		document.getElementById('CookieMsg').style.display = 'block';
		document.getElementById('Info').style.display = 'none';
		//window.location.replace('/wohngeld.de_neu/portal/index.aspx');
	}
	else
	{
		//alert('Cookie OK');
		eraseCookie('name');
		document.getElementById('CookieMsg').style.display = 'none';
		document.getElementById('Info').style.display = 'block';
	}
}


function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}


function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


function eraseCookie(name)
{
	createCookie(name,"",-1);
}	

