//
// Opus Javascript 14.03.2007 copyright brandperfection
//


// Div Ein- und ausblenden
alleTexteArray = new Array('text01','text02','text03','text04','text05','text06','text07','text08','text09','text10','text11','text12','text13','text14','text15','text16');
alleHoehenArray = new Array();
alleHoehenArray['text01'] = 255; //news
alleHoehenArray['text02'] = 283; //pizza
alleHoehenArray['text03'] = 405; //pasta
alleHoehenArray['text04'] = 443; //co
alleHoehenArray['text05'] = 625; //fruehstueck
alleHoehenArray['text06'] = 393; //heissgetraenke
alleHoehenArray['text11'] = 333; //sodas
alleHoehenArray['text12'] = 245; //bier
alleHoehenArray['text13'] = 392; //wein
alleHoehenArray['text14'] = 895; //spirits
alleHoehenArray['text15'] = 278; //long drinks
alleHoehenArray['text16'] = 411; //cocktails
alleHoehenArray['text07'] = 276; //bilder hoehe_offen eigentlich: 36;
alleHoehenArray['text08'] = 370; //contact hoehe_offen eigentlich: 36;
alleHoehenArray['text09'] = 1160; //impressum hoehe_offen eigentlich: 36;




function disStatus (meinArray,myId){
	for (i=0; i<meinArray.length;i++){
		divhide (meinArray[i]);
	}
	hoehetest = 1;
	
	if(document.getElementById){ myObj = document.getElementById(myId);}
	else if(document.all){       myObj = document.all[myId];}
	myObj.style.display = 'block';	
	layer_oeffnen(myId);
}




function divhide (myId) {
	if(document.getElementById){ myObj = document.getElementById(myId);}
	else if(document.all){       myObj = document.all[myId];}
	if(myObj){
		myObj.style.height = '0px';
		myObj.style.display = 'none';
	}
}



var hoehetest = 1;
var stepwidth = 10;
function layer_oeffnen(myId){
	if(document.getElementById){ myObj = document.getElementById(myId);}
	else if(document.all){       myObj = document.all[myId];}
	if(myObj){

		hoehetest+=stepwidth;
		//alert(myId + " | " + alleHoehenArray[myId] +"#"+ hoehetest);
		hoehesoll = alleHoehenArray[myId];
		if(hoehetest < hoehesoll){
			//alert(myId + " - Stop - " + hoehetest + "<"+ hoehesoll);
			
			
			setTimeout("layer_oeffnen('"+myId+"')",20); 
		}else{
			hoehetest = hoehesoll;
		}
		
		
		myObj.style.height = hoehetest+"px";
		//alert(myObj.style.height + " - " + hoehetest);
	}
}







//Bild einblenen MouseOver


function zeigText (ziel) { 
	  if (document.all){ 
         document.all[ziel].style.display = 'block'; 
      } 
      else if (document.getElementById){ 
         document.getElementById(ziel).style.display = 'block'; 
      } 
} 
   


function textWeg (ziel) { 

      if (document.all) { 
         document.all[ziel].style.display = 'none'; 
      } 
      else if (document.getElementById){ 
         document.getElementById(ziel).style.display = 'none'; 
      } 
}


	
	
	
var scrollgeschwindigkeit = 5;
var i = 0;
var j = 0;


function layerbewegen_links(){
	if (document.all) { 
		myObj = document.all['bilderInnen'];
	} 
	else if (document.getElementById){  	
		myObj = document.getElementById('bilderInnen');
	}
	mypos = parseInt(myObj.style.left);
	
	if(!mypos)mypos = 0;
	if(mypos > -770) {
		myObj.style.left =  (mypos - scrollgeschwindigkeit ) + 'px'; 
	}
}



function layerbewegen_rechts(){
	if (document.all) { 
		myObj = document.all['bilderInnen'];
	} 
	else if (document.getElementById){  	
		myObj = document.getElementById('bilderInnen');
	}
	mypos = parseInt(myObj.style.left);
	
	if(!mypos)mypos = 0;
	if(mypos < 0) {
		myObj.style.left =  (mypos + scrollgeschwindigkeit ) + 'px'; 
	}
}



var aktiv;
function startScrolling(richtung){
	if(richtung=="rechts")	aktiv = window.setInterval("layerbewegen_rechts()", 50);
	else					aktiv = window.setInterval("layerbewegen_links()", 50);
}



function stopScrolling(){
	window.clearInterval(aktiv);
}


function popup_oeffnen(url){
	if(bilderpopup){
		window.blur();
	}
	
	var bilderpopup = window.open(url,"Fenster1","width=535,height=655,left=0,top=0, resizable=no");
	
	
	return false;
}



/* Popups oeffnen */
function popup(url,width,height){
	if(width=="")width=600;
	if(height=="")height=800;
	var size = "width="+width+",height="+height+"";
	settings = "top=10,left=10,"+size+",menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no";
	if(url!="")window.open(url,'popup1',settings);
}


/* E-Mail */
function myMail(){
	var att="@";
	document.write('<a href="&#109;&#97;&#105;'+'&#108;&#116;&#111;&#58;&#105;&#110;&#102;&#111;'+att+'&#111;&#112;&#117;&#115;&#45;&#101;&#115;&#115;&#101;&#110;&#117;&#110;&#100;&#116;&#114;&#105;&#110;&#107;&#101;&#110;&#46;&#100;&#101;?subject=Kontakt von &#111;&#112;&#117;&#115;&#45;&#101;&#115;&#115;&#101;&#110;&#117;&#110;&#100;&#116;&#114;&#105;&#110;&#107;&#101;&#110;&#46;&#100;&#101;"><h2>&#105;&#110;&#102;&#111;'+att+	
	'&#111;&#112;&#117;&#115;&#45;&#101;&#115;&#115;&#101;&#110;&#117;&#110;&#100;&#116;&#114;&#105;&#110;&#107;&#101;&#110;&#46;&#100;&#101;</h2></a>');
}
