//
// richmedia.js
// V.1.26  2007-07-26
//
// Copyright (C) TENSQUARE (www.tensquare.de)
//

//
// General
//
var tsrmNavName = navigator.appName;
var tsrmNavVers = navigator.appVersion ? parseInt(navigator.appVersion) : 0;
var tsrmAgt = navigator.userAgent.toLowerCase();
var tsrmNS4 = (document.layers) ? 1 : 0;
var tsrmNS2 = (tsrmNavName && tsrmNavName.indexOf("Netscape")>=0 && tsrmNavVers==2);
var tsrmIE4up = (document.all && !window.opera) ? 1 : 0;
var tsrmIE4 = (tsrmIE4up && (tsrmAgt.indexOf("msie 4")>=0));
var tsrmIE5 = (tsrmIE4up && (tsrmAgt.indexOf("msie 5")>=0));
var tsrmIE6 = (tsrmIE4up && (tsrmAgt.indexOf("msie 6")>=0));
var tsrmIE5up = (tsrmIE4up && !tsrmIE4);
var tsrmOpera = (window.opera) ? 1 : 0;
var tsrmOp7 = (tsrmOpera && document.childNodes) ? 1 : 0;
var tsrmOp5 = (tsrmOpera && !tsrmOp7);
var tsrmNS6 = (!tsrmIE4up && document.getElementById) ? 1 : 0;
var tsrmNS4up = (tsrmNS4 || tsrmNS6);
var tsrmNS6up = tsrmNS6;
var tsrmMac = (tsrmAgt.indexOf('mac')>=0);

// PagePerf
var PPStart = new Date();
var PPQuotaPercent = 10.0;

