/*
** @function: debug output for IE and Firebug
*/
function debug(data) {
	if(document.URL.indexOf("labhh") > -1) {
		try {
			console.log(data);
		} catch(e) {
			window.status = data;
		}
	}
}

function emergencyReload() {
	if (!document.location.href.match(/reload$/)) {
		if (document.location.href.indexOf("?") > -1) {
			document.location.href = document.location.href + "&reload";
		}
		else {
			document.location.href = document.location.href + "?reload";
		}
	}
}

function checkMouse() {
	rNavi = document.getElementById("reiterNavi");
	wsPromoArea = rNavi.nextSibling;
	// FF fix -> textnode
	while(wsPromoArea.nodeType != 1) {
		wsPromoArea = wsPromoArea.nextSibling;
	}
	wsPromoArea.style.zIndex = "100";
	wsPromoArea.onmouseover = stopRot;
	wsPromoArea.onmouseout = startRot;
}

function stopRot() {
	// alle intervalle l?schen
	for(i=0;i<rotTimeOut.length;i++) {
		window.clearInterval(rotTimeOut[i]);
	}
	rotTimeOut = new Array();
	debug("stopRot");
}

function startRot() {
	if(rotationFlag == 1) {
		// nebenl?ufigkeit -> mehrere intervalle
		if(rotTimeOut.length >= 1) stopRot();
		rotTimeOut[rotTimeOut.length] = window.setInterval("rotatePromo()", rotationFreq * 1000);
		debug("startRot");
	}
}

function changeRotationMode() {
	myBut = document.getElementById("buttonPlay");
	if(myBut != 'undefined') {
		butSrc = document.getElementById("buttonPlay").src;
		butTitle = document.getElementById("buttonPlay").title;
		if (rotationFlag == 1) {
			rotationFlag = 0;
			myBut.src = "/img/button_bildwechsel_next.gif";
			myBut.title = "Stop";
			myBut.alt = "Stop";
			stopRot();
		} else if(rotationFlag == 0) {
			rotationFlag = 1;
			myBut.src = "/img/button_bildwechsel_stop.gif";
			myBut.title = "Start";
			myBut.alt = "Start";
			startRot();
		}
	}
}

function rotatePromo() {
	if (rotationFlag == 1) {
		for (var i = 0; i < document.getElementById("reiterNavi").getElementsByTagName("li").length; i++) {
			if (document.getElementById("reiterNavi").getElementsByTagName("li")[i].id == "active") {
				if (i + 1 < document.getElementById("reiterNavi").getElementsByTagName("li").length) {
					toggleTabs(i + 1);
				}
				else {
					toggleTabs(0);
				}
				break;
			}
		}
	}
}

function jump(direction) {
	stopRot();
	var idx = 0;
	for (var i = 0; i < document.getElementById("reiterNavi").getElementsByTagName("li").length; i++) {
		if (document.getElementById("reiterNavi").getElementsByTagName("li")[i].id == "active") {
			idx = i + direction;
			break;
		}
	}
	if (idx < 0) {
		idx = document.getElementById("reiterNavi").getElementsByTagName("li").length - 1;
	}
	if (idx >= document.getElementById("reiterNavi").getElementsByTagName("li").length) {
		idx = 0;
	}
	toggleTabs(idx);
}

function toggleTabs(idx) {
	for (var i=0; i < document.getElementById("reiterNavi").getElementsByTagName("li").length; i++) {
		if (document.getElementById("reiterNavi").getElementsByTagName("li")[i].getAttribute("id") == "active") {
			document.getElementById("active").innerHTML = "<a href=\"#\" onClick=\"toggleTabs(" + i + "); return false;\">" + document.getElementById("active").getElementsByTagName("span")[0].innerHTML + "</a>";
		}
		else if (i == idx) {
			document.getElementById("reiterNavi").getElementsByTagName("li")[i].innerHTML = "<span class=\"active\">" + document.getElementById("reiterNavi").getElementsByTagName("li")[i].getElementsByTagName("a")[0].innerHTML + "</span>";
		}
	}

	document.getElementById("active").removeAttribute("id");
	document.getElementById("reiterNavi").getElementsByTagName("li")[idx].setAttribute("id", "active");
	changePromoContent(idx);
}


