/*
(c) by insign - simply e-business
http://www.insign.ch - info(at)insign(puntk)ch

main js for container
created by km, sh
last change: sh, 3.10.2003

history
03.10.2003	sh	bugfix in flash start function
02.10.2003	km	added mouseover for left icons
01.10.2003	sh	initial release
*/

// set path var [START]
// creator 	sh	02.09.2003
// last change	
var markedNavi;

var pathVar = "/";
if (document.location.href.indexOf("tp://sites")>0)
	pathVar = "/uetikon.org/"; 
else 
	if(document.location.href.indexOf("tp://www.insign.ch/kunden/")>0)
		pathVar = "/kunden/uetikon.org/";
// set path var [END]

// set flash navigation [START]
// creator 	ps	02.09.2003
// last change	sh	03.10.2003
function setNav(vName)
{
	//alert("setNav("+vName+")");
	document.location.href="dyn_output.html?content.vname="+vName+"&SID="+SID;
}

function setNavFlash()
{
	if (looprun)
		NaviMarksFlash(markedNavi);
	looprun = false;	
}	



function NaviMarksFlash(markedNavi)
{
	var movie = isIE ? window.document.flashmenu : window.document.embeds['flashmenu'];
	movie.TGotoLabel('_flash0/allMovie',"label"+markedNavi);
	
}
// set flash navigation [END]

// check search form [START]
// creator 	ps	02.09.2003
// last change	
function goToSearch(myform)
{
	var searchstring = "";
	searchstring = myform.elements['search'].value;
	if (searchstring.length<3)
	{
		alert("Bitte geben Sie im Suchfeld mindestens 3 Zeichen ein.");
		return false;
	}
	else
	{
		myform.elements['keyword'].value = myform.elements['search'].value;
		return true;
	}
}
// check search form [END]

// start ticker [START]
// creator 	km	02.09.2003
// last change	sh	03.10.2003
var tickers = new Array();
function addTickerToStart(ticker)
{
	tickers[tickers.length] = ticker;
}

function startTickers()
{
	if (window.tickeronload)
		window.tickeronload();
	for(i=0;i<tickers.length;i++)
	{
		tickers[i].start();
	}
}
// overwrite onload handler... onLoad="startTickers();" not needed anymore

if (window.onload)
{
	window.tickeronload = window.onload;
	window.onload = startTickers();
}


// start ticker [END]

// layers [START]
// creator 	km	01.09.2003
// last change	
function popUpLayers (whichone)
{
	popItUp(whichone);
}
// layers [END]

// start flash [START]
// creator 	ps	02.09.2003
// last change	sh	03.10.2003
function startflash()
{		
	if (document.images && markedNavi != "0") 
		if(document.images["nav_" + markedNavi]) {
			document.images["nav_" + markedNavi].src = pic_on["nav_" + markedNavi].src;
		}
			
	if (window.flashonload)
		window.flashonload();
	// hier muss die variable loader im flash auf "true" gesetzt werden
	var film = isIE ? window.document.flashmenu : window.document.embeds['flashmenu'];
	
	if (hasRightVersion && flashanim == true && markedNavi != "0") {							
		film.SetVariable("loader", "go");
			
	}
}
if (window.onload)
	window.flashonload = window.onload;
	
window.onload = startflash;	

// start flash [END]

// debug function for objects and arrays
// wenn anfangsbuchstabe gesetzt, dann werden nur eigenschaften
// und methoden mit dem entsprechenden anfangsbuchstaben ausgegeben
function alertObject(myobject,anfangsbuchstabe)
{
	text = "";
	for (var i in myobject)
	{
		if (anfangsbuchstabe!=null && anfangsbuchstabe!="undefined" && i.indexOf(anfangsbuchstabe)===0)
		text += i+": "+myobject[i]+"\n";
	}
	alert(text);
}

// mouseover for left icons [START]
// creator km, 2.10.2003
// last change km, 15.10.2003
var pic_off_ar = new Array();
var pic_on_ar = new Array();

pic_on_ar["ico_home"] = "images/toolbox/ico_home_ms.gif";
pic_off_ar["ico_home"] = "images/toolbox/ico_home_off.gif";

pic_on_ar["ico_mail"] = "images/toolbox/ico_mail_ms.gif";
pic_off_ar["ico_mail"] = "images/toolbox/ico_mail_off.gif";