function TSRMInsert(content) { document.write(content); }
function TSRMFindObj(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=TSRMFindObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x;}
function TSRMShowObj() {var i,p,v,obj,args=TSRMShowObj.arguments;for(i=0;i<(args.length-2);i+=3) if((obj=TSRMFindObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v)?'visible':(!v)?'hidden':v;}obj.visibility=v;}}
function TSRMMoveObj(n,d,x,y) {var obj,w,h;var args=TSRMMoveObj.arguments;w=(args.length>4)?args[4]:-1;h=(args.length>5)?args[5]:-1;if((obj=TSRMFindObj(n,d))!=null){if(tsrmNS4||tsrmIE4){obj.left=x;obj.top=y;if(w>=0)obj.width=w;if(h>=0)obj.height=h;}else if(tsrmNS6up||tsrmIE5up){with(obj.style){left=x+"px";top=y+"px";if(w>=0)width=w+"px";if(h>=0)height=h+"px";}}}}
function TSRMSizeObj(n,d,w,h) {var obj;if((obj=TSRMFindObj(n,d))!=null){if(tsrmNS4||tsrmIE4){obj.width=w;obj.height=h;}else if(tsrmNS6up||tsrmIE5up){with(obj.style){width=w+"px";height=h+"px";}}}}
function TSRMPropStrToInt(p) {if((p==null)||(p==""))return 0;if(isNaN(p)){var i=p.indexOf("px");return (i > 0)?parseInt(p.substring(0,i)):0;}return parseInt(p);}
function TSRMObjPos(n,obj) {var sX="",sY="",sW="",sH="",o=(obj)?obj:TSRMFindObj(n),oS=null;this.x=0;this.y=0;this.w=0;this.h=0;if(!o)return this;oS=(tsrmNS4)?o:o.style;if(!oS)return this;sX=eval("oS.left");sY=eval("oS.top");if(tsrmOpera){sW=oS.pixelWidth;sH=oS.pixelHeight;}else if(tsrmIE4up){if(n==null||n=="")n=o.id;if((sX=="")||(sY=="")){sX=eval(n+".offsetLeft");sY=eval(n+".offsetTop");}sW=eval(n+".offsetWidth");sH=eval(n+".offsetHeight");}else if(tsrmNS6up){with(document.defaultView.getComputedStyle(o,"")){sW=getPropertyValue("width");sH=getPropertyValue("height");}}else if(tsrmNS4){sW=eval("o.clip.width");sH=eval("o.clip.height");}this.x=TSRMPropStrToInt(sX);this.y=TSRMPropStrToInt(sY);this.w=TSRMPropStrToInt(sW);this.h=TSRMPropStrToInt(sH);return this;}
function TSRMObjAbsPos(n,obj){var o=(obj)?obj:TSRMFindObj(n);this.x=0;this.y=0;this.w=0;this.h=0;if(o){r=new TSRMObjPos("",o);this.w=r.w;this.h=r.h;if((tsrmIE5up||tsrmNS6up)&&!tsrmMac){this.x=o.offsetLeft;this.y=o.offsetTop;var p=o.offsetParent;while(p!=null){this.x+=p.offsetLeft;this.y+=p.offsetTop;p=p.offsetParent;}if(tsrmIE5up){this.x-=7;this.y-=7;}}}}
function TSRMFollowLink(ID) {var a = (document.getElementById) ? document.getElementById(ID) : TSRMFindObj(ID); if (!a) { return false; } /* else if (a.click) { a.click(); return true; } */ else if (a.href) { if (a.target && (a.target=="_blank")) window.open(a.href); else location.href=a.href; return true; } }
function TSRMGetURLPar(URL,ParName){var i,q,p,pl; if((i=URL.indexOf("?"))<0) return ""; q=URL.substring(i+1,URL.length); p=q.split("&"); ParName+="="; for(i=0,pl=ParName.length;i<p.length;++i) { if (p[i].substr(0,pl)==ParName) return p[i].substr(pl,p[i].length); } return ""; }
function TSRMOpenExternalWindow(URL,Name,W,H,Status,Scrollbars,Toolbar,Menubar,Focus){var s,sc,tb,mb,win;s=(Status)?"yes":"no";sc=(Scrollbars)?"yes":"no";tb=(Toolbar)?"yes":"no";mb=(Menubar)?"yes":"no";win=window.open(URL,Name,"width="+W+",height="+H+",status="+s+",scrollbars="+sc+",toolbar="+tb+",menubar="+mb+",resizable=yes");if(Focus && win && win.focus)win.focus();}
function TSRMSetWindowSize(ClientW,ClientH,Win) {var w=(Win)?Win:self;var b=w.document.body;if(w.innerWidth && !tsrmOpera){w.innerWidth=ClientW;w.innerHeight=ClientH;}else if(b && b.clientWidth){w.resizeBy(ClientW-b.clientWidth,ClientH-b.clientHeight);}}
function TSRMPreloadImg() {if(document.images){if(!document.imgCache)document.imgCache=new Array();var i,j=document.imgCache.length,args=TSRMPreloadImg.arguments;for(i=0;i<args.length;i++){if(args[i].indexOf("#")!=0){document.imgCache[j]=new Image;document.imgCache[j++].src=args[i];}}}}
function TSRMShowCbIE (ID, show) { if (document.all && document.getElementById) { var cb = TSRMFindObj(ID); if (!cb) return; if (cb.type && (cb.type == "select-one")) cb.style.visibility = (show) ? "visible" : "hidden"; } }
function TSRMPPMeasurePage() {var PPStop,Ti,Img,Ref;var PPURI="/wws/?id=pageperf"; PPStop=new Date();if(!PPStart || (Math.floor(PPStop.getTime()/10)%100 > PPQuotaPercent-1))return;Ti=PPStop.getTime()-PPStart.getTime();Ref=escape(location.pathname+location.search);Img=new Image();Img.src=PPURI+"&data="+Ti+"&r="+Ref+"&rs="+PPStop.getTime();}
function TSRMInitPage() {if (window.TSRMLocalInitPage) window.TSRMLocalInitPage(); TSRMPPMeasurePage();}

