var ua = navigator.userAgent.toLowerCase();
var netscapebrowser = (ua.indexOf("mozilla") != -1 && 
                       ua.indexOf("compatible") == -1 && 
                       ua.indexOf("opera") == -1);
var iebrowser = (ua.indexOf("msie") > -1 && 
                 ua.indexOf("opera") == -1);

var av = navigator.appVersion;
var version = parseFloat(av.substr(0, av.indexOf(" ")));
var version2 = parseFloat(av.substr(0, av.indexOf(".")));
if (netscapebrowser) {
  var versionsnummer = version2;
} else {
  if (iebrowser) {
    if (version2 < 4) {
      versionsnummer= 3;
    } else if (version2==4 && ua.indexOf("msie 4") > -1) {
      versionsnummer = 4;
    } else if (version2==4 && ua.indexOf("msie 5") > -1) {
      versionsnummer = 5;
    } else if (version2==4 && ua.indexOf("msie 6") > -1) {
      versionsnummer = 6;
    } else if (version2==4 && ua.indexOf("msie 7") > -1) {
      versionsnummer = 7;
    } else if (version2==4 && ua.indexOf("msie 8") > -1) {
      versionsnummer = 8;
    }
  }
}



function korrWerte(){
   // korrigiere die Hoehe des wrappers
   var content = document.getElementById("content");   
   var neueHoehe = document.body.offsetHeight - 381 +"px";
   content.style.height = neueHoehe;   
}
function korrWerteIE5 (){
   // korrigiere die Hoehe des wrappers
   var content = document.getElementById("content");   
   var neueHoehe = document.body.offsetHeight - 380 +"px";
   content.style.height = neueHoehe;   
}
function korrWerteIE7 (){
   // korrigiere die Hoehe des wrappers
   var content = document.getElementById("content");   
   var neueHoehe = document.body.offsetHeight - 424 +"px";
   content.style.height = neueHoehe;   
}
function korrWerteIE8 (){
   // korrigiere die Hoehe des wrappers
   var content = document.getElementById("content");   
   var neueHoehe = document.body.offsetHeight - 424 +"px";
   content.style.height = neueHoehe;   
}

if (iebrowser && versionsnummer == 5){
   window.onload = korrWerteIE5;
   window.onresize = korrWerteIE5; }
else if (iebrowser && versionsnummer == 7){
   window.onload = korrWerteIE7;
   window.onresize = korrWerteIE7; }
else if (iebrowser && versionsnummer == 8){
   window.onload = korrWerteIE8;
   window.onresize = korrWerteIE8; }
else if (iebrowser)	{
   window.onload = korrWerte;
   window.onresize = korrWerte; 
   
   }



function ausblend() {
    document.getElementById("slogan_uebul").style.display = "none";
    document.getElementById("slogan_uebur").style.display = "none";
  }
  function einblend() {
    document.getElementById("slogan_uebul").style.display = "block";
    document.getElementById("slogan_uebur").style.display = "block";
  }
this.ausblend = function()
        {
            element1 = document.getElementById('slogan_uebul');
            for(i = 0;i <= 100;i++)
                window.setTimeout('element1.style.filter = "Alpha(opacity=' + (100 - i) + ')"; element1.style.MozOpacity = ' + (1 - i / 100) + '; element1.style.opacity = ' + (1 - i / 100) + ';', i * 10);
				
            element2 = document.getElementById('slogan_uebur');
            for(i = 0;i <= 100;i++)
                window.setTimeout('element2.style.filter = "Alpha(opacity=' + (100 - i) + ')"; element2.style.MozOpacity = ' + (1 - i / 100) + '; element2.style.opacity = ' + (1 - i / 100) + ';', i * 10);
				
            // Von 0 bis 100 (Prozent)
            // Das i * 5 dient dazu, dass das Ausblenden nicht zu schnell geht
        }

function onl() {
    einblend();window.setTimeout("ausblend()",6000); 
    
  }

function ausblende() {
    document.getElementById("slogan_startl").style.display = "none";
    document.getElementById("slogan_startr").style.display = "none";
  }
  function einblende() {
    document.getElementById("slogan_startl").style.display = "block";
    document.getElementById("slogan_startr").style.display = "block";
  }
