/****************************************************************************   
DHTML library from DHTMLCentral.com
***************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
bw=new lib_bwcheck() //Browsercheck object

function lib_message(txt){alert(txt); return false}

function lib_obj(obj,nest){ 
  if(!bw.bw) return lib_message('Old browser')
  nest=(!nest) ? "":'document.'+nest+'.'
  this.evnt=bw.dom? document.getElementById(obj):
    bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;	
  if(!this.evnt) return lib_message('The layer does not exist ('+obj+')' 
    +'- \nIf your using Netscape please check the nesting of your tags!')
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=bw.dom||bw.ie4?document:this.css.document;
  this.x=parseInt(this.css.left)||this.css.pixelLeft||this.evnt.offsetLeft||0;
  this.y=parseInt(this.css.top)||this.css.pixelTop||this.evnt.offsetTop||0
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0; 
  this.h=this.evnt.offsetHeight||this.css.clip.height||
    this.ref.height||this.css.pixelHeight||0
  this.c=0 //Clip values
  if((bw.dom || bw.ie4) && this.css.clip) {
  this.c=this.css.clip; this.c=this.c.slice(5,this.c.length-1); 
  this.c=this.c.split(' ');
  for(var i=0;i<4;i++){this.c[i]=parseInt(this.c[i])}
  }
  this.ct=this.css.clip.top||this.c[0]||0; 
  this.cr=this.css.clip.right||this.c[1]||this.w||0
  this.cb=this.css.clip.bottom||this.c[2]||this.h||0; 
  this.cl=this.css.clip.left||this.c[3]||0
  this.obj = obj + "Object"; eval(this.obj + "=this")
  return this
}

//Moving object to **************
lib_obj.prototype.moveIt = function(x,y){
  this.x=x;this.y=y; this.css.left=x;this.css.top=y
}

//Moving object by ***************
lib_obj.prototype.moveBy = function(x,y){
  this.css.left=this.x+=x; this.css.top=this.y+=y
}

//Showing object ************
lib_obj.prototype.showIt = function(){this.css.visibility="visible"}

//Hiding object **********
lib_obj.prototype.hideIt = function(){this.css.visibility="hidden"}

//Changing backgroundcolor ***************
lib_obj.prototype.bg = function(color){ 
	if(bw.opera) this.css.background=color
	else if(bw.dom || bw.ie4) this.css.backgroundColor=color
	else if(bw.ns4) this.css.bgColor=color  
}

//Writing content to object ***
lib_obj.prototype.writeIt = function(text,startHTML,endHTML){
	if(bw.ns4){
    if(!startHTML){startHTML=""; endHTML=""}
	  this.ref.open("text/html"); 
    this.ref.write(startHTML+text+endHTML); 
    this.ref.close()
	}else this.evnt.innerHTML=text
}

//Document size object ********
function lib_doc_size(){ 
  this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
  this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
  if(!this.x2||!this.y2) return message('Document has no width or height') 
  this.x50=this.x2/2;this.y50=this.y2/2;
  return this;
}

// Eigene Funktionen

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 MM_swapImage() { //v3.0
 	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function openGallery(idx, lng, w, h, path) {
  if (w == 0) w = screen.width;
  if (h == 0) h = screen.height;
  l = screen.width/2 - w/2; t = screen.height/2 - h/2;
  win2 = eval('window.open("'+path+'media/gallery.php?objID='+idx+'&lng='+lng+'","Win","left='+l+'px,top='+t+'px,width='+w+'px,height='+h+'px,resizable=1,scrollbars=0,menubar=0,status=1")');
  win2.opener = self;
  win2.focus();
}

function openMediaCenter(show, idx, lng, w, h, path) {
  if (w && h) {
    w += 50;
    h += 80; 
  }
  else {
    if (w == 0) w = screen.width;
    if (h == 0) h = screen.height;
  }
  l = screen.width/2 - w/2; t = screen.height/2 - h/2;
  win2 = eval('window.open("'+path+'media/media.php?show='+show+'&objID='+idx+'&lng='+lng+'","Win","left='+l+'px,top='+t+'px,width='+w+'px,height='+h+'px,resizable=0,scrollbars=0,menubar=0,status=1")');
  win2.opener = self;
  win2.focus();
}

function openWindow(doc, w, h) {
  l = screen.width/2 - w/2;	t = screen.height/2 - h/2 - 20;
 	eval('window.open("'+doc+'","","left='+l+'px,top='+t+'px,width='+w+'px,height='+h+'px,resizable=0,scrollbars=0,status=0")');
}

function Run_Flash_Content (f_src, f_width, f_height, f_id, f_quality, f_bgcolor, f_version, f_swliveconnect) {
  var str = '<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
     str += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+f_version+'" ';
     str += 'ID='+f_id+' WIDTH='+f_width+' HEIGHT='+f_height+'>';
     str += '<PARAM NAME=movie VALUE="'+f_src+'">';
     str += '<PARAM NAME=quality VALUE="'+f_quality+'">';
     str += '<PARAM NAME=bgcolor VALUE="'+f_bgcolor+'">';
     str += '<EMBED src="'+f_src+'" quality='+f_quality+' swLiveConnect='+f_swliveconnect+' WIDTH='+f_width+' HEIGHT='+f_height+' bgcolor='+f_bgcolor+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>';
     str += '</OBJECT>';
  document.write(str);
}

function hideFlashContent() {
  document.getElementById('Flash_Content').style.display='none';
  document.getElementById('Alternate_Content').style.display='block';
  is_flash_content_visible=0;
}

function showFlashContent() {
  document.getElementById('Flash_Content').style.display='block';
  document.getElementById('Alternate_Content').style.display='none';
  is_flash_content_visible=1;
}

is_flash_content = 0;
is_flash_content_visible = 1;

function funktion(o,a,x)
{
  o.onmouseover = '';
  addr = '';
  a = unescape(a);
  for(c =0; c < a.length; ++c)
    {
      addr+=String.fromCharCode(a.charCodeAt(c) - x);
    }
   o.parentNode.setAttribute('href', 'mailto:' + addr);
}