/*
** @function: get date string for page header
*/
function getDateStr() {
	var now  = new Date();
	var year = now.getYear();
	
	if (year < 999) {
		year += 1900;
	}
		
	var wday = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
	var mon  = new Array("Januar", "Februar", "M&auml;rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
	
	return (wday[now.getDay()] + ', ' + now.getDate() + '. ' + mon[now.getMonth()] + ' ' + year);
}

/*
** @function: get DOM element by ID (IE5 fallback)
*/
function getDOMElementById(id) {
		if (document.getElementById) {
			return document.getElementById(id);
		} else if (document.all) {
			return document.all[id];
		}
		return false;
}
/*
** @function: update URL's in Sucheheader
*/
function changeAllUrls() {
	  
	  index = document.forms['headersearch'].elements['headersearchtype'].options.selectedIndex;
	  //alert(index);
	  link = getDOMElementById("headersearchlink");
	  sep = getDOMElementById("headersearchseparator");
	  help = getDOMElementById("headersearchhelp");
		
	  if ((link != false) && (sep != false) && (help != false)) {
		if (helpUrl[index].length>0) {
			help.href = helpUrl[index];
			help.style.display = "inline";
			help.style.visibility = "visible";
		} else {
			help.style.display = "none";
			help.style.visibility = "hidden";
		}
		
		if (advancedSearchUrl[index].length>0) {
			//alert(link.href);
			link.href = advancedSearchUrl[index];
			link.style.display = "inline";
			link.style.visibility = "visible";
			
		} else {
			link.style.display = "none";
			link.style.visibility = "hidden";
		}
		if ((advancedSearchUrl[index].length>0) && (helpUrl[index].length>0)) {
			sep.style.display = "inline";
			sep.style.visibility = "visible";
		} else {
			sep.style.display = "none";
			sep.style.visibility = "hidden";
		}
	  } else {
	    //alert(link + sep + help);
	  }
	  document.forms['headersearch'].elements['headerquery'].focus();
}
/*
** @function: Submit Sucheheader
*/
function submitHeaderSearch() {
	query = document.forms['headersearch'].elements['headerquery'].value;
	if (document.forms['headersearch'].elements['headersearchtype']) {
		index = document.forms['headersearch'].elements['headersearchtype'].options.selectedIndex;
	} else {
		index = 0;
	}
	if (query.length >0) {
		url = searchUrl[index];
		url = url.replace(/%QUERY%/,escape(query));
	} else {
		url = noQuerySearchUrl[index];
		url = url.replace(/%QUERY%/,"");
	}
	window.open(url);
}
/*
** PA 3024
** @function: prePreSubmit fuer Module
*/
function prePreSubmit(formname,imageUrl,searchtListParameterId,searchtListParameterExtensionId,counterSearchtListElement) {
	if(searchtListParameterId.length>0 && searchtListParameterExtensionId.length>0) {
		//START: set input field value for submit
		for(var i = 0; i < counterSearchtListElement; i++) {
			var searchtListParameter = document.getElementById(searchtListParameterId + i);
			var searchtListParameterExtension = document.getElementById(searchtListParameterExtensionId + i);
			if(searchtListParameter && searchtListParameterExtension) {
				if(searchtListParameter.value && searchtListParameterExtension.innerHTML) {
					searchtListParameter.value = searchtListParameter.value + ' ' + searchtListParameterExtension.innerHTML;
				}
			}
		}
		//END: set input field value for submit
		
		preSubmit(formname,imageUrl);
		
		//START: reset input field value
		for(var i = 0; i < counterSearchtListElement; i++) {
			var searchtListParameter = document.getElementById(searchtListParameterId + i);
			var searchtListParameterExtension = document.getElementById(searchtListParameterExtensionId + i);
			if(searchtListParameter && searchtListParameterExtension) {
				if(searchtListParameter.value && searchtListParameterExtension.innerHTML) {
					var index = searchtListParameter.value.indexOf(' ' + searchtListParameterExtension.innerHTML);
					searchtListParameter.value = searchtListParameter.value.substring(0, index);
				}
			}
		}
		//END: reset input field value
	}
	else
		preSubmit(formname,imageUrl);
}
/*
** @function: preSubmit fuer Module
*/
function preSubmit(formname,imageUrl) {
	if (imageUrl.length>0) {
		if (imageUrl.search(/%RANDOM%/)) {
			imageUrl = imageUrl.replace(/%RANDOM%/,Math.random() * 10000000);
		}
		trackImage = new Image();
		trackImage.src = imageUrl;
	}
	

	var actionField = null;
	var parentOfActionField = null;
	if (navigator.appName.match(/Microsoft/) && document.forms[formname].getAttribute('action').nodeType != null) {
		actionField = document.forms[formname].getAttribute('action');
		parentOfActionField = actionField.parentNode;
		actionField.parentNode.removeChild(actionField);
	}

	if (document.forms[formname].getAttribute('action').match(/^http:\/\//) && document.forms[formname].getAttribute('action').match(/(\?|\&)osc=[0-9]+(\|[^\&]+){0,1}/)) {
      var expr = /osc=([^\&]+)/;
      expr.exec(document.forms[formname].getAttribute('action'));
      var tmpStr = RegExp.$1;
      var tmpArr = tmpStr.split("|");

      this.cid = tmpArr[0];

      if (tmpArr.length > 1) {
        this.linkName = tmpArr[1];
      }
      
      document.forms[formname].setAttribute('action', document.forms[formname].getAttribute('action').replace("osc=" + tmpStr, ""));
      customLinkTracking();
	}

	if (actionField != null) {
		parentOfActionField.appendChild(actionField);
	}
	
	document.forms[formname].submit();
}
/*
** @function: Quickfinder preload
*/
function preloadImg(src) {
	var test = new Image();
	test.src = src;
}
/*
** @function: Quickfinder imageswop
*/
function swapImg(name,src) {
	if (Image) {
		document.images[name].src = src;
	}
}
/*
** @function: rectangle: Check Ad
*/
function adExists(where) {
	var adInside = false, i=0;
		
	for (i = 0; i < where.childNodes.length; i++) {
		switch (where.childNodes[i].nodeName) {
			case "IMG":    adInside = true; break;
	   		case "IFRAME": adInside = true; break;
	   		case "OBJECT": adInside = true; break;
	   		case "EMBED":  adInside = true; break;
	   		case "SCRIPT": adInside = true; break;
	   	}

		if (!adInside && where.childNodes[i].hasChildNodes()) {
			adInside = adExists(where.childNodes[i]);
		}
	}
	return adInside;
}

/*
** @function: check if a DIV with class=className exists below node "where"
*/

function ClassExistsIn(where,className) {
			var adInside = false, i=0;
		
	for (i = 0; i < where.childNodes.length; i++) {
		if (where.childNodes[i].nodeName == 'DIV') {

						
			var attrNode = where.childNodes[i].getAttributeNode("class");
			var classNode = where.childNodes[i].getAttribute("className");
			if (classNode == null) {
				classNode = where.childNodes[i].getAttribute("class");
			}
			if ((classNode != null) && (classNode.indexOf(className)>=0)) {
				adInside = true;
			}
	   	}

		if (!adInside && where.childNodes[i].hasChildNodes()) {
			adInside = ClassExistsIn(where.childNodes[i],className);
		}
	}
	return adInside;
}

/*
** @function: Check if Border should be displayed.
*/
function checkRectangleBorder() {
	var rectangle = document.getElementById('rectangleBorder');
	if (!adExists(document.getElementById('rectangleContent'))) {
				
		document.getElementById('rectangleContent').style.display="none";	
		one = ClassExistsIn(document.getElementById('module1'),"module");
		two = ClassExistsIn(document.getElementById('module2'),"module");
		three = ClassExistsIn(document.getElementById('module3'),"module");
				
		if (one) document.getElementById('module1').style.display="block";
		if (two) document.getElementById('module2').style.display="block";
		if (three) document.getElementById('module3').style.display="block";	

		//alert("module1||module2||module3:" + one + " " + two + " " + three);
		
		if (one||two||three) {
				rectangle.style.display="block";
		}
		if (one&&(two||three)) {
			try {
				document.getElementById('rectangleModuleSeparator1').style.display="block";
			} catch(e) {}	
		}
		if (two&&three) {
			try {
				document.getElementById('rectangleModuleSeparator2').style.display="block";
			} catch(e) {}	
		}
				
	 } else {  // has rectangle
		  //alert("rectangle:true");
          /*
			try { // img width=1 height=1
			 var pattern= "(img)|(IMG) |(object) |(embedded)";
			 var rectNode = document.getElementById("rectangleContent").childNodes;
			 for(var i=0;i<rectNode.length;i++) {
				 if(rectNode[i].nodeName.toLowerCase().match(pattern)) {
					 if(rectNode[i].width > 1 || rectNode[i].height > 1) {
						 rectangle.style.display="block";
					 }
				 }
			 }
			} catch(e) {}*/
			rectangle.style.display="block";
   }	
}

/*
** @function: Check if Border should be displayed.
*/
function checkRectangleBorder2() {
	var rectangle = document.getElementById('rectangleBorder');
	
		var two=adExists(document.getElementById('rectangleContent'));
        /*
		try { // img width=1 height=1
			 var pattern= "(img)|(IMG)";
			 var rectNode = document.getElementById("rectangleContent").childNodes;
			 for(var i=0;i<rectNode.length;i++) {
				 if(rectNode[i].nodeName.toLowerCase().match(pattern)) {
					 if(rectNode[i].width == 1 || rectNode[i].height == 1) {
						 two = false;
					 }
				 }
			 }
		} catch(e) {}*/
		
		var one = ClassExistsIn(document.getElementById('module1'),"module");
				
		if (one) document.getElementById('module1').style.display="block";

		//alert("rectangle||module1:" + two + " " + one);		
		if (one&&two) {
			try {
				document.getElementById('rectangleModuleSeparator1').style.display="block";
			} catch(e) {}	
		} 
		if (one||two) {
			rectangle.style.display="block";
			if(!two) {
				document.getElementById('rectangleContent').style.display="none";
			}	
		}
}

/*
** @function: Changes the position of rectangle to 2nd if not on 2nd.
*/
function fixRectangle() {
	var rect = document.getElementById("rectangleContainer");
	
	if(rect) {
		var nextSib = rect;
		var parent = rect.parentNode;
		
		var child = parent.firstChild;
		
		var gotSpacer = false;
		while(!gotSpacer) {
			if(child.className == "spacer") gotSpacer = true;
			if(child.id == "rectangleContainer") break;
			if(child.nextSibling) {
				child = child.nextSibling;
			} else {
				break;
			}
		}
		
		if(!gotSpacer) {
			var gotSecDiv = 0;
			while(gotSecDiv < 1) {
				if(nextSib.nextSibling) {
					nextSib = nextSib.nextSibling;
					if(nextSib.nodeName == "DIV" && nextSib.className == "spacer") gotSecDiv++;
					
				} else {
					return;
				}
			}

			parent.removeChild(rect);
			parent.insertBefore(rect,nextSib.nextSibling);
		}
	}
}

/*
**	@function: f?gt einen Eintrag zu den Firefox-Suchmaschinen hinzu
**  leer ist, gibt die funktion true zur?ck. Erstes Argument ist der form-name.
*/

function addEngine(name,ext,cat,type) {
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")){
    window.sidebar.addSearchEngine("http://suche.aol.de/suche/searchplugins/"+name+".src", "http://suche.aol.de/suche/searchplugins/"+name+"."+ext, name, cat );
  } else {
    alert("Sie ben?tigen Firefox oder Netscape ab Version 6 um dieses Plugin zu verwenden.");
  }
}

function addEngineLink(name,text,prefix,suffix) {
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")){
		document.write(prefix);
		document.write("<a href=\"javascript:addEngine('"+name+"','png','web',0)\">"+text+"</a>");
		document.write(suffix);
	}
}