pic_on_ar["ico_lupe"] = "images/toolbox/ico_lupe_ms.gif";
pic_off_ar["ico_lupe"] = "images/toolbox/ico_lupe_off.gif";

pic_on_ar["ico_onlineschalter"] = "images/toolbox/ico_onlineschalter_ms.gif";
pic_off_ar["ico_onlineschalter"] = "images/toolbox/ico_onlineschalter_off.gif";

pic_on_ar["ico_raumscout"] = "images/toolbox/ico_raumscout_ms.gif";
pic_off_ar["ico_raumscout"] = "images/toolbox/ico_raumscout_off.gif";

pic_on_ar["ico_az"] = "images/toolbox/ico_az_ms.gif";
pic_off_ar["ico_az"] = "images/toolbox/ico_az_off.gif";

pic_on_ar["ico_extranet"] = "images/toolbox/ico_extranet_ms.gif";
pic_off_ar["ico_extranet"] = "images/toolbox/ico_extranet_off.gif";

pic_on_ar["ico_plan"] = "images/toolbox/ico_plan_ms.gif";
pic_off_ar["ico_plan"] = "images/toolbox/ico_plan_off.gif";

pic_on_ar["ico_acrobat"] = "images/toolbox/ico_acrobat_ms.gif";
pic_off_ar["ico_acrobat"] = "images/toolbox/ico_acrobat_off.gif";

pic_on_ar["ico_chch"] = "images/toolbox/ico_chch_ms.gif";
pic_off_ar["ico_chch"] = "images/toolbox/ico_chch_off.gif";

pic_on_ar["ico_sitemap"] = "images/toolbox/ico_sitemap_ms.gif";
pic_off_ar["ico_sitemap"] = "images/toolbox/ico_sitemap_off.gif";

pic_on_ar["ico_flugzeug"] = "images/toolbox/ico_flugzeug_ms.gif";
pic_off_ar["ico_flugzeug"] = "images/toolbox/ico_flugzeug_off.gif";

pic_on_ar["nav_1"] = "de/images/aktuelles_on.gif";
pic_off_ar["nav_1"] = "de/images/aktuelles_off.gif";

pic_on_ar["nav_2"] = "de/images/gemeindeportrait_on.gif";
pic_off_ar["nav_2"] = "de/images/gemeindeportrait_off.gif";

pic_on_ar["nav_3"] = "de/images/schule_on.gif";
pic_off_ar["nav_3"] = "de/images/schule_off.gif";

pic_on_ar["nav_4"] = "de/images/onlineschalter_on.gif";
pic_off_ar["nav_4"] = "de/images/onlineschalter_off.gif";

var pic_off = new Array();
var pic_on = new Array();
for (var i in pic_off_ar)
{
	if ((typeof(pic_off_ar[i]) != 'string') || (pic_off_ar[i].search(/\.gif$/) == -1)) continue;
	pic_off[i] = new Image();
	pic_off[i].src = pathVar+pic_off_ar[i];
	pic_on[i] = new Image();
	pic_on[i].src = pathVar+pic_on_ar[i];
}

function mouseEnter(name,text)
{	
	if(!text)
		text="";	

	if (document.images)
		document.images[name].src = pic_on[name].src;
	window.status=text;
	return true;
}

function mouseExit(name,actnav)
{
	if(markedNavi != actnav) {
	if (document.images)
		document.images[name].src = pic_off[name].src;
	window.status="";
	return true;
	}
}
// mouseover for left icons [END]

// functions for iframe expander in all various browsers [START]

function getIFrameDoc( name ) {
  var IFrameDoc;
  var Height;
  var IFrameObj = document.getElementsByName(''+name)[0];
  
  if (typeof document.frames != 'undefined') {
    IFrameObj = document.frames[name];
  }
  
  if (IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    IFrameDoc = IFrameObj.document;
  } else {
    return false;
  }
  
  if(typeof IFrameDoc.body != 'undefined')
  {
    return IFrameDoc.body;
  }
  else
  {
    return IFrameDoc.documentElement;
  }
}

/*
* gets the height of an iframe document
*/
function getIFrameDocHeight( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof IFrameDoc == 'undefined')
    return false;
  	return IFrameDoc.scrollHeight;
}

/*
* gets the width of an iframe document
*/
function getIFrameDocWidth( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof IFrameDoc == 'undefined')
    return false;
  return IFrameDoc.scrollWidth;
}

