function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function writetalkplusAd(ly_nr, layer_id, vp_nr) {
	document.write('<div id="'+layer_id+'" style="width:700px; height:466px; position:absolute; top:-470px; left:-50px; margin:0px; cursor:pointer; z-index:999; visibility:visible; border-left:solid #999999 1px; border-right:solid #999999 1px; border-top:solid #999999 1px; font-family: Trebuchet MS, Verdana; background-color:#ffffff;"><div style="position:relative;"><a href="http://www.mobildiscounter.de/banner/aktion/redirect/bannerlayerad'+ly_nr+'/'+vp_nr+'.htm" target="_blank" onclick="MM_findObj(\''+layer_id+'\').style.visibility = \'hidden\';"><img src="http://www.mobildiscounter.de/banner/aktion/Layer_700x450Px_'+ly_nr+'_talkplus.jpg" border="0"></a></div><h5 style="border-bottom:solid #999999 1px; border-top:solid #999999 1px; display:block; height:15px; padding-left:5Px; margin:0Px; font-family: Trebuchet MS, Verdana;"> W E R B U N G <a style="position:absolute; bottom:0Px; right:5Px; height:15px; float:right;" title="Fenster zu!" onClick="MM_findObj(\''+layer_id+'\').style.visibility = \'hidden\';" onMousOver="window.status=\'Fenster zu!\'">Close X</a></h5></div>');
	obj = MM_findObj(layer_id);
	slidePos(obj);
	return true;
}
function slidePos(obj) {
	var hoehe;
	if ((window.innerWidth) && (window.innerWidth != 0)) breite=window.innerWidth;
	else {if (document.body.clientWidth) breite=document.body.clientWidth;}
	if ((window.innerHeight) && (window.innerHeight != 0)) hoehe=window.innerHeight;
	else {if (document.documentElement.clientHeight) hoehe=document.documentElement.clientHeight;}
	var top_end = 250;
	var left_end = 200;
	if ((hoehe != 0) && (hoehe != 0)) {
		if ((470 + top_end)> hoehe) top_end = hoehe-470;
	}

	if(parseInt(obj.style.top) < top_end){
		obj.style.top = parseInt(obj.style.top) + 10 + "px";
		if(parseInt(obj.style.left) < left_end){
			obj.style.left = parseInt(obj.style.left) + 2 + "px";
		}
		setTimeout("slidePos(obj)",10);
	}
}
function setRandom(){
	return Math.round(Math.random()*(122-48))+48;
}
function zufall(z){
          var chars = new Array();
          var x=0;
          var y=0;
          
          while(chars.length!=z){
              var num =  setRandom();
              if((num>47 && num<58) || (num>65 && num<91) || (num>96 && num<123)){
                  if((num>47 && num<58)&&(x<2)){
                      chars.push(String.fromCharCode(num));
                      x++;
                  }else if(y<z-2){
                      chars.push(String.fromCharCode(num));
                      y++;
                  }
              }
          }
          return chars.join('');
}