/**
 * Oeffnet die HighSpeed Templates
 */
function openPlayer(url) {
	if (url && url.indexOf("/templates/hs_dalailama.jsp")==0 ) {
		url = url.replace(/pmmsId=/,"video=");
		url = window.location.protocol+"//"+window.location.host+"/index"+ url.substring(23);
        var x = window.open(url,"EmbeddedPlayer");
        x.focus();
		return;
	}

	var resX = screen.width;
	var resY = screen.height - 200;
	var posX = Math.round((resX - 612)/2);
	var posY = Math.round((resY - 391)/2);
	var x = window.open(this.location.protocol + '//' + this.location.host + url,"FuguPlayer","width=612,height=391,left="+posX+",top="+posY+",location=no,menubar=no,status=no,toolbar=no,scrollbars=no");
	x.focus();
} 

/**
 * Oeffnet die HighSpeed HQ Templates
 */
function openPlayerHQ(url) {
	var posX = 10;
	var posY = 10;
	var x = window.open(this.location.protocol + '//' + this.location.host + url,"HQFuguPlayer","width=990,height=613,left="+posX+",top="+posY+",location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no");
	x.focus();
}

/**
*** funktionen f. Welcomescreen (Anpassung der H?he von Boxen)
*/
function adjustBoxHeight(cid1,cid2) {
	var obj1 = "box_" + cid1;
	var obj2 = "box_" + cid2;
	h1 = getObjectHeight(document.getElementById(obj1));
	h2 = getObjectHeight(document.getElementById(obj2));
	if (h1 > h2) { 
	  setBoxHeight(cid2,h1);
	  setBoxHeight(cid1,h1);
	  return
	} else if (h1 < h2) {
	  setBoxHeight(cid1,h2);
	  setBoxHeight(cid2,h2);
	  return
	}
}
function setBoxHeight(cid,height) {
	element = document.getElementById("box_"+cid);
	element.style.height = height + "px";
}