// functions for iframe expander in all various browsers [END]


// Refreshpage (cache-abfrage)
function refreshPage() {		
	if (document.location.href.indexOf("cache=refreshurl") != -1) {
		document.location.reload();					
	}
	else	{		
		var urlParts = (document.location.href+'#').split('#');
	
		if (document.location.href.indexOf("?") != -1) {
			newUrl=urlParts[0] + '&cache=refreshurl'+((urlParts[1]!='')?('#'+urlParts[1]):'');
		}
		else	{
			newUrl=urlParts[0] + '?cache=refreshurl'+((urlParts[1]!='')?('#'+urlParts[1]):'');
		}			
		document.location.replace(newUrl);
	}
}
// END

// Random-Game
var randomnums = new Array();
function flashGame() {
	var num = 0;			
	do
	{
		num=Math.floor(Math.random()*12)+1;
	} while ( randomnums[num] );
	randomnums[num] = 1;
	
	//document.writeln("<img src='../images/random/top"+num+".jpg' width=100 height=47 class='strokerandom'>");
	document.writeln("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='265' height='265'><param name='movie' value='../images/home_flash/game"+num+".swf'><param name='quality' value='high'><embed src='../images/home_flash/game"+num+".swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='265' height='265'></embed></object>");
}
// END


// Cookiestuff
var cpath = "/";

function cookieRead(name)
{
	zusuchen=name+"=";
	laenge=zusuchen.length;
	cookielaenge=document.cookie.length;
	position=0;
	while (position<cookielaenge)
	{
		ende=position+laenge;
		if (document.cookie.substring(position,ende)==zusuchen)
		{
			endkette=document.cookie.indexOf(";",ende);
			if (endkette==-1)
				endkette=document.cookie.length;
			ergebnis=unescape(document.cookie.substring(ende,endkette));
			return (ergebnis);
		}
		position=document.cookie.indexOf(" ",position)+1;
		if (position==0)
			break;
	}
	return (null);
}


function cookieWrite(name,wert,tage)
{
	verfall=new Date();
	verfall.setTime(verfall.getTime()+(tage*24*60*60*1000));
	document.cookie=name+"="+escape(wert)+";expires="+verfall.toGMTString()+";path="+cpath;
}
// END



/*
	file:		cms_ticker.js
	project:	css2 based ticker for cms-project
	author:		Ueli Leutwyler
	copyright:	insign gmbh
	version:	1.3
	last update:7.5.03
	
	history:

	07.05.03	if only one news was added, a copy of it is created to grantee seamless scrolling
	19.03.03	faster, slower, setSpeed added
	17.03.03	start
*/

// cmsticker class
function cmsticker(name,width,height,speed,pause,initText)
{
	this.name	= name;
	this.initialized 	= false;
	this.created 		= false;
	this.paused			= true;
	this.turbo			= false;
	if(!document.getElementById) return false;

	this.placer = null;
	this.initText = initText?initText:"loading...";
	this.id		= Math.round(Math.random()*100);
	this.speed  = speed?speed:50;
	this.waittime= pause?(pause*1000):2000;
	this.pos	= 0;
	this.newscounter = 0;
	this.news	= new Array();
	this.width	= width;
	this.height = height;
	this.timeHandler = null;
	this.running = false;
	// generate div-tags
	document.write("<div id=\"tickerplacer"+this.id+"\" STYLE=\"width:"+width+"; height:"+height+";\">"+this.initText+"</div>");
	document.write("<div id=\"tickerwindow"+this.id+"\" STYLE=\"position:relative; left:0; top:0; width:"+width+"px; height:"+height+"px;overflow:hidden;visibility:hidden\"></div>");
	
	
	this.placer	= document.getElementById("tickerplacer"+this.id);
	if(!this.placer)
	{
		alert("internal error: could not load placer object");
		return false;
	}
	this.tickerwindow	= document.getElementById("tickerwindow"+this.id);
	if(!this.tickerwindow)
	{
		alert("internal error: could not load ticker_window object");
		return false;
	}
	
	this.created = true;

	// mehthod
	this.start 	= cmsticker_start;
	this.init 	= cmsticker_init;
	this.addNews= cmsticker_addNews;
	this.tick	= cmsticker_tick;
	this.pause	= cmsticker_pause;
	this.stop	= cmsticker_stop;
	this.cont	= cmsticker_cont;
	this.setSpeed = cmsticker_setSpeed;
	this.slower	= cmsticker_slower;
	this.faster = cmsticker_faster;

	return true;
	
}

