////////////////////////////////////////////////////////////////////////////////////
//  Megapublic JavaScript library 1.2
//  Copyright 1999-2002 Megapublic Inc. Basel, Switzerland. All rights reserved.
//
//	Downloading and utilization of this library is strictly forbidden without prior
//  written agreement by Megapublic Incorporated.
//	All online activities are logged.
//
//  Author: Philippe Wiede (subscribed2@megapublic.com).  Last modified 2002-07-13.
////////////////////////////////// Globals ///////////////////////////////////////
	
	var agt = navigator.userAgent.toLowerCase();
	var bNS = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible')==-1)));
	var bLinux = ((agt.indexOf('konqueror')!=-1));
	var bLinuxNS = ((agt.indexOf('linux')!=-1));
	var bMIE = ((agt.indexOf('msie')!=-1));
	var bMac = ((agt.indexOf('mac')!=-1));
	var bMacMIE5 = ( (agt.indexOf('msie 5.')!=-1) || (agt.indexOf(' msie 6.')!=-1) );
	var bOpera = ((agt.indexOf('opera')!=-1));
	if ((bMIE) || (bOpera)) bNS = '';
	var bVersion = parseInt(navigator.appVersion);
	if (bMIE) {
		if (agt.indexOf('msie 2.')>=0) { bVersion = 2; }
		else if (agt.indexOf('msie 3.')>=0) { bVersion = 3; }
		else { bVersion += 1; }
	}

	var DateObj = new Date();
	var bStartTime = DateObj;
	bStartTime = bStartTime.getTime();
	var bWin   = ( (agt.indexOf('win')!=-1) || (agt.indexOf('16bit')!=-1) );
	var bWin16 = ( (agt.indexOf('win16')!=-1) || (agt.indexOf('16bit')!=-1) || (agt.indexOf('windows 3.1')!=-1) || (agt.indexOf('windows 16-bit')!=-1) );
	var bWin32 = bWin && ( 
		!bWin16 || (agt.indexOf('2000')!=-1) || (agt.indexOf('xp')!=-1) || (agt.indexOf(' nt')!=-1) || 
		(agt.indexOf('98')!=-1) || (agt.indexOf(' ce')!=-1) || (agt.indexOf(' me')!=-1) || (agt.indexOf('95')!=-1) ||
		(agt.indexOf('win 9x')!=-1) || (agt.indexOf('win32')!=-1) || (agt.indexOf('32bit')!=-1)
	); 
	var bNav_size,bScr_size,bColord,bMIEpdf,bFlashVs = 0;
	var bFlashMime = eval( navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin );
	var bFlashVoid = 1;
	var bFlashMaxVs = 9;
	function OmitError(){ return true; }
	window.onerror = OmitError;
	
	// Fix stubborn Netscape 4 resize bug 
	function resizeFix(){  
	if (document.resizeFix.initWidth!=window.innerWidth ||document.resizeFix.initHeight!=window.innerHeight) {
		document.location=document.location; }
	}  
	function checkBrowser(){  
 	if (document.layers) {  
    	if (typeof document.resizeFix=="undefined") {  
     	document.resizeFix=new Object();  
    	document.resizeFix.initWidth=window.innerWidth;  
     	document.resizeFix.initHeight=window.innerHeight;  
      	}  
	window.onresize=resizeFix; }  
	}  
	if (bNS) checkBrowser();

//////////////////////////////// Source Protection Attempt /////////////////////////////

	// Disable Frame Nesting
	if (top.location != self.location) {
		{ top.location = self.location }
	}
	
	// Redirect remote cache lookups to the server
	var servername = 'http://' + document.domain + '/';
	if ( (top.location.indexOf(servername)!=-1) ) { top.location = servername; }
	
	// disable the context menu for as many instances as possible in a page. Dito for as many browser versions and platforms.
	document.oncontextmenu = function() { return false; }
	if (document.layers) {
    	window.captureEvents(Event.MOUSEDOWN);
    	window.onmousedown = function(e) {
    	    if (e.target == document) return false;
    	}
	} else {
    	document.onmousedown = function() { return false; }
	}

function hp_drc(e) {
	if (document.all) {
		if ((event.button == 2)||(event.button == 3)) { 
			alert("A Runtime Error has occurred. Function not available.");
			return false;
		}
	}
	// A Runtime Error has occurred. Stack overflow in object 547. It is recommended that you first quit and then restart this application.
	
	if (document.layers) {
		if (e.which == 3) {
			alert("A Runtime Error has occurred. Function not available.");
			return false;
		}
	}
}
	if	(document.layers) {
		document.captureEvents(event.mousedown);
	}
	document.onmousedown = hp_drc;
	document.onselectstart = new Function("return false");