this.ausblende = function()
        {
			
            element3 = document.getElementById('slogan_startl');
            for(i = 0;i <= 100;i++)
                window.setTimeout('element3.style.filter = "Alpha(opacity=' + (100 - i) + ')"; element3.style.MozOpacity = ' + (1 - i / 100) + '; element3.style.opacity = ' + (1 - i / 100) + ';', i * 10);
				
            element4 = document.getElementById('slogan_startr');
            for(i = 0;i <= 100;i++)
                window.setTimeout('element4.style.filter = "Alpha(opacity=' + (100 - i) + ')"; element4.style.MozOpacity = ' + (1 - i / 100) + '; element4.style.opacity = ' + (1 - i / 100) + ';', i * 10);
            // Von 0 bis 100 (Prozent)
            // Das i * 5 dient dazu, dass das Ausblenden nicht zu schnell geht
        }

function onlo() {
    einblende();window.setTimeout("ausblende()",6000); 
    
  }


function aendern(box){
	var oldHTML = document.getElementById(box).innerHTML;
	var newHTML = oldHTML;
	document.getElementById('box2').innerHTML = newHTML;
}
function rueck(){
	var oldHTML = document.getElementById().innerHTML;
	var newHTML = oldHTML;
	document.getElementById('box3').innerHTML = newHTML;
}