function cmsticker_faster(amount)
{
	if(!amount) amount = 20;
	this.speed -=amount;
	if(this.speed<1) this.speed=1;
}

function cmsticker_slower(amount)
{
	if(!amount) amount = 20;
	this.speed +=amount;
	if(this.speed>100) this.speed=100;
}


// methods cmsticker
function cmsticker_setSpeed(speed)
{
	this.speed = speed
}

function cmsticker_addNews(id,myobject)
{
	if(id)
		myNews = document.getElementById(id);
	else
		myNews = myobject;

	if(!myNews)
	{
		alert("Die Neuigkeit mit der id '"+id+"' konnte nicht gefunden werden");
		this.initialized=false;
		return false;
	}
	
	this.tickerwindow.appendChild(myNews);
	myNews.style.position="absolute";
	myNews.style.height = this.height;
	myNews.style.width = this.width;
	myNews.style.overflow="hidden";
	myNews.style.visibility="hidden";
	this.news[this.news.length] = myNews;
}

function cmsticker_init()
{
	if(!this.created) return;
	y = findPosY(this.placer);
	x = findPosX(this.placer);
	// set position of tickerwindow according to placer
	//this.tickerwindow.style.posTop = y;
	//this.tickerwindow.style.posLeft = x;
	//this.tickerwindow.style.top = y;
	//this.tickerwindow.style.left = x;
	// set visibility of placer and Tickerwindow
	this.tickerwindow.style.visibility = "visible";
	this.placer.style.visibility = "hidden";
	// check if only one news is added and add copy of it if so
	if(this.news.length==1)
	{
		clone = this.news[0].cloneNode(true);
		clone.id +="_clone";
//		this.news[0].insertBefore(clone,this.news[0]);
		this.addNews(null,clone);
	}
	this.initialized = true;

	return true;
}



function cmsticker_start()
{
	if(!this.initialized)
	{
		if(!this.init()) return false;
	}
	if(!this.news[this.newscounter]) return false;;
	// prepare current news
	this.paused = false;

	this.news[this.newscounter].style.posTop = this.height+'px';
	this.news[this.newscounter].style.top = this.height+'px';

	this.news[this.newscounter].style.visibility="visible";
	to = this.name+".tick()";
	
	this.timeHandler=setTimeout(to,this.speed);
}

function cmsticker_tick()
{
	this.running = true;
	this.pos+=1;
	if(this.pos>this.height)
	{
		this.pause();
		return;
	}
	else
	{
		// set layer
		prev = this.newscounter-1;
		if(prev<0) prev=this.news.length-1;
		this.news[this.newscounter].style.posTop=this.height-this.pos+'px';
		this.news[this.newscounter].style.top =this.height-this.pos+'px';

		this.news[prev].style.posTop=-this.pos+'px';
		this.news[prev].style.top =- this.pos+'px';

		to = this.name+".tick()";

		this.timeHandler=setTimeout(to,this.turbo?1:this.speed);
	}
}

function cmsticker_pause()
{
	this.paused =true;
	this.turbo=false;
	this.pos=0;
	this.newscounter++;
	if(this.newscounter>=this.news.length) this.newscounter=0;

	this.running = false;
	to = this.name+".start()";
	this.timeHandler=setTimeout(to,this.waittime);
	
}

function cmsticker_stop()
{
	clearTimeout(this.timeHandler);
	this.running = false;
}

function cmsticker_cont()
{
	if(!this.running&&this.initialized) 
	{
		clearTimeout(this.timeHandler);
		if(this.paused)
			this.start();
		else
			this.tick();	
	}
	else if(this.paused)
		this.start();
	else
		this.turbo=true;
}
	

// function to evaluate position of objects

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
// END



// mmenu_wrap.js

// wrapper to make mmenu object-oriented
// ueli leutwyler 
// (c) insign gmbh 2002

menuexists = Array();
menucount = 1;
menuinit=false;

// screenpos: 	center;left;right;middle;top;bottom" or a combination of "center:middle" 
//		OR name of a picture
//		if screenpos is a picture top and left will be relativ to 0,0 pos of picture