function hp_nls() {
	window.status = "";
	setTimeout("hp_nls()",10);
}
	hp_nls();

function hp_dp1() {
	for (i=0;i < document.all.length;i++) {
		if (document.all[i].style.visibility !="hidden") {
			document.all[i].style.visibility  ="hidden";
			document.all[i].id = "hp_id";
		}
	}
}

function hp_dp2() {
	for (i=0;i < document.all.length;i++) {
		if (document.all[i].id == "hp_id") {
			document.all[i].style.visibility = "";
		}
	}
}
	window.onbeforeprint = hp_dp1;
	window.onafterprint  = hp_dp2;

//////////////////////// Preload swap images & status bar messages /////////////////
	var S = new Array (
//				"/images/titelbildhome",
//                "/images/titelbildservices",
//                "/images/panorama4",
//                "/images/panorama3",
//                "/images/panorama2",
//                "/images/panorama1"
				);
//	if (document.images) {LoadImg(); }
	
	// Function Image Load
	function LoadImg() {
	I = new Array ();
	var suffix = '.jpg';
		for (i in S) {
		I[i] = new Image();
		//if (S[i].indexOf('-jpg-')>=0) { suffix = '.jpg'; }
		I[i].src = S[i] + suffix;
 		}
	}
	// Function Rollover & Status On
	function FXon(iname,idx,mesg) {
	window.status = T[idx];
		if (document.images) {
		iname.src = I[idx].src;
		}
	}
	// Function Rollover & Status Off
	function FXoff(iname,idx) {
	window.status='';
		if (document.images) {
		iname.src = I[idx].src;
  		} 
	}

//////////////////////////////// Plugin detection /////////////////////////////
	function PlugDetect() {
		if (bMIE) { 
			if (agt.indexOf('mac')>=0) {
				if (agt.indexOf('msie 5.')>=0) { bVersion = 5; bFlashVoid = 2; } else { bFlashVoid = 3; } 
			} else if (bWin16) { bFlashVoid = 4; }
		} else if (!bNS) { bFlashVoid = 5; }
  		if ( bMIE && bWin32 && !bWin16 ) {
			document.write('<S'+'CRIPT LANGUAGE="VBScript"\> \n');
			document.writeln('on error resume next');
			document.writeln('    If (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.2"))) Then');
			document.writeln(' bFlashVs = 2');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.3"))) Then');
			document.writeln(' bFlashVs = 3');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.4"))) Then');
			document.writeln(' bFlashVs = 4');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.5"))) Then');
			document.writeln(' bFlashVs = 5');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.6"))) Then');
			document.writeln(' bFlashVs = 6');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.7"))) Then');
			document.writeln(' bFlashVs = 7');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.8"))) Then');
			document.writeln(' bFlashVs = 8');
			document.writeln('ElseIf (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash.9"))) Then');
			document.writeln(' bFlashVs = 9');
			document.writeln('End If');
			// document.writeln('bMIEpdf = (IsObject (CreateObject ("PDF.PdfCtrl.1")))'); // launches Acro in IE Win!
			document.write('</S'+'CRIPT\> \n');
		} else if ( (bVersion==5||bFlashVoid==5||!bMIE) && bFlashMime ) {
			if (navigator.plugins['Shockwave Flash 2.0']) { 
				bFlashVs = 2;
			} else if (bFlashMime) {
				var bFlashDr = navigator.plugins['Shockwave Flash'].description;
				bFlashVs     = parseInt( bFlashDr.charAt(bFlashDr.indexOf('.')-1) );
				if (!bFlashVs) bFlashVs = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
			}
		} else if (bFlashMime) {
			var bFlashDr = navigator.plugins['Shockwave Flash'].description;
			bFlashVs     = parseInt( bFlashDr.charAt(bFlashDr.indexOf('.')-1) );
			if (!bFlashVs) bFlashVs = navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin;
		}
	}