var ddaccordion={
	
	contentclassname:{}, //object to store corresponding contentclass name based on headerclass

	expandone:function(headerclass, selected){ //PUBLIC function to expand a particular header
		this.toggleone(headerclass, selected, "expand")
	},

	collapseone:function(headerclass, selected){ //PUBLIC function to collapse a particular header
		this.toggleone(headerclass, selected, "collapse")
	},

	expandall:function(headerclass){ //PUBLIC function to expand all headers based on their shared CSS classname
		var $=jQuery
		var $headers=$('.'+headerclass)
		$('.'+this.contentclassname[headerclass]+':hidden').each(function(){
			$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
		})
	},

	collapseall:function(headerclass){ //PUBLIC function to collapse all headers based on their shared CSS classname
		var $=jQuery
		var $headers=$('.'+headerclass)
		$('.'+this.contentclassname[headerclass]+':visible').each(function(){
			$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")
		})
	},

	toggleone:function(headerclass, selected, optstate){ //PUBLIC function to expand/ collapse a particular header
		var $=jQuery
		var $targetHeader=$('.'+headerclass).eq(selected)
		var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
		if (typeof optstate=="undefined" || optstate=="expand" && $subcontent.is(":hidden") || optstate=="collapse" && $subcontent.is(":visible"))
			$targetHeader.trigger("evt_accordion")
	},

	expandit:function($targetHeader, $targetContent, config, useractivated, directclick){
		this.transformHeader($targetHeader, config, "expand")
		$targetContent.slideDown(config.animatespeed, function(){
			config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), useractivated)
			if (config.postreveal=="gotourl" && directclick){ //if revealtype is "Go to Header URL upon click", and this is a direct click on the header
				var targetLink=($targetHeader.is("a"))? $targetHeader.get(0) : $targetHeader.find('a:eq(0)').get(0)
				if (targetLink) //if this header is a link
					setTimeout(function(){location=targetLink.href}, 200) //ignore link target, as window.open(targetLink, targetLink.target) doesn't work in FF if popup blocker enabled
			}
		})
	},

	collapseit:function($targetHeader, $targetContent, config, isuseractivated){
		this.transformHeader($targetHeader, config, "collapse")
		$targetContent.slideUp(config.animatespeed, function(){config.onopenclose($targetHeader.get(0), parseInt($targetHeader.attr('headerindex')), $targetContent.css('display'), isuseractivated)})
	},

	transformHeader:function($targetHeader, config, state){
		$targetHeader.addClass((state=="expand")? config.cssclass.expand : config.cssclass.collapse) //alternate btw "expand" and "collapse" CSS classes
		.removeClass((state=="expand")? config.cssclass.collapse : config.cssclass.expand)
		if (config.htmlsetting.location=='src'){ //Change header image (assuming header is an image)?
			$targetHeader=($targetHeader.is("img"))? $targetHeader : $targetHeader.find('img').eq(0) //Set target to either header itself, or first image within header
			$targetHeader.attr('src', (state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse) //change header image
		}
		else if (config.htmlsetting.location=="prefix") //if change "prefix" HTML, locate dynamically added ".accordprefix" span tag and change it
			$targetHeader.find('.accordprefix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
		else if (config.htmlsetting.location=="suffix")
			$targetHeader.find('.accordsuffix').html((state=="expand")? config.htmlsetting.expand : config.htmlsetting.collapse)
	},

	urlparamselect:function(headerclass){
		var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)", "i")) //check for "?headerclass=2,3,4" in URL
		if (result!=null)
			result=RegExp.$1.split(',')
		return result //returns null, [index], or [index1,index2,etc], where index are the desired selected header indices
	},

	getCookie:function(Name){ 
		var re=new RegExp(Name+"=[^;]+", "i") //construct RE to search for target name/value pair
		if (document.cookie.match(re)) //if cookie found
			return document.cookie.match(re)[0].split("=")[1] //return its value
		return null
	},

	setCookie:function(name, value){
		document.cookie = name + "=" + value + "; path=/"
	},

	init:function(config){
	document.write('<style type="text/css">\n')
	document.write('.'+config.contentclass+'{display: none}\n') //generate CSS to hide contents
	document.write('<\/style>')
	jQuery(document).ready(function($){
		ddaccordion.urlparamselect(config.headerclass)
		var persistedheaders=ddaccordion.getCookie(config.headerclass)
		ddaccordion.contentclassname[config.headerclass]=config.contentclass //remember contentclass name based on headerclass
		config.cssclass={collapse: config.toggleclass[0], expand: config.toggleclass[1]} //store expand and contract CSS classes as object properties
		config.revealtype=config.revealtype || "click"
		config.revealtype=config.revealtype.replace(/mouseover/i, "mouseenter")
		if (config.revealtype=="clickgo"){
			config.postreveal="gotourl" //remember added action
			config.revealtype="click" //overwrite revealtype to "click" keyword
		}
		if (typeof config.togglehtml=="undefined")
			config.htmlsetting={location: "none"}
		else
			config.htmlsetting={location: config.togglehtml[0], collapse: config.togglehtml[1], expand: config.togglehtml[2]} //store HTML settings as object properties
		config.oninit=(typeof config.oninit=="undefined")? function(){} : config.oninit //attach custom "oninit" event handler
		config.onopenclose=(typeof config.onopenclose=="undefined")? function(){} : config.onopenclose //attach custom "onopenclose" event handler
		var lastexpanded={} //object to hold reference to last expanded header and content (jquery objects)
		var expandedindices=ddaccordion.urlparamselect(config.headerclass) || ((config.persiststate && persistedheaders!=null)? persistedheaders : config.defaultexpanded)
		if (typeof expandedindices=='string') //test for string value (exception is config.defaultexpanded, which is an array)
			expandedindices=expandedindices.replace(/c/ig, '').split(',') //transform string value to an array (ie: "c1,c2,c3" becomes [1,2,3]
		var $subcontents=$('.'+config["contentclass"])
		if (expandedindices.length==1 && expandedindices[0]=="-1") //check for expandedindices value of [-1], indicating persistence is on and no content expanded
			expandedindices=[]
		if (config["collapseprev"] && expandedindices.length>1) //only allow one content open?
			expandedindices=[expandedindices.pop()] //return last array element as an array (for sake of jQuery.inArray())
		if (config["onemustopen"] && expandedindices.length==0) //if at least one content should be open at all times and none are, open 1st header
			expandedindices=[0]
		$('.'+config["headerclass"]).each(function(index){ //loop through all headers
			if (/(prefix)|(suffix)/i.test(config.htmlsetting.location) && $(this).html()!=""){ //add a SPAN element to header depending on user setting and if header is a container tag
				$('<span class="accordprefix"></span>').prependTo(this)
				$('<span class="accordsuffix"></span>').appendTo(this)
			}
			$(this).attr('headerindex', index+'h') //store position of this header relative to its peers
			$subcontents.eq(index).attr('contentindex', index+'c') //store position of this content relative to its peers
			var $subcontent=$subcontents.eq(index)
			var needle=(typeof expandedindices[0]=="number")? index : index+'' //check for data type within expandedindices array- index should match that type
			if (jQuery.inArray(needle, expandedindices)!=-1){ //check for headers that should be expanded automatically (convert index to string first)
				if (config.animatedefault==false)
					$subcontent.show()
				ddaccordion.expandit($(this), $subcontent, config, false) //Last param sets 'isuseractivated' parameter
				lastexpanded={$header:$(this), $content:$subcontent}
			}  //end check
			else{
				$subcontent.hide()
				config.onopenclose($(this).get(0), parseInt($(this).attr('headerindex')), $subcontent.css('display'), false) //Last Boolean value sets 'isuseractivated' parameter
				ddaccordion.transformHeader($(this), config, "collapse")
			}
		})
		$('.'+config["headerclass"]).bind("evt_accordion", function(e, isdirectclick){ //assign custom event handler that expands/ contacts a header
				var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex'))) //get subcontent that should be expanded/collapsed
				if ($subcontent.css('display')=="none"){
					ddaccordion.expandit($(this), $subcontent, config, true, isdirectclick) //2nd last param sets 'isuseractivated' parameter
					if (config["collapseprev"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){ //collapse previous content?
						ddaccordion.collapseit(lastexpanded.$header, lastexpanded.$content, config, true) //Last Boolean value sets 'isuseractivated' parameter
					}
					lastexpanded={$header:$(this), $content:$subcontent}
				}
				else if (!config["onemustopen"] || config["onemustopen"] && lastexpanded.$header && $(this).get(0)!=lastexpanded.$header.get(0)){
					ddaccordion.collapseit($(this), $subcontent, config, true) //Last Boolean value sets 'isuseractivated' parameter
				}
 		})
		$('.'+config["headerclass"]).bind(config.revealtype, function(){
			if (config.revealtype=="mouseenter"){
				clearTimeout(config.revealdelay)
				var headerindex=parseInt($(this).attr("headerindex"))
				config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"], headerindex)}, config.mouseoverdelay || 0)
			}
			else{
				$(this).trigger("evt_accordion", [true])
				return false //cancel default click behavior
			}
		})
		$('.'+config["headerclass"]).bind("mouseleave", function(){
			clearTimeout(config.revealdelay)
		})
		config.oninit($('.'+config["headerclass"]).get(), expandedindices)
		$(window).bind('unload', function(){ //clean up and persist on page unload
			$('.'+config["headerclass"]).unbind()
			var expandedindices=[]
			$('.'+config["contentclass"]+":visible").each(function(index){ //get indices of expanded headers
				expandedindices.push($(this).attr('contentindex'))
			})
			if (config.persiststate==true && $('.'+config["headerclass"]).length>0){ //persist state?
				expandedindices=(expandedindices.length==0)? '-1c' : expandedindices //No contents expanded, indicate that with dummy '-1c' value?
				ddaccordion.setCookie(config.headerclass, expandedindices)
			}
		})
	})
	}
}

ddaccordion.init({
	headerclass: "submenuheader", 
	contentclass: "submenu", 
	revealtype: "click", 
	mouseoverdelay: 0, 
	collapseprev: true,  
	defaultexpanded: [], 
	onemustopen: false, 
	animatedefault: true, 
	persiststate: false, 
	toggleclass: ["", ""], 
	togglehtml: ["suffix", "", ""], 
	animatespeed: "slow", 
oninit:function(headers, expandedindices){ 
},
onopenclose:function(header, index, state, isuseractivated){ 
}
})



// ----------- Bilder Rollover ----

var rollOverArr=new Array();
function setrollover(OverImgSrc,pageImageName)
{
if (! document.images)return;
if (pageImageName == null)
    pageImageName = document.images[document.images.length-1].name;
rollOverArr[pageImageName]=new Object;
rollOverArr[pageImageName].overImg = new Image;
rollOverArr[pageImageName].overImg.src=OverImgSrc;
}

function rollover(pageImageName)
{
if (! document.images)return;
if (! rollOverArr[pageImageName])return;
if (! rollOverArr[pageImageName].outImg)
    {
    rollOverArr[pageImageName].outImg = new Image;
    rollOverArr[pageImageName].outImg.src = document.images[pageImageName].src;
    }
document.images[pageImageName].src=rollOverArr[pageImageName].overImg.src;
}

function rollout(pageImageName)
{
if (! document.images)return;
if (! rollOverArr[pageImageName])return;
document.images[pageImageName].src=rollOverArr[pageImageName].outImg.src;
}

setrollover('img/box2.png',   'cross1');
setrollover('img/box2.png',   'cross2');
setrollover('img/box2.png',   'cross3');
setrollover('img/box2.png',   'cross4');

//----------------------------------------------------------------------------
// Forumular-Check Kontakt
//----------------------------------------------------------------------------

function check() {
    if (document.anfrage.r_name.value == "") {
   	alert("Bitte geben Sie Ihren Namen ein!");
    	document.anfrage.r_name.focus();
    	return false;
  	}
 	  if (document.anfrage.re_email.value == "") {
    	alert("Bitte geben Sie Ihre E-Mail-Adresse ein!");
    	document.anfrage.re_email.focus();
    	return false;
  	 }
 	  if (document.anfrage.re_email.value.indexOf("@") == -1) {
    	alert("Sie haben keine gueltige E-Mail-Adresse eingegeben!");
    	document.anfrage.re_email.focus();
   	  return false;
    	}
    if (document.anfrage.text.value == "") {
    	alert("Bitte geben Sie Ihr Anliegen ein!");
    	document.anfrage.text.focus();
   	  return false;
  	  } 	 	
 	   	   
 }

/****************************************************************
slides
*****************************************************************/
//*****parameters to set*****
//into this array insert the paths of your pics.
var def_imges=new Array ('pics/pic01a.jpg', 'pics/pic01b.jpg', 'pics/pic01c.jpg');
var def_divid="slideshow"; //the id of the div container that will hold the slideshow
var def_picwid=800; //set this to the width of your widest pic
var def_pichei=280; //... and this to the height of your highest pic
var def_backgr="#fff"; //set this to the background color you want to use for the slide-area
//(for example the body-background-color) if your pics are of different size
var def_sdur=3; //time to show a pic between fades in seconds
var def_fdur=1; //duration of the complete fade in seconds
var def_steps=20; //steps to fade from on pic to the next
var def_startwhen="y"; //start automatically at pageload? set it to "y" for on and to "n" for off
var def_shuffle="y"; //start with random image? set it to "y" for on and to "n" for off
var def_showcontr="y"; //do you want to show controls? set it to "y" for on and to "n" for off
//into this array insert the paths of your control-buttons or the text to display e.g. back,start,stop,fwrd.
var def_contr=new Array ('bwd.png', 'start.png', 'stop.png', 'fwd.png');
//****************************************************************

//daisychain onload-events
function daisychain(sl){if(window.onload) {var ld=window.onload;window.onload=function(){ld();sl();};}else{window.onload=function(){sl();};}}

function be_slideshow(be_slideid,be_imges,be_divid,be_picwid,be_pichei,be_backgr,be_sdur,be_fdur,be_steps,be_startwhen,be_shuffle,be_showcontr,be_contr){

//declarations and defaults
	var slideid=(be_slideid)?be_slideid:"0";
	var imges=(be_imges)?be_imges:def_imges;
	var divid=(be_divid)?be_divid:def_divid;
	var picwid=(be_picwid)?be_picwid:def_picwid;
	var pichei=(be_pichei)?be_pichei:def_pichei;
	var backgr=(be_backgr)?be_backgr:def_backgr;
	var sdur=(be_sdur)?be_sdur:def_sdur;
	var fdur=(be_fdur)?be_fdur:def_fdur;
	var steps=(be_steps)?be_steps:def_steps;
	var startwhen=(be_startwhen)?be_startwhen:def_startwhen;
			startwhen=(startwhen.toLowerCase()=="y")?1:0;
	var shuffle=(be_shuffle)?be_shuffle:def_shuffle;
			shuffle=(shuffle.toLowerCase()=="y")?1:0;
	var showcontr=(be_showcontr)?be_showcontr:def_showcontr;
			showcontr=(showcontr.toLowerCase()=="y")?1:0;
	var contr=(be_contr)?be_contr:def_contr;
	var ftim=fdur*1000/steps;
	var stim=sdur*1000;
	var emax=imges.length;
	var self = this;
	var stopit=1;
	var startim=1;
	var u=0;
	var parr = new Array();
	var ptofade,pnext,factor,mytimeout;
//check if there are at least 3 pictures, elswhere double the array
	if(imges.length<=2){imges=imges.concat(imges);}
//shuffle images if set
  if(shuffle){for(i=0;i<=Math.floor(Math.random()*imges.length);i++){imges.push(imges.shift());}}
  
//push images into array and get things going
	this.b_myfade = function(){
		var a,idakt,paktidakt,ie5exep;
		for(a=1;a<=emax;a++){
			idakt="img_"+slideid+"_"+a;paktidakt=document.getElementById(idakt);
    	ie5exep=new Array(paktidakt);parr=parr.concat(ie5exep);
    }
		if(startwhen){
			stopit=0;
 			mytimeout=setTimeout(function(){self.b_slide();},stim);
 		}
	}

//prepare current and next and trigger slide
	this.b_slide = function(){
		clearTimeout(mytimeout);
		u=0;
		ptofade=parr[startim-1];
		if(startim<emax){pnext=parr[startim];}
		else{pnext=parr[0];}
		pnext.style.zIndex=1;
		pnext.style.visibility="visible";
		pnext.style.filter="Alpha(Opacity=100)";
		pnext.style.MozOpacity=1;
		pnext.style.opacity=1;
		ptofade.style.zIndex=2;
		ptofade.style.visibility="visible";
		ptofade.style.filter="Alpha(Opacity=100)";
		ptofade.style.MozOpacity=1;
		ptofade.style.opacity=1;
		factor=100/steps;
		if(stopit=="0"){
			this.b_slidenow();
		}
	}

//one step forward
	this.b_forw = function(){
		stopit=1;
		clearTimeout(mytimeout);
		ptofade=parr[startim-1];
		if(startim<emax){pnext=parr[startim];startim=startim+1;}
		else{pnext=parr[0];startim=1;}
		ptofade.style.visibility="hidden";
		ptofade.style.zIndex=1;
		pnext.style.visibility="visible";
		pnext.style.zIndex=2;
		self.b_slide();
	}

//one step back
	this.b_back = function(){
		stopit=1;
		clearTimeout(mytimeout);
		if(u==0){ //between two slides
			ptofade=parr[startim-1];
			if(startim<emax){pnext=parr[startim];}
			else{pnext=parr[0];}
			pnext.style.visibility="hidden";
			ptofade.style.zIndex=1;
			ptofade.style.visibility="visible";
			if(startim>=2){startim=startim-1;}
			else{startim=emax;}
			self.b_slide();
		}
		else{ //whilst sliding
			self.b_slide();
		}
	}

//slide as said, then give back
	this.b_slidenow = function(){
		var check1,maxalpha,curralpha;
		check1=ptofade.style.MozOpacity;
		maxalpha=(100-factor*u)/100*105;
		if(check1<=maxalpha/100){u=u+1;}
		curralpha=100-factor*u;
		ptofade.style.filter="Alpha(Opacity="+curralpha+")";
		ptofade.style.MozOpacity=curralpha/100;
		ptofade.style.opacity=curralpha/100;
		if(u<steps){ //slide not finished
			if(stopit=="0"){mytimeout=setTimeout(function(){self.b_slidenow();},ftim);}
			else {this.b_slide();}
		}
		else{ //slide finished
			if(startim<emax){
				ptofade.style.visibility="hidden";
				ptofade.style.zIndex=1;
				pnext.style.zIndex=2;
				startim=startim+1;u=0;
				mytimeout=setTimeout(function(){self.b_slide();},stim);
			}
			else{
				ptofade.style.visibility="hidden";
				ptofade.style.zIndex=1;
				pnext.style.zIndex=2;
				startim=1;u=0;
				mytimeout=setTimeout(function(){self.b_slide();},stim);
			}
		}
	}

//manual start
	this.b_start= function(){
		if(stopit==1){
 			stopit=0;
 			mytimeout=setTimeout(function(){self.b_slide();},stim);
 		}
	}

//manual stop
	this.b_stop= function(){
		clearTimeout(mytimeout);
		stopit=1;
		this.b_slide();
	}

//insert css and images
	this.b_insert= function(){
		var b, thestylid, thez, thevis, slidehei;
		slidehei=(showcontr)?(pichei+25):(pichei); //add space for the controls
		var myhtml="<div style='width:"+picwid+"px;height:"+slidehei+"px;'>";
   			myhtml+="<div style='position:absolute;width:"+picwid+"px;height:"+pichei+"px;'>";
		for(b=1;b<=emax;b++){
			thez=1;thevis='hidden';
			if(b<=1) {thez=2; thevis='visible';}
			  myhtml+="<div id='img_"+slideid+"_"+b+"' style='font-size:0;line-height:"+pichei+"px;margin:0;padding:0;text-align:center;visibility:"+thevis+";z-index:"+thez+";position:absolute;left:0;top:0;width:"+picwid+"px;height:"+pichei+"px;background-color:"+backgr+";'>";
				myhtml+="<img src='"+imges[(b-1)]+"' style='vertical-align:middle;border:0;' alt=''/></div>";
		}
   			myhtml+="</div>";
//show controls
		if(showcontr){
				for(b=1;b<=4;b++){
					var check=contr[b-1].substring(contr[b-1].length-3).toLowerCase(); //check for buttons
					contr[b-1]=(check=="jpg"||check=="gif"||check=="png")?("<img src='"+contr[b-1]+"' style='border:none;' alt=''/>"):(contr[b-1]);
				}
   			myhtml+="<div style='display:block;width:"+picwid+"px;padding-top:"+(pichei+3)+"px;text-align:right;'>";
   			myhtml+="<a href='javascript:be_"+slideid+".b_back();' style='text-decoration:none'>"+contr[0]+"</a>&nbsp;";
   			myhtml+="<a href='javascript:be_"+slideid+".b_start();' style='text-decoration:none'>"+contr[1]+"</a>&nbsp;";
   			myhtml+="<a href='javascript:be_"+slideid+".b_stop();' style='text-decoration:none'>"+contr[2]+"</a>&nbsp;";
   			myhtml+="<a href='javascript:be_"+slideid+".b_forw();' style='text-decoration:none'>"+contr[3]+"</a>";
		}
   			myhtml+="</div>";
		document.getElementById(divid).innerHTML=myhtml;
		self.b_myfade();
	}

//call autostart-function
daisychain(this.b_insert);
	
}



//var be_0= new be_slideshow();


$(document).ready(function() {
	
	$("a.single_1").fancybox({
							 });
		
	$("a.iframe").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 327
	});
	
	$("a.iframe2").fancybox({
		'frameWidth'			: 327,
		'frameHeight'			: 600
	});

	$("a.iframe01").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 400,
		'overlayShow'			: true
	});
	$("a.iframe02").fancybox({
		'frameWidth'			: 421,
		'frameHeight'			: 500,
		'overlayShow'			: true
	});
	$("a.iframe03").fancybox({
		'frameWidth'			: 317,
		'frameHeight'			: 500,
		'overlayShow'			: true
	});
	$("a.iframe04").fancybox({
		'frameWidth'			: 333,
		'frameHeight'			: 500,
		'overlayShow'			: true
	});
	$("a.iframe05").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 384,
		'overlayShow'			: true
	});
	$("a.iframe06").fancybox({
		'frameWidth'			: 341,
		'frameHeight'			: 500,
		'overlayShow'			: true
	});
	$("a.iframe07").fancybox({
		'frameWidth'			: 332,
		'frameHeight'			: 500,
		'overlayShow'			: true
	});
	$("a.iframe08").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 398,
		'overlayShow'			: true
	});
	$("a.iframe09").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 344,
		'overlayShow'			: true
	});
	$("a.iframe10").fancybox({
		'frameWidth'			: 800,
		'frameHeight'			: 380,
		'overlayShow'			: true
	});
	$("a.iframe11").fancybox({
		'frameWidth'			: 800,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe12").fancybox({
		'frameWidth'			: 550,
		'frameHeight'			: 200,
		'overlayShow'			: true
	});
	$("a.iframe13").fancybox({
		'frameWidth'			: 560,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe14").fancybox({
		'frameWidth'			: 235,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe15").fancybox({
		'frameWidth'			: 260,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe16").fancybox({
		'frameWidth'			: 170,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe17").fancybox({
		'frameWidth'			: 360,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe18").fancybox({
		'frameWidth'			: 325,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe19").fancybox({
		'frameWidth'			: 470,
		'frameHeight'			: 280,
		'overlayShow'			: true
	});
	$("a.iframe20").fancybox({
		'frameWidth'			: 800,
		'frameHeight'			: 533,
		'overlayShow'			: true
	});
	$("a.iframe21").fancybox({
		'frameWidth'			: 656,
		'frameHeight'			: 800,
		'overlayShow'			: true
	});
	$("a.iframe22").fancybox({
		'frameWidth'			: 800,
		'frameHeight'			: 523,
		'overlayShow'			: true
	});
	$("a.iframe31").fancybox({
		'frameWidth'			: 600,
		'frameHeight'			: 327,
		'overlayShow'			: true
	});
	
	$("a.iframe32").fancybox({
		'frameWidth'			: 327,
		'frameHeight'			: 600,
		'overlayShow'			: true
	});
	
});