function menuw(id,top,left,width,borderwidth,screenPos,propAr,alwaysVis,textAlignement,filter,followScrolling,horizMenu,keepAlive)
{

	if(typeof(menutpl)=="undefinded")
	{
		alert("Es ist kein Template für die Menus definiert!");
		return;
	}
	
	//properties
	this.id			= id;
	if(!id){alert("Keine id für dieses Menu vorhanden!");return};
	this.width 		= width?width:menutpl[2];
	this.left		= left?left:menutpl[1];
	this.top		= top?top:menutpl[0];
	this.borderwidth	= borderwidth?borderwidth:menutpl[3];
	this.screenPos		= screenPos?screenPos:menutpl[4];
	this.propAr		= propAr?propAr:menutpl[5];
	this.alwaysVis		= alwaysVis?alwaysVis:menutpl[6];
	this.textAlignement	= textAlignement?textAlignement:menutpl[7];
	this.filter		= filter?filter:menutpl[8];
	this.followScrolling	= followScrolling?followScrolling:menutpl[9];
	this.horizMenu		= horizMenu?horizMenu:menutpl[10];
	this.keepAlive		= keepAlive?keepAlive:menutpl[11];

	// methods
	this.addItem = menu_addItem;
	this.make    = menu_make;
	
	//holder
	this.items	= Array();
}

function menu_addItem(description,url,myvoid,status,target,sepbar)
{
	
	newItem=new menuItem(description,url,myvoid,target,status,sepbar); 
	this.items[this.items.length] = newItem;
	return newItem;
}

function menuItem(description,url,myvoid,target,status,sepbar)
{
	// properties
	this.description 		= description;
	this.url			= url?url:"";
	this.myvoid			= myvoid?myvoid:"";
	this.target			= target?target:"";
	this.sepbar			= sepbar?sepbar:1;
	this.status			= status?status:description;
	this.link			= (myvoid&&myvoid!=0) ? linktemplate.replace("%void%",myvoid):url;
	this.submenu		= null;
	if(target&&target!=""&&linkwraper.indexOf("javascript:")==-1)
	{
		 if(parent.frames[this.target])
		 {
		 	 this.link="javascript:loadFrame(\""+this.link+"\",\""+this.target+"\");";
		 }
		 else
		 {
		 	this.link="javascript:openwin(\""+this.link+"\")";
		 }
	}
	//Methods
	this.addSub	 = menu_addSub;
	
}

// screenpos: 	center;left;right;middle;top;bottom" or a combination of "center:middle" 
//		OR name of a picture
//		if screenpos is a picture top and left will be relativ to 0,0 pos of picture

function menu_addSub(id,top,left,width,borderwidth,screenPos,propAr,alwaysVis,textAlignement,filter,followScrolling,horizMenu,keepAlive)
{
	return this.submenu=new menuw(id,top,left,width,borderwidth,screenPos,propAr,alwaysVis,textAlignement,filter,followScrolling,horizMenu,keepAlive);
}

function menu_make()
{
	var i=0;
	
	// check if screenPos is name of a picture
	if(this.screenPos!=""&&document.images[this.screenPos])
	{
		this.left=getImageXfromLeft(this.screenPos)+this.left;	
		this.top=getImageYfromTop(this.screenPos)+this.top;	
	}
	
	
	// make menu array
	var myAr=[
	this.id.toString(),
	this.top,
	this.left,
	this.width,
	this.borderwidth,
	this.screenPos,
	this.propAr,
	this.alwaysVis,
	this.textAlignement,
	this.filter,
	this.followScrolling,
	this.horizMenu,
	this.keepAlive,
	menutpl[12],
	menutpl[13],
	menutpl[14],
	menutpl[15],,,,,""
	];
	// add items
	for(i=0;i<this.items.length;i++)
	{
		myAr[myAr.length]=this.items[i].description;
		if(this.items[i].submenu)
		{
			myAr[myAr.length]="show-menu="+this.items[i].submenu.id;
			myAr[myAr.length]=this.items[i].link;
		}
		else
		{
			myAr[myAr.length]=this.items[i].link;
			myAr[myAr.length]="";
		}
		myAr[myAr.length]=this.items[i].status;
		myAr[myAr.length]=this.items[i].sepbar;
		
		// make submenu recusively
		if(this.items[i].submenu) this.items[i].submenu.make();
	}
	addmenu(menu = myAr);
	menuexists[this.id]=menucount;
	menucount++;
}