// 7d Geraffel fuer Roster (ijaeg, jkrut)
var ad = '';
var ro = '';
var targetKeys = '';
var im_showroom = '';

if (document.cookie.match(/sdrcmd=[^;\s]+/)) {
        sdrcmdPattern = /sdrcmd=([^;\s]+)/;
        sdrcmdPattern.exec(document.cookie);
        sdrcmd = unescape(RegExp.$1);

        if (sdrcmd.match(/AD=[^;\s]+/)) {
                adPattern = /AD=([^;\s]+)/;
                adPattern.exec(sdrcmd);
                ad = RegExp.$1;
                ad = ad.replace(/,/g,"+");
        }

        if (sdrcmd.match(/RO=[^;\s]+/)) {
                roPattern = /RO=([^;\s]+)/;
                roPattern.exec(sdrcmd);
                ro = RegExp.$1;
                ro = ro.replace(/,/g,"+");
        }
        if (ro.length>0) targetKeys = ro;
        //if (ro.length>0 && ad.length>0) targetKeys += "+";
        //if (ad.length>0) targetKeys += ad;
}

if (document.cookie.match(/im_showroom=[^;\s]+/)) {
        showroomPattern = /im_showroom=([^;\s]+)/;
        showroomPattern.exec(document.cookie);
        im_showroom = unescape(RegExp.$1);
}