var swfPluginOk = false;
function TSRMCheckFlashPlugin(Version) { var p = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0; 	if (p) 	{ var tokens = p.description.split(" "); for (var i = 0; i < tokens.length; ++i) { var	flashVersion = parseInt(tokens[i]); if (isNaN(flashVersion)) continue; swfPluginOk = flashVersion > Version; break; } }
 else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) { var s = '<SCRIPT LANGUAGE=VBScript\> \non error resume next \nswfPluginOk = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+Version+'")))\n</SCRIPT\> \n'; document.write(s); } return (swfPluginOk); }
function TSRMInsertFlashAd(src,fv,altsrc,alttxt,id,w,h,curl,ctpar,target,bgcol) 
{
	var clickTagPar = (ctpar && (ctpar != "")) ? ctpar : "clickTAG";
	if (!curl) curl = ""; else if (curl != "") src += "?" + clickTagPar + "=" + curl; if (!target || (target == "")) target = "_blank"; if (!alttxt) alttxt = ""; if (!w) w = ""; if (!h) h = ""; if (!id) id = ""; if (!bgcol) bgcol = ""; if (!fv || (fv <= 0)) fv = 6;
	if (TSRMCheckFlashPlugin(fv))
	{
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + fv + ',0,0,0" id="' + id + '" width="' + w + '" height="' + h + '"><param name="movie" value="' + src + '" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="bgcolor" value="#' + bgcol + '" /><param name="allowScriptAccess" value="always" /><embed allowScriptAccess="always" src="' + src + '" quality="high" wmode="opaque" bgcolor="#' + bgcol +'" swliveconnect="false" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
		return true;
	}
	
	if (altsrc && (altsrc != ""))
	{
		if (curl != "")
			document.write('<a href="' + curl + '" target="' + target + '">');
		if (w != "") w = ' width="' + w + '"';
		if (h != "") h = ' height="' + h + '"';
		document.write('<img src="' + altsrc + '" alt="' + alttxt + '"' + w + h + ' border="0" />');
		if (curl != "")
			document.write('</a>');
	}
	return false;
}

//
// richmedia_dropdownad.js
// V.1.02  2006-10-25
//
// Copyright (C) TENSQUARE gmbh (www.tensquare.de)
//

function TSRMInsertDropDownAd (ID, ImgSrc, DropImgSrc, ImgW, ImgH, DropImgW, DropImgH, ClickURL, Target, AltText)
{
  var DLID = ID + "_droplayer";
  document.write('<div style="position:relative: width:100%"><div id="' + ID + '" style="border:0; margin:0; padding:0; width:468px; height:60px;"><a href="' + ClickURL + '" target="' + Target + '" onmouseover="TSRMDDAShow(\'' + ID + '\')"><img name="' + ID + 'xx" id="' + ID + 'xx" src="' + ImgSrc + '" width="' + ImgW + '" height="' + ImgH + '" style="position:relative;" border="0" alt="' + AltText + '"></a></div></div>');
  if ((tsrmIE4up || tsrmNS6up) && !tsrmMac)
  {
    document.write('<div id="' + DLID + '" name="' + DLID + '" style="visibility:hidden; border:none; margin:0; padding:0; position:absolute; z-index:995">');
    document.write('<a href="' + ClickURL + '" target="' + Target + '" onmouseout="TSRMDDAHide(\'' + ID + '\')"><img name="' + ID + '_drop" id="' + ID + '_drop" src="' + DropImgSrc + '" width="' + DropImgW + '" height="' + DropImgH + '" border="0" alt="' + AltText + '"></a>');
    document.write('</div>');
  }
}

function TSRMDDAShowHitlistCb (show) { TSRMShowCbIE("adressType", show); TSRMShowCbIE("district", show); TSRMShowCbIE("radius", show); }
function TSRMDDAShow (ID) { if (!(tsrmIE4up||tsrmNS6up) || tsrmMac) return; var ImgPos = new TSRMObjAbsPos(ID), DLID = ID + "_droplayer"; TSRMMoveObj(DLID, null, ImgPos.x, ImgPos.y); TSRMShowObj(DLID, null, true); TSRMDDAShowHitlistCb(false); }
function TSRMDDAHide (ID) { TSRMShowObj(ID + "_droplayer", null, false); TSRMDDAShowHitlistCb(true); }

