function SetDomainCookie(cookieName,cookieValue,nDays) {
 	var today = new Date();
 	var expire = new Date();
 	if (nDays==null || nDays==0) nDays=1;
 	expire.setTime(today.getTime() + 3600000*24*nDays);
 	document.cookie = cookieName+"="+escape(cookieValue)
				 + ";expires="+expire.toGMTString()+";path=/";
}				

var secs;
var timerID = null;
var timerRunning = false;
var delay = 1000;

var mypath = "";

function onInit() {
	mypath = window.location.href;
	mypath = mypath.slice(mypath.indexOf('//')+2);
	mypath = mypath.slice(mypath.indexOf('/'));
	mypath = mypath.substring(0,mypath.indexOf(mytarget));
}

function InitializeTimer() {
	secs = 5;
	StopTheClock();
	StartTheTimer();
}

function StopTheClock() {
	if(timerRunning)
		clearTimeout(timerID);
	timerRunning = false;
}

function StartTheTimer() {
	if (secs==0)
	{
		StopTheClock();
		if(document.getElementById("ir_layer"))
			document.getElementById("ir_layer").style.visibility="visible";
	}
	else
	{
		secs = secs - 1;
		timerRunning = true;
		timerID = self.setTimeout("StartTheTimer()", delay);
	}
}

/*		
function closeLayer () {
  document.getElementById("Layer1").style.visibility = "hidden";
}

function openLayer () {
  document.getElementById("Layer1").style.visibility = "visible";
}
*/

function ReadCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function SetCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue)
				 + ";expires="+expire.toGMTString();
}

function checkCookie() {
	if(ReadCookie("tmobile") == "") {
		//cookie setzen
		SetCookie("tmobile","Popup",1);
		//hier anzeigen das popup
		// openLayer();
	}

}

	