// 7d Geraffel Ende

//AIM Expressions
var bartIDs;
function setExpr(n,t) {
	var PUC_URL = 'http://puccexp.aol.com/set_expressions.adp?';
	bartIDs = n.split('|');
	for(i=0;i<bartIDs.length;i++) PUC_URL += (i<bartIDs.length-1)?'bartId='+bartIDs[i]+'&':'bartId='+bartIDs[i];
	var myContent = document.getElementById('fullContent');
	if(myContent!=null) {
		if(document.getElementById('exprFrame')==null) {
			var exprFrame = document.createElement("iframe");
			exprFrame.src=PUC_URL;
			exprFrame.id='exprFrame';
			exprFrame.style.display='none';
			myContent.appendChild(exprFrame);
		} else {
			document.getElementById('exprFrame').src=PUC_URL;
		}
		if(document.getElementById('aDiv_MyPers')!=null) {
			if(t == 1) {
				window.setTimeout('refreshPics(\'buddySymbol\')',2000);
			} else if(t == 2) {
				window.setTimeout('refreshPics(\'buddyBackground\')',2000);
			} else if(t == 4) {
				window.setTimeout('getBartID()',2000);
			} else if(t == 0) {
				window.setTimeout('refreshPics(\'buddySymbol\')',2000);
				window.setTimeout('refreshPics(\'buddyBackground\')',2000);
				window.setTimeout('getBartID()',2000);
			}
		}
	}
}
var winMyPers;
var intMyPers;
function openChooser(n) {
	var AIM_EXPR_URL = "http://aolexpressions.aol.com/main.adp?clientId=15&expTypeId=";
   	var chooserParam = n.split("|");
	if (chooserParam.length==3) {
		AIM_EXPR_URL += chooserParam[0]+'&catid='+chooserParam[1]+'&subcatid='+chooserParam[2];
	} else if (chooserParam.length==2)  {
		AIM_EXPR_URL += chooserParam[0]+'&catid='+chooserParam[1];
	} else {
		AIM_EXPR_URL += chooserParam[0];
	}
	if(document.getElementById('aDiv_MyPers')!=null) intMyPers = window.setInterval('checkMyPersChooser('+n+')', 1000);
	winMyPers = window.open(AIM_EXPR_URL,'chooser','width=736, height=395, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no');
    winMyPers.focus();
}
function playExprSound(s){
	var EXPR_SND_URL = "http://cdn.digitalcity.com/se/2/imsnd/"+s+"/sound.mp3";
	var myContent = document.getElementById('fullContent');
	if(myContent!=null) {
		var sDiv = document.getElementById('sndDiv');
		if(sDiv==null) {
			var sDiv = document.createElement("DIV");
			sDiv.id='sDiv';
			sDiv.style.display = 'inline';
			myContent.appendChild(sDiv);
		}
		if(navigator.userAgent.toLowerCase().indexOf('msie') >= 0) {
			sDiv.style.display = 'none';
		    sDiv.innerHTML = 'sound<bgsound type=audio/mpeg src="'+EXPR_SND_URL+'" loop=false>';
		} else {
		    sDiv.innerHTML = '<embed type=audio/mpeg src="'+EXPR_SND_URL+'" autostart=true width=0 height=0 hidden=true></embed>';
		}		
	}
}


