var termAllHeight=250
var termPicHeight=0
var isTermPic=0
var siteMinHeight=0

function siteStart(){
	document.getElementById("textRoll").style.visibility= "hidden"
	h=m_siteAllBackH+15;h2=m_siteAllBackH-72
	if(s_contentType==4 || s_contentType==6 || s_contentType==7){
		h=seiteDoByStart();h=h+25
		if(h<1000){h=1000}
		document.getElementById("seiteAllBack").style.height=h+1
	}
	else{h=1000}
	if(s_contentType==1){
		h=document.getElementById("boxTextBodyAll").scrollHeight
		document.getElementById("boxTextBodyAll").style.height=h
		if(h<1000){h=1000}
	}
	
	if(h<siteMinHeight){h=siteMinHeight}
	
	document.getElementById("allBack").style.height=h+m_TextBodyY+115
	document.getElementById("allBack").style.borderRight="1px solid #000000"
	document.getElementById("allBack").style.borderLeft="1px solid #000000"
	document.getElementById("allBack").style.borderBottom="1px solid #000000"

	sH=0
	if(isTermPic==1){
		sH=document.getElementById("termHeadName").scrollHeight
		document.getElementById("termPicBack").style.top=18+sH
	}
	
	document.getElementById("termBack").style.top=18+sH+termPicHeight+4
	
	termAllHeight=13+sH+4+termPicHeight+4+227+20
	document.getElementById("termAllBack").style.height=termAllHeight
	document.getElementById("termAllBack").style.visibility="visible"
	document.getElementById("allButsBack").style.top=225+termAllHeight
	document.getElementById("gitarre").style.top=h+m_TextBodyY+75-330
	document.getElementById("gitarre").style.visibility="visible"	
	document.getElementById("bottomBox").style.top=h+m_TextBodyY+75
	document.getElementById("bottomBox").style.visibility="visible"
	document.getElementById("beethoven").style.top=h+m_TextBodyY+14
	document.getElementById("beethoven").style.visibility="visible"			
	document.getElementById("editBut").style.top=h+m_TextBodyY+85
	document.getElementById("keyWord").style.top=h+m_TextBodyY+84
	y=150
	document.getElementById("headPantheon").style.top=y
	document.getElementById("headPantheon").style.visibility="visible"		
	y=y+53
	for(n=0;n<panArr.length;n++){
		pArr=panArr[n].split(/\#/)
		if((y+130)<(h+m_TextBodyY+115)){
			obj=eval('document.getElementById("panRahmen' + n + '")')
			obj.style.top=y;obj.style.visibility="visible"
			obj=eval('document.getElementById("pantheon' + n + '")')
			obj.style.top=y+22;obj.style.visibility="visible"
			y=y+130
		}
	}
	if(orgMain==1 && orgSub==3){
		if(mailReturn==1){
			document.getElementById("boxTextBody").innerHTML="<br><br>Danke für euere Bewerbung.<br><br><b>Das Red Rooster Team</b>"
		}
	}
}

function siteBeforeBody(){
	var htmS=""
	return htmS
}

function siteEx0(){
	var htmS=""
	return htmS
}

function siteEx1(){
	var htmS=""
	htmS+=drawDiv("openHour",18,97,300,15,"",'#ffffff','',1,'','Geöffnet: DO, FR, SA ab 19:00 Uhr','normTextBold',1,'','')
	t='Kaiser-Friedrich-Str. 150  47169 Duisburg   Tel.: 02 03 / 8 79 62 78   EMail: <a id="emailText" style="cursor: pointer" onclick="goEmail()" onmouseover="emailFormat(1,\'emailText\')" onmouseout="emailFormat(0,\'emailText\')">info@redrooster-club.de</a>'
	htmS+=drawDiv("adresse",18,113,600,15,"",'#000000','',1,'',t,'normTextBold',1,'','')
	
	htmS+=drawDivPic("newHead",590,150,200,50,"",'','',1,'','','normText',0,'','','content/bilder/head_termin.gif','')

	htmS+=drawDiv("termAllBack",590,205,200,266,"#000000",'','',1,'','','normText',0,'','visibility: hidden')
		yy=0
		for(n=0;n<vorschau.length;n++){
			if(vorschau[n][3]!="Open Stage" && vorschau[n][3]!="Musikerstammtisch"){
				if(vorschau[n][7]!=""){
					d=vorschau[n][0].split(/\|/)
					if(d[0]==d[1]){datum=d[0]}else{datum=d[0] + " - " + d[1]}
					action='onclick="showDate(' + n + ')" onmouseover="decoFormat(1,\'termHeadDate\'), decoFormat(1,\'termHeadName\')" onmouseout="decoFormat(0,\'termHeadDate\'),decoFormat(0,\'termHeadName\')"'					
					htmS+=drawDiv("termHeadDate",5,0,190,26,"",'#cccccc','',1,'hand',datum + " / " + vorschau[n][1],'normTextBold',1,action,'')
					htmS+=drawDiv("termHeadName",5,13,190,26,"",'#ffffff','',1,'hand',vorschau[n][3],'normTextBold',1,action,'font-size: 9pt;overflow: hidden')					
					if(vorschau[n][7]!=""){
						pisStr=vorschau[n][7].split(/\|/)
						pic="content/dates/bilder/" + pisStr[0]
						picW=pisStr[1]*1;picH=pisStr[2]*1
						htmS+=drawDiv("termPicBack",(200-picW)/2,31,picW,picH+2,"",'','',1,'','','normText',0,'','border-top: 1px dotted #cc0000; border-bottom: 1px dotted #cc0000;')
							action='onclick="showDate(' + n + ')"'
							htmS+=drawDivPic("termPic",0,0,picW,picH,"",'','',1,'hand','','normText',0,action,'',pic,'')
						htmS+='</div>'
						yy=yy+picH+31;
						termPicHeight=picH+2
						isTermPic=1
					}
					break
				}
			}
		}
		htmS+=drawDiv("termBack",0,yy+2,200,227,"#000000",'','',1,'','','normText',0,'','overflow: auto')
			yy=5
			for(n=0;n<vorschau.length;n++){
				d=vorschau[n][0].split(/\|/)
				if(d[0]==d[1]){datum=d[0]}else{datum=d[0] + " - " + d[1]}
				action='onclick="showDate(' + n + ')" onmouseover="decoFormat(1,\'termDate' + n + '\'), decoFormat(1,\'termName' + n + '\')" onmouseout="decoFormat(0,\'termDate' + n + '\'),decoFormat(0,\'termName' + n + '\')"'
				htmS+=drawDiv("termDate" + n,5,yy,175,26,"",'#cc0000','',1,'hand',datum + " / " + vorschau[n][1],'normTextBold',1,action,'overflow: hidden')
				htmS+=drawDiv("termName" + n,5,yy+13,175,26,"",'#ffffff','',1,'hand',vorschau[n][3],'normTextBold',1,action,'overflow: hidden')
				yy=yy+28
			}
		htmS+='</div>'
	htmS+='</div>'
	
	yy=665
	
	htmS+=drawDiv("allButsBack",590,yy,200,280,"",'','',1,'','','normText',0,'','')
		htmS+=drawDivPic("stammtisch",0,0,90,90,"",'','',1,'hand','','normText',0,'onclick="goStammtisch()"','','content/bilder/schild_stammtisch.gif','Zum Musiker Stammtisch')	
		htmS+=drawDivPic("raucherClub",0,90,90,90,"",'','',1,'hand','','normText',0,'onclick="goSmoking()"','','content/bilder/schild_raucherclub.gif','Raucherclub Info')
		htmS+=drawDivPic("posterBmw",93,3,104,146,"",'','',1,'hand','','normText',0,'onclick="goBmw()"','','content/bilder/poster_bmw.gif','')
		htmS+=drawDivPic("adGG",91,180,90,90,"",'','',1,'hand','','normText',0,'onclick="goWeb(\'http://www.ggmusicshop.de\')"','','content/bilder/schild_gg.gif','Zur Webseite GG Musicshop')
		htmS+=drawDiv("klingelBack",0,180,90,90,"",'','',1,'','','normText',0,'','')
			htmS+=drawDivPic("klingel0",0,0,90,90,"",'','',1,'','','normText',0,'','','content/bilder/klingel_0.gif','')
			htmS+=drawDivPic("klingelBut0",30,46,30,30,"",'','',1,'hand','','normText',0,'onclick="goGabi()"','','bilder/trans.gif','')
		htmS+='</div>'
	htmS+='</div>'
	htmS+=drawDivPic("gitarre",648,505,150,330,"",'','',1,'','','normText',0,'','visibility:hidden','content/bilder/'+actGuitar,'')
	return htmS
}

function siteEx2(){
	var htmS=""
	return htmS
}

function siteEx3(){
	var htmS=""
	if(s_contentType==4 || s_contentType==6 || s_contentType==7){
		if(sCon[2][1]!==""){
			htmS+=drawDivPic("textHeadPic",m_TextHeadX,m_TextHeadY,m_TextHeadW,m_TextHeadH,'','',m_TextHeadBorderColor,m_TextHeadBorder,'','',"",0,'','','content/part' + mainPart + '/seite' + mainSite + '/bilder/' + sCon[2][1],"")
		}
	}
	htmS+=drawDivPic("headPantheon",20,15,88,50,'','','','','','',"",0,'','visibility: hidden','content/bilder/head_pantheon.gif',"")
	for(n=0;n<panArr.length;n++){
		pArr=panArr[n].split(/\#/)
		action='onclick="goPantheon(\''+ pArr[1] +'\')"'
		htmS+=drawDivPic("panRahmen" + n,18,10,96,128,'','','','','hand','',"",0,action,'visibility: hidden','content/pantheon/rahmen.gif',pArr[0])
		htmS+=drawDivPic("pantheon" + n,20+(88-pArr[2])/2,10,pArr[2],pArr[3],'','','','','hand','',"",0,action,'visibility: hidden','content/pantheon/' + pArr[1] + '.jpg',pArr[0])
	}
	
	htmS+=drawDiv("bottomBox",0,505,798,35,"#000000",'','',1,'','','normText',0,'','visibility:hidden')
	htmS+='</div>'
	
	htmS+=drawDivPic("beethoven",506,505,142,75,"",'','',1,'','','normText',0,'','visibility:hidden','content/bilder/beethoven.gif','')

	if(orgMain==1 && orgSub==1){
		xx=m_TextHeadX;yy=m_TextBodyY;ww=m_TextHeadW
		for(n=0;n<archivListe.length;n++){
			htmS+=drawDiv("archivBack" + n,xx,yy,ww,94,"",'','',1,'','','normText',0,'','border-top: 1px dotted #000000;border-bottom: 1px dotted #000000;')
				if(archivListe[n][4]!=""){
					t=archivListe[n][4].split(/\|/)
					pic="content/dates/" + archivListe[n][5] + "bilder/" + t[0]
					picW=t[1]*1;picH=t[2]*1;
					cur="";action=""
					if(archivListe[n][3]!=""){
						t2=archivListe[n][3].split(/\|/)
						picLarge="content/dates/" + archivListe[n][5] + "bilder/" + t2[0]
						picLarge=picLarge.replace(/\&/g,'\§')
						cur="hand"
						action='onclick="goPicView(\'' + picLarge + '\',\'' + archivListe[n][0] + '\',\'\')"'
					}
					htmS+=drawDivPic("archivPic" + n,0,2,picW,picH,"#000000",'','',1,cur,'','normText',0,action,'',pic,'')
				}
				htmS+=drawDiv("archivTop" + n,94,2,ww-94,16,"#000000",'','',1,'','','normText',0,'','')
					htmS+=drawDiv("archivName" + n,4,1,ww-90,14,"",'#ffffff','',1,'',archivListe[n][0],'normTextBold',1,'','overflow: hidden')
				htmS+='</div>'
				htmS+=drawDiv("archivBody" + n,94,20,ww-94,52,"",'','',1,'','','normText',0,'','')
					htmS+=drawDiv("archivText" + n,4,1,ww-102,50,"",'#ffffff','',1,'',archivListe[n][1],'normText',1,'','overflow: auto')
				htmS+='</div>'
				htmS+=drawDiv("archivKontakt" + n,94,74,ww-94,16,"#880000",'','',1,'','','normText',0,'','')
					t=archivListe[n][2].split(/\/\//)
					action='onmouseover="decoFormat(1,\'archivWeb' + n + '\')" onmouseout="decoFormat(0,\'archivWeb' + n + '\')" onclick="goWeb(\'' +  archivListe[n][2] + '\')"'
					htmS+=drawDiv("archivWeb" + n,4,1,ww-102,14,"",'#ffffff','',1,'hand',"Kontakt: " + t[1],'normTextBold',1,action,'overflow: hidden')
				htmS+='</div>'				
			htmS+='</div>'
			yy=yy+100
		}
		siteMinHeight=yy-100
	}
	
	if(orgMain==1 && orgSub==3){
		if(mailReturn==0){
			htmS+='<form name="formBand" method="post"  enctype="multipart/form-data">'
			y=300;x=m_TextBodyX
			htmS+=drawDiv("bandNameLeg",x,y+2,150,15,"",'#ffffff','',1,'','Bandname:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandName",x+152,y,260,"",128,'','');y=y+30
			htmS+=drawDiv("bandStilLeg",x,y+2,150,15,"",'#ffffff','',1,'','Stilrichtung:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandStil",x+152,y,260,"",128,'','');y=y+30
			htmS+=drawDiv("bandWebLeg",x,y+2,150,15,"",'#ffffff','',1,'','Webseite:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandWeb",x+152,y,260,"",128,'','');y=y+30
			htmS+=drawDiv("bandPartnerLeg",x,y+2,150,15,"",'#ffffff','',1,'','Ansprechpartner:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandPartner",x+152,y,260,"",128,'','');y=y+30
			htmS+=drawDiv("bandMailLeg",x,y+2,150,15,"",'#ffffff','',1,'','EMail:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandMail",x+152,y,260,"",128,'','');y=y+30		
			htmS+=drawDiv("bandPhoneLeg",x,y+2,150,15,"",'#ffffff','',1,'','Telefon:','normTextBold',1,'','text-align: right')
			htmS+=drawInputBox("bandPhone",x+152,y,260,"",128,'','');y=y+30
			htmS+=drawDiv("bandInfoLeg",x,y+2,150,15,"",'#ffffff','',1,'','KurzInfo:','normTextBold',1,'','text-align: right')
			htmS+=drawDiv("bandInfoBack",x+152,y,260,100,"",'','',1,'',"",'',0,'','')
				htmS+='<textarea name="bandInfo" id="bandInfo" class="normTextBold" style="border: 1px solid #000000; background-color: #ffffff; color: #000000; width: 260px; height: 100px;" maxlength="1024" onchange="goTextChanged()" onpaste="goTextChanged()" oncut="goTextChanged()"></textarea>'
			htmS+='</div>'
			y=y+115
			htmS+=drawDiv("bandSendBut",x+152+260-80,y,80,15,"#000000",'#ffffff','#000000',1,'hand','Abschicken','normTextBold',1,'onclick="sendBandMail()"','text-align:center')
			htmS+='</form>'
		}
	}
	
	if(orgMain==4 && orgSub==1){
		t="Der Red Rooster Club liegt im Norden der Stadt Duisburg, im Stadtteil Obermarkxloh.<br><br>Ab der Autobahn A 59, Abfahrt DU-Fahrn / DU-Röttgersbach, ist er in zwei Minuten zu erreichen.<br><br><b>Busverbindungen der DVG (Haltestelle Schwabenstraße):</b><br><br><b>905</b> - DU-Walsum <> DU-Beeckerwerth<br><br><b>910</b> - DU-Obermeiderich <> DU-Meiderich<br><br><b>917</b> - DU-Beeck <> DU-Neumühl<br><br><b>935</b> - OB Anne-Frank-Realschule <> OB-Sterkrade<br><br><b>NE1</b> - DU-Hbf Osteingang <> DU-Neumühl<br><br><br><b>Weiterführende Links:</b>"
		htmS+=drawDiv("anfahrtText",m_TextBodyX,m_TextBodyY+m_TextBodyH+10,m_TextBodyW,35,"",'#ffffff','',1,'',t,'normText',1,'','')
		action='onclick="goWeb(\'http://www.vrr.de/de/fahrplanauskunft/index.html\')"'
		htmS+=drawDivPic("vrr",m_TextBodyX,685,38,42,"",'','',1,'hand','','normText',0,action,'','content/bilder/vrrlogo.gif','Fahrplan des VRR')
		action='onclick="goWeb(\'http://maps.google.de/maps?f=q&source=s_q&hl=de&geocode=&q=kaiser-friedrich-str.+150,+duisburg&sll=51.151786,10.415039&sspn=20.919278,39.375&ie=UTF8&z=16&iwloc=A\')"'
		htmS+=drawDivPic("googlemaps",m_TextBodyX+48,685,171,42,"",'','',1,'hand','','normText',0,action,'','content/bilder/googlelogo.gif','Google maps')
	}	
	return htmS
}

function siteEx4(){
	var htmS=""
	return htmS
}

function privateResize(){
	if(window.innerWidth){allW = window.innerWidth;allH = window.innerHeight}
	else{allW=document.body.offsetWidth;allH=document.body.offsetHeight}
	
	//document.getElementById("allBack").style.height=allH-4
}

function sendBandMail(){
	obj=document.getElementById("bandName")
	if(checkBandMail(obj.value,1)==false){alert("Kein Bandname angegeben.");obj.focus();return false}
	obj=document.getElementById("bandStil")
	if(checkBandMail(obj.value,1)==false){alert("Keine Stilrichtung angegeben.");obj.focus();return false}	
	obj=document.getElementById("bandWeb")
	if(checkBandMail(obj.value,0)==false){return false}		
	obj=document.getElementById("bandPartner")
	if(checkBandMail(obj.value,1)==false){alert("Kein Ansprechpartner angegeben.");obj.focus();return false}		
	obj=document.getElementById("bandMail")
	if(checkBandMail(obj.value,2)==false){alert("Keine oder falsche EMail-Adresse angegeben.");obj.focus();return false}	
	obj=document.getElementById("bandPhone")
	if(checkBandMail(obj.value,1)==false){alert("Keine Telefonnummer angegeben.");obj.focus();return false}		
	obj=document.getElementById("bandInfo")
	if(checkBandMail(obj.value,1)==false){alert("Keine KurzInfo angegeben.");obj.focus();return false}
	
	
	t="Wir würden gerne im Red Rooster Club spielen:" + crlf + crlf + crlf
	t+=document.getElementById("bandNameLeg").innerHTML + crlf
	t+=document.getElementById("bandName").value + crlf + crlf
	
	t+=document.getElementById("bandStilLeg").innerHTML + crlf
	t+=document.getElementById("bandStil").value + crlf + crlf
	
	t+=document.getElementById("bandWebLeg").innerHTML + crlf
	t+=document.getElementById("bandWeb").value + crlf + crlf
	
	t+=document.getElementById("bandPartnerLeg").innerHTML + crlf
	t+=document.getElementById("bandPartner").value + crlf + crlf
	
	t+=document.getElementById("bandMailLeg").innerHTML + crlf
	t+=document.getElementById("bandMail").value + crlf + crlf
	
	t+=document.getElementById("bandPhoneLeg").innerHTML + crlf
	t+=document.getElementById("bandPhone").value + crlf + crlf
	
	t+=document.getElementById("bandInfoLeg").innerHTML + crlf
	t+=document.getElementById("bandInfo").value
	
	document.getElementById("bandInfo").value=t
	document.formBand.action="seite.php?p=0&m=1&s=3"
	document.formBand.submit()			
	
}

function checkBandMail(t,typ){
	t=trim(t)
	t=t.replace(/\|/g,"")
	if(typ>0){if(t==""){return false}}
	if(typ>1){if(checkEmail(t)==false){return false}}
}

function emailFormat(index,o){
	col=["#000000","#ffffff"];
	obj=eval('document.getElementById("' + o + '")')
	obj.style.color=col[index]
}

function decoFormat(index,o){
	deco=["none","underline"];
	obj=eval('document.getElementById("' + o + '")')
	obj.style.textDecoration=deco[index]
}


function goGabi(){
	w=300;h=320
	winPos=windowPlace(w,h)
	window.open("gabi.php","","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")			
}

function goHallo(){
	w=600;h=400
	winPos=windowPlace(w,h)
	window.open("halloween.php","","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")			
}

function goSmoking(){
	w=385;h=361+20
	winPos=windowPlace(w,h)
	window.open("smoking.php","","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")			
}

function goBmw(){
	w=400;h=270+20
	winPos=windowPlace(w,h)
	window.open("bmw.php","","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")			
}

function goStammtisch(){
	w=700;h=525+20
	winPos=windowPlace(w,h)
	window.open("stammtisch.php","","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")			
}


function goPantheon(index){
	w=480;h=480
	winPos=windowPlace(w,h)
	window.open("pantheon.php?pic=" + index,"","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")	
}

function goAllDates(){
}

function windowPlace(w,h){
	winPos=new Array
	if(window.innerWidth){allXb = (window.innerWidth - w) / 2}
	else{allXb=(document.body.offsetWidth-w-4)/2}
	if(allXb<0){allXb=0};allXb=Math.floor(allXb)
	if(window.innerHeight){allYb = (window.innerHeight - h) / 2}
	else{allYb=(document.body.offsetHeight-h-4)/2}
	if(allYb<0){allYb=0};allYb=Math.floor(allYb)
	if(window.screenX){allXb=allX+window.screenX}
	else{allXb=allXb+window.screenLeft;}
	if(window.screenY){allYb=allYb+window.screenY}
	else{allYb=allYb+window.screenTop;}

	winPos=[allXb,allYb]
	return winPos
}

function showDate(index){
	w=400;h=300
	winPos=windowPlace(w,h)
	window.open("showtermin.php?dNr=" + index,"","left=" + winPos[0] + "px, top=" + winPos[1] + "px, width=" + w + "px, height=" + h + "px")		
}
