
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

var nolink = false;
var noexitpop = false;

function uncommercialpage1(num) {
	if(nolink) {
		//if(!noexitpop) window.open("http://ilead.itrack.it/clients/ext.aspx?openpopup=0&targetpage=popup&cid=9172&sid=49874&wid=1043&swid=exit", "gewinnriese", "width=350,height=572,scrollbars=no");	
		//if(!noexitpop) window.open("http://ad.netdialogs.de/index.php?action=loadCampaignAd&campaignID=5&campaignAdID=48&websiteID=4&externalID=exitpop&openPopup=0", "tcom", "width=832,height=662,scrollbars=yes");	
		//if(!noexitpop) window.open("http://www.planet49.com/cgi-bin/wingame.pl?partner_pk=1&wingame_pk=34&sub_id=exitpop", "immo", "width=660,height=710,scrollbars=yes");	
		ajaxstats(num);
	} 
}

function uncommercial(num,url) {
	if(nolink) {
		//if(!noexitpop) window.open("http://ilead.itrack.it/clients/ext.aspx?openpopup=0&targetpage=popup&cid=9172&sid=49874&wid=1043&swid=exit", "gewinnriese", "width=350,height=572,scrollbars=no");	
		//if(!noexitpop) window.open("http://ad.netdialogs.de/index.php?action=loadCampaignAd&campaignID=5&campaignAdID=48&websiteID=4&externalID=exitpop&openPopup=0", "tcom", "width=832,height=662,scrollbars=yes");	
		//if(!noexitpop) window.open("http://www.planet49.com/cgi-bin/wingame.pl?partner_pk=1&wingame_pk=34&sub_id=exitpop", "immo", "width=660,height=710,scrollbars=yes");	
		ajaxstats(num);
	} 
}

//Gewinner-Animation:
window.addEvent('domready', function() {
  var aniY = 0;
  var winnerDiv = $('sliced_winner_ani');
  var winnerIntervall = function() {
	this.setStyle('background-position','0px -'+aniY+'px');
	if (aniY<525) {
	  aniY=aniY+175;
	} else {
	  aniY=0;
	}
  }
  winnerIntervall.periodical(1500,winnerDiv);
});

function uncommercialp4(num,url) {
	if(nolink) {
		if(!noexitpop && url) window.open(url, "vista", "width=660,height=710,scrollbars=yes");	
		ajaxstats(num);
	} 
}