function popItUp(number)
{
	if(!menuinit) return;
		//do mouseover with layer
		
		if(menuexists[number])
		{
			popup(menuexists[number]);
		}
		
}

function openwin(source)
{
	window.open(source);
}

function loadFrame(source,frame)
{
	parent.frames[frame].location.href=source;
}

// funcitons to get position of a picture
function docjslib_getRealLeft(imgElem) {
	xPos = document.images[imgElem].offsetLeft;
	tempEl = document.images[imgElem].offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}

function docjslib_getRealTop(imgElem) {
	yPos = document.images[imgElem].offsetTop;
	tempEl = document.images[imgElem].offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}

function getImageXfromLeft(imgID) {
  if (document.images[imgID].x) return document.images[imgID].x
  else return docjslib_getRealLeft(imgID);
}

function getImageYfromTop(imgID) {
  if (document.images[imgID].y) return document.images[imgID].y
  else return docjslib_getRealTop(imgID);
}

// END


// flash_home.js
/*
(c) by insign - simply e-business
http://www.insign.ch - info(at)insign(punkt)ch

created by km, sh, jg
last change: sh, 3.10.2003

history
10.11.2003	ps	adapted that flash requirements are always usable for start-screen (no "if flashanim" around flash-detection)
01.10.2003	km	initial release
*/

// check flash compatibilities for browser [START]
// creator 	km	02.09.2003
// last change	

var flashanim = false;

if (cookieRead("flashanim")) {
	if (cookieRead("flashanim") == "true") {		
		flashanim = true;
	}
	else {		
		flashanim = false;
	}
}
else {	
	cookieWrite("flashanim","false",60);
}	



var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

var requiredVersion = 3;
var useRedirect = false;

var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var maxVersion = 6;
var actualVersion = 0;
var hasRightVersion = false;

if(isIE && isWin == true){ // don't write vbscript tags on anything but ie win
	document.write('<SCR' + 'IPT LANGUAGE="VBScript"\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
	document.write('</SCR' + 'IPT\> \n');
}

function detectFlash()
{
	if (navigator.plugins)
	{
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])
		{
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;		
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
		}
	}
	for (var i = 2; i <= maxVersion; i++)
	{	
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;
	if (actualVersion >= requiredVersion)
	{
		hasRightVersion = true;

		if (useRedirect) {
			if(jsVersion > 1.0) {
				window.location.replace(flashPage);
			} else {
				window.location = flashPage;
			}
		}
	} 
	else 
	{
	
		if (useRedirect)
		{
			if(jsVersion > 1.0) {
				window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
			} else {
				window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
			}
		}
	}
}

detectFlash();

// check flash compatibilities for browser [END]

//END



// content_lib.js

function openPicWinCm(pFileName,pWinName,pWidth,pHeight,posWindow,einfuegwin)
{
	var isNS = (document.layers) ? true : false;
	if (isNS) pHeight = pHeight + 19;
	
	switch(posWindow) 
	{
 		case "left":
 		xPosNewWindow=0;
 		break;
 		case "right": 		
 		xPosNewWindow=screen.width-pWidth-12;
 		break;
 		case "middle":
 		xPosNewWindow=(screen.width-pWidth)/2;
 		break;
 		default:
 		xPosNewWindow=(screen.width-pWidth)/2;
		break;
	}	
		
	eval("allSettings = 'width="+pWidth+",height="+pHeight+",menubar=no,scrollbars=yes,status=no,resizable=yes,left='+xPosNewWindow+',top=0'");
	if (einfuegwin)
	{
		
		w1=window.open(pFileName,pWinName,allSettings);
		w1.window.focus();
	}
	else
	{
		w=window.open(pFileName,pWinName,allSettings);
		w.window.focus();
	}
}

function openPicWin(pFileName,pWinName,pWidth,pHeight)
			{
				var isNS = (document.layers) ? true : false;
				
				if (isNS) pHeight = pHeight + 19;
					eval("allSettings = 'width="+pWidth+",height="+pHeight+",menubar=yes,scrollbars=yes,status=yes,resizable=yes'");
					w=window.open(pFileName,pWinName,allSettings);
					w.window.focus();
			}
// END	
	
	