/*
** @function: Changes the position of rectangle to 2nd if not on 2nd.
*/


var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
    }
}

// Limiting Invasives (ijaeg)
var maxViews   = 99;         // maximum number of invasive ads to be delivered
var minTime    = 60;       // minimum time in seconds between delivery of invasive ads
var scopeViews = "Channel"; // scope of maxViews limiter ("channel" or "global")
var scopeTime  = "Global";  // scope of minTime limiter ("channel" or "global");

function deliverInvasiveAd(performAll) {
	if (document.cookie.match(/im_showroom/)) return true;
	if (document.cookie.match(/invasive=(\d+)/) && (new Date).getTime() < parseInt(RegExp.$1) + minTime * 1000) return false;

	if (document.cookie.match(/invasiveCnt=(\d+)/)) {
		var cnt = parseInt(RegExp.$1);
		if (cnt < maxViews) {
			setInvasiveCookies(cnt+1, performAll);
			return true;
		}
		else {
			return false;
		}
	}
	else {
		setInvasiveCookies(1, performAll);
		return true;
	}
}

function setInvasiveCookies(cnt, performAll) {
	if (!performAll) return;
	
	if (scopeViews == "Channel") {
		document.cookie = "invasiveCnt=" + cnt + "; path=/";
	}
	else if (scopeViews == "Global") {
		document.URL.match(/\/\/[^\/]+?([^\.\/]+\.[^\.\/]{2,3})\//);
		var brand = RegExp.$1;
		document.cookie = "invasiveCnt=" + cnt + "; path=/; domain=" + brand;
	}
	
	if (scopeTime == "Channel") {
		document.cookie = "invasive=" + (new Date()).getTime() + "; path=/";
	}
	else if (scopeTime == "Global") {
		document.URL.match(/\/\/[^\/]+?([^\.\/]+\.[^\.\/]{2,3})\//);
		var brand = RegExp.$1;
		document.cookie = "invasive=" + (new Date()).getTime() + "; path=/; domain=" + brand;
	}
}

// Limiting Invasives Ende

function setHomepage(homepageurl,popupurl,popupw,popuph) {
  if (navigator.appName.indexOf("Explorer") != -1){
    document.getElementsByTagName("A")[0].style.behavior='url(#default#homepage)';
    document.getElementsByTagName("A")[0].setHomePage(homepageurl);
  } else {
    generic_Popup(popupurl,popupw,popuph);
  }
}  


/*
 * function to load javascript file by given source url, needed by PA13383 for big files in adtech templates
 */
   function insertJS(src) {
      var jslink = document.createElement('script');
      jslink.type = 'text/javascript';
      jslink.src = src;
      document.write("<scr"+"ipt type='text/javascript' src='"+src+"'></scr"+"ipt>");
   }