function ajaxstats(page) {

	if(window.XMLHttpRequest)
	{
    	try 
		{
			req = new XMLHttpRequest();
        } 
		catch(e) 
		{
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } 
	else if(window.ActiveXObject) 
	{ 
       	try 
		{
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} 
		catch(e) 
		{
        	try 
			{
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} 
			catch(e) 
			{
          		req = false;
        	}
		}
    }
	if(req && page != 0) 
	{
		urlx = "/cgi-bin/49lp.pl?file=images/pixel.gif&partner_pk="+page+"&ident=close&wingame_pk=32";
		randurl = urlx + "&" + Math.random();
		req.open("GET", randurl, true);
		req.send("");	
	}
}

var count;

function checkform() {	
	var a = document.getElementById('agb');
	count++;
	if(count>2){
		return true;
	}
	else if (!document.register.agb.checked) { 
		showlayer('agberror');
		hidetagsIE('SELECT');
		return false;
	} else {
		return true;
	}
}

function doRegisterAccept(){
			var a = document.getElementById('agb');
			a.checked = "checked";
			hidelayer('agberror');
			showtagsIE('SELECT');
			if (checkform()) 
			{
				document.register.submit();
			}
		}
	
function hidelayer(divs) {
		document.getElementById(divs).style.display = "none";
		if(divs == "popinfo") document.getElementById("landselect").style.display = "block";
	}
	
function showlayer(divs) {
		document.getElementById(divs).style.display = "block";
		if(divs == "popinfo") document.getElementById("landselect").style.display = "none";
	}
		function hidelayer(div) {
			document.getElementById(div).style.display = "none";
			// checken, ob ein Layer vorhanden ist, dann Select-Feld einblenden
			if (!istvorhanden('werbeflaeche') && !istvorhanden('eucevainter') && !istvorhanden('eucevaquestion')  && !istvorhanden('eucevaanswer') && !istvorhanden('regiolayer')) showtagsIE('select'); 
			}
			
// Selectboxen aus- und wieder einblenden f&uuml;r ie6. Einblendung muss im Schliessen-Link des hinteren GWS-Layers eingebaut sein 

function hidetagsIE(TagNamen){
  if ( navigator.userAgent.indexOf("MSIE 6") != -1 ){
    var no = 0;
    while (document.getElementsByTagName(TagNamen)[no]){
      document.getElementsByTagName(TagNamen)[no].style.visibility = "hidden"; 
      no++;
    }
  }
}
function showtagsIE(TagNamen){
  if ( navigator.userAgent.indexOf("MSIE 6") != -1 ){
    var no = 0;
    while (document.getElementsByTagName(TagNamen)[no]){
      document.getElementsByTagName(TagNamen)[no].style.visibility = "visible"; 
      no++;
    }
  }
}
  function istvorhanden(id) {
    if (document.getElementById(id) && document.getElementById(id).style.display == "block"){
      return true;
    }else{
      return false;
    }
  
  }


function showlayer(div) {
	document.getElementById(div).style.display = "block";
	}
	
var errortext = true;
		

function fillcheck() {
	ausgabe = true;
	for(i=0;i<(document.inter.length);i++)
	{
		//alert("name:"+document.inter.elements[i].name + ", ind:" + document.inter.elements[i].name.indexOf("question::"));
		if ((document.inter.elements[i].name.indexOf("coreg_pk_") > -1) && document.inter.elements[i].checked == true) {
			errortext = false;
			if(document.inter.elements[i+1].name.indexOf("confirmbox::") > -1 && document.inter.elements[i+1].checked == false) { 
				errorcbtext = document.inter.elements[i+1].name.split("::");				
					alert("Sie muessen noch die Checkbox des gewaehlten Angebots bestaetigen!");
					ausgabe = false;					
			}
		}
	}
	if (errortext == true) {
		hidetagsIE('select');
		document.getElementById('werbeflaeche_coreg').style.display = 'block';
		//alert("Bitte w&auml;hlen Sie mindestens ein Gratis Angebot aus,\nindem Sie die Checkbox anklicken.");
		ausgabe = false;
	}
	return ausgabe;	
}


function inter_check_all() {
	return;
	for(i=0;i<(document.inter.length);i++) {
		if ((document.inter.elements[i].name.indexOf("question::") > -1)) document.inter.elements[i].checked = true;
	}
}

function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
		
function checkthebox(boxname) {
	if (document.inter.elements[boxname].checked == true) {
		document.inter.elements[boxname].checked = false;
		}
	else {
		document.inter.elements[boxname].checked = true;
		}
	}
	
// Uhrzeit ------------------------------------------------------------------------------------------------------------------------------
	function currentTime() {
		var jetzt = new Date();                  
		var Stunden = jetzt.getHours();
		if (Stunden < 10) Stunden = "0" + Stunden;
		var Minuten = jetzt.getMinutes();
		if (Minuten < 10) Minuten = "0" + Minuten;	
				
		return (Stunden + ":" + Minuten);
	}


var re_two = /^[a-zA-Z0-9\-\.\_\+]+\@(\[?)([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;	
	
function checkinputs(func) {
	var filled = "";
	var errormail = "";
	var e ="";
	if(func != 0) {
		for(i=0;i<4;i++) {
		filled += document.allfriend.friend[i].value;
		e = document.allfriend.friend[i].value;		
		document.allfriend.friend[i].style.backgroundColor = "#999999";		
		if (!e.match(re_two) && e != "") {
			if(errormail) errormail += ", ";
			errormail += (i+1); 				
			document.allfriend.friend[i].style.backgroundColor = "#cc0000";
			}
		}
		if(filled == "" && errormail == "") {
			showlayer("showEmpty");
			document.allfriend.friend[0].style.backgroundColor = "#cc0000";
			return false;
		} else if(errormail != "" && filled != "") {
			var errordiv = document.getElementById("showError");
			errordiv.innerHTML = "L'indirizzo email inserito risulta non corretto!<br /><br /><a href='javascript:hidelayer(\"showError\");' class='errorbut'>OK</a><br /><br />";	
			errordiv.style.display = "block";
			return false;
		} else {
			return true;
		}		
	} else {
		showlayer("showEmpty");
		return false;		
	}
}	
	

function openit_big(url,name) 
{
	window.open(url,name,"width=1024,height=768,scrollbars=yes,menubar=yes,status=yes,toolbar=yes,location=yes");
}