///////////////////////////////// Date Function ////////////////////////////////////
	function GreetDate(disptype,lang,abbrev) {
	// disptype = t (time only), g (greeting only), '' (empty = both)
	// lang 	= d (german), e (english), f (french)
	// abbrev 	= s (time only in digits), '' (day & month spelled)
	var MonthsE  = new Array('Jan','Feb','March','April','May','June','July','Aug','Sep','Oct','Nov','Dec');
	var DaysE    = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var MonthsD  = new Array('Jan','Feb','M&auml;rz','Apr','Mai','Juni','Juli','Aug','Sep','Okt','Nov','Dez');
	var DaysD    = new Array('Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag');
	var MonthsF  = new Array('Jan','F&#233;v','Mars','Avr','Mai','Juin','Jui','Ao&#251;','Sep','Oct','Nov','D&#233;c');
	var DaysF    = new Array('Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi');
	var TimeObj = DateObj.getTime();
	DateObj.setTime(TimeObj);
	var TimeHr  = DateObj.getHours();
	var GreetE   = (TimeHr>17) ? 'Good Evening' : (TimeHr>11) ? 'Good Afternoon' : 'Good Morning';
	var GreetD   = (TimeHr>17) ? 'Guten Abend' : (TimeHr>11) ? 'Guten Tag' : 'Guten Morgen';
	var GreetF   = (TimeHr>17) ? 'Bonsoir' : (TimeHr>11) ? 'Bonjour' : 'Bon Matin';
	var Date 	= DateObj.getDate();
	var Year 	= DateObj.getYear();
	if (Year < 2000) Year = Year + 1900;
		if (!abbrev && lang == 'f') {
		var result = (disptype=='t'||!disptype) ? (DaysF[DateObj.getDay()] + ', ' + MonthsF[DateObj.getMonth()] + ' ' + Date + ', ' + Year) : '';
		return(result + (disptype=='g' ? (' - '+GreetF) : '') );
		} else if (!abbrev && lang == 'd') {
		var result = (disptype=='t'||!disptype) ? (DaysD[DateObj.getDay()] + ', ' + MonthsD[DateObj.getMonth()] + ' ' + Date + ', ' + Year) : '';
		return(result + (disptype=='g' ?  (' - '+GreetD) : '') );
		} else if (!abbrev) {
		var result = (disptype=='t'||!disptype) ? (DaysE[DateObj.getDay()] + ', ' + MonthsE[DateObj.getMonth()] + ' ' + Date + ', ' + Year) : '';
		return(result + (disptype=='g' ?  (' - '+GreetE) : '') );
		} else {
		var Month  = DateObj.getMonth() +1;
		if (Date < 10) Date = '0' + Date;
		var result = (Date + '.' + '0' + Month + '.' + Year + '<BR>');
		var messg  = (lang == 'd' ? GreetD : lang == 'f' ? GreetF : GreetE);
		return( result + messg );
		}		
	}
	
/////////////////////////////// Clicktracer Module /////////////////////////////////	
	function Tracer(arg,arg2) {
	PlugDetect();
	var defaultUrl = '/stats/clicktracer.gif'; // /stats/clicktracer.gif
	var path = !arg ? '<img src="'+defaultUrl : '<img src="'+arg;
		if (bVersion>=3){if (self.innerWidth){bNav_size = self.innerWidth+'x'+self.innerHeight;}
 			else if (document.all){bNav_size = document.body.clientWidth+'x'+document.body.clientHeight;}
			if (self.screen){bScr_size = screen.width+'x'+screen.height;
			(!bNS)?(bColord=screen.colorDepth):(bColord=screen.pixelDepth);}
			var servername = document.domain;
			var ul= path+'?js=1&nav_size='+bNav_size+'&scr_size='+bScr_size+'&colors='+bColord;var acro=qt='0';
			if (arg2) ul=ul+arg2;
			if (navigator.javaEnabled()){isjava='1';}else{isjava='0';}ul=ul+'&java='+isjava;
			if (!bMIE && !bOpera && navigator.plugins){if (navigator.plugins['PDFViewer']||navigator.mimeTypes['application/pdf'].enabledPlugin){acro='1';}if (navigator.plugins['QuickTime Plugin']||navigator.mimeTypes['video/quicktime'].enabledPlugin){qt='1';}ul=ul+'&flash='+bFlashVs+'&pdf='+acro+'&quicktime='+qt;
			}else{if (bMIE && bFlashVoid==1){acro=(bMIEpdf)?'1':'0';ul=ul+'&flash='+bFlashVs+'&pdf='+acro+'&quicktime=0';}else if (bMIE && bFlashVoid==2){ul=ul+'&flash='+bFlashVs+'&quicktime=1';}else{ul=ul+'&flash=Unknown';}
 		}
 	var bStopTime = new Date(); bStopTime = bStopTime.getTime(); ul=ul+'&refer='+escape(top.document.referrer)+'&vhost='+servername+'&loadtime='+((bStopTime - bStartTime) / 1000)+'" height="1" width="3" alt="" border="0">';document.write(ul);}
	}

 // -->