var theoMenu=new Array;var tH=0
var rus=0;var isSound=-1;var minHeight=680
if(subSite==2){rus=1}

function siteStart(){
	x=235
	//for(n=0;n<m_buts[0].length;n++){
		//nText=m_buts[0][n].split(/\#/)
		//if(nText[0].substr(0,1)!="-"){
			//newText=nText[0+language].split(/\|/)
			//newText[0]=newText[0].replace(/\?/g,"")
			//newText[0]=newText[0].replace(/ /g,"#")
			//obj=eval('document.getElementById("menuMainText' + n + '")')
			//obj.style.width=10
			//obj.innerHTML=newText[0]
			//w=obj.scrollWidth+10
			//newText[0]=newText[0].replace(/\#/g," ")
			//obj.innerHTML=newText[0]
			//obj.style.width=w
			//obj.style.left=x
			//x=x+w+10
		//}
	//}
	
	sysMenuResize()
	
	if(s_contentType==1){
		yy=0
		for(n=0;n<sCon[6].length;n++){
			hh=newsPicList[n][2]+20
			obj=eval('document.getElementById("recBody' + n + '")')
			if(obj.scrollHeight>newsPicList[n][2]){
				obj.style.height=obj.scrollHeight
				hh=obj.scrollHeight+20
			}
			obj=eval('document.getElementById("recBack' + n + '")')
			obj.style.height=hh
			obj.style.top=yy
			yy=yy+hh+m_contentBodyPLAbstand
		}
	
	}
	if(s_contentType==0){
		obj=document.getElementById("boxTextBodyBack")
	}
	else{
		obj=document.getElementById("boxTextBodyAll")
	}
	tH=obj.scrollHeight+20;if(tH<300){tH=300;}
	obj.style.height=tH	
	aHeight=tH+m_TextBodyY;if(aHeight<minHeight){aHeight=minHeight}
	document.getElementById("allBack").style.height=aHeight
	tH=aHeight
}

function siteBeforeBody(){
	var htmS=""
	return htmS
}

function siteEx0(){
	var htmS=""
	htmS+=drawDivPic("eGeige",604,110,221,570,"",'','',1,'','','',1,'','','content/bilder/e_geige.jpg',"")
	return htmS
}

function siteEx1(){
	var htmS=""
	
	x=849
	for(n=exMenu.length-1;n>-1;n--){
		htmS+=drawDivPic("exMenu" + n,x,0,exMenu[n][1],exMenu[n][2],"",'','',1,'hand','','',1,exMenu[n][3],'',exMenu[n][0],"")
		x=x-25
	}
	htmS+=drawDivPic("flag0",5,155,24,15,"",'','',1,'hand','','',1,'onclick="selLanguage(0)"','','content/bilder/flag_d.gif',"Deutsch")
	//htmS+=drawDivPic("flag1",40,155,24,15,"",'','',1,'hand','','',1,'onclick="selLanguage(1)"','','content/bilder/flag_gb.gif',"English")

	htmS+=drawDivPic("flagAct",5+(35*language),172,24,3,"#000000",'','',1,'','','',1,'','','content/bilder/trans.gif',"")
	
	htmS+=drawDivPic("hoerProben",0,204,138,120,"",'','',1,'','','',1,'','','content/bilder/but_hoerproben_' + language + '.gif',"")
	y=334
	for(n=0;n<soundList.length;n++){
		t="<b>" + soundList[n][1] + "</b><br>" + soundList[n][2]
		htmS+=drawDiv("soundsName" + n,10,y,128,15,"",'','',1,'hand',t,'normText',1,'onclick="mpPlay(' + n + ')"','')
		y=y+30
	}
	y=y+30
	action='onclick="goWeb(\'http://www.soundofmusic-shop.de/s04.php?sid=&shopid=s04&cur=eur&sp=de&ag=1&os=&br=&pp=aa&bnr=25401\')"'
	htmS+=drawDivPic("cd4ladies",10,y,104,92,"",'','',1,'hand','','',1,action,'','content/bilder/cd.jpg',"Order CD")
	y=y+120
	action='onmouseover=this.style.fontWeight="bold" onmouseout=this.style.fontWeight="normal" onclick="goRepertoire()"'
	
	htmS+=drawDivPic("repertoire",0,y,138,73,"",'','',1,'hand','','normText',1,action,'','content/bilder/but_repertoire.gif','Repertoire')
	
	if((y+140)>minHeight){minHeight=y+140}
	
	
	htmS+=drawDivPic("soundsOn",118,0,20,20,"",'','',1,'hand','','normText',1,'onclick="mpStop()"','visibility: hidden','content/bilder/speaker.gif','Sound off')
	htmS+=drawDiv("soundPlayer",-10,y+10,138,50,"",'','',1,'','','',0,'','visibility: hidden')
		htmS+=setWMP("content/sounds/" + soundList[0][0])
	htmS+='</div>'
	return htmS
}

function siteEx2(){
	var htmS=""
	return htmS
}

function siteEx3(){
	var htmS=""
	x=m_TextBodyX;y=m_TextBodyY
	if(orgMain==3){
		for(n=0;n<picList.length;n++){
			action='onclick="showPic(' + n + ')"'
			htmS+=drawDivPic("picFrame" + n,x,y,100,104,"",'','',1,'hand','','',1,action,'','content/bilder/photoframe_klein.gif',"")
			htmS+=drawDivPic("picNat" + n,x+3,y+7,94,94,"",'','',1,'hand','','',1,action,'','content/gallery/' + picList[n][0] + "_thn.jpg","")
			x=x+105
			if((n+1)%4==0){x=m_TextBodyX;y=y+108}
		}
	}


	

	//action='onmouseover=this.style.fontWeight="bold" onmouseout=this.style.fontWeight="normal" onclick="goGala()"'
	//htmS+=drawDivPic("galaFlyer",774,380,100,141,"",'','',1,'hand','','',1,action,'','content/bilder/gala_flyer.jpg',"Gala Flyer")
	//htmS+=drawDiv("galaFlyerLeg",774,523,100,15,"",'','',1,'hand','Gala Flyer (*.pdf)','normTextBold',1,action,'text-align:center')
	
	
	action='onmouseover=this.style.fontWeight="bold" onmouseout=this.style.fontWeight="normal" onclick="goUnterricht()"'
	htmS+=drawDivPic("educationFlyer",750,380,124,174,"",'','',1,'hand','','',1,action,'','content/bilder/education_but.jpg',"Flyer Unterricht")
	
	
	
	
	htmS+=drawDivPic("bookingBut",714,563,160,48,"",'','',1,'hand','','',1,'onclick="goBooking(0)"','','content/bilder/but_buchen_' + language + '.gif','')	
	
	
	return htmS
}
function siteEx4(){
	var htmS=""

	return htmS
}

function showPic(index){
	p='content/gallery/' + picList[index][0] + '.jpg'
	a=picList[index][1]
	t=""
	goPicView(p,a,t)
}
function privateResize(){
	if(window.innerWidth){allW = window.innerWidth;allH = window.innerHeight}
	else{allW=document.body.offsetWidth;allH=document.body.offsetHeight}
	
	aW=allW-4;aH=allH-4
	if(aW<850){aW=850}
	if(aH<tH){aH=tH;aW=aW-20}
}

function changeExMenu(typ,index){
	//ty=["passive","active"]
	if(typ==0){
		obj=eval('document.getElementById("exMenuP' + index + '")')
		obj.style.visibility="visible"		
	}
	else{
		obj=eval('document.getElementById("exMenuP' + index + '")')
		obj.style.visibility="hidden"
	}
	
}

function goHeighlightMail(index){
	w=["normal","bold"]

	document.getElementById("schurigMail").style.fontWeight=w[index]
}

function goKikumed(){
	window.open("kikumed/index.php","","left=50, top=50, width=150, height=150")
}

function selLanguage(index){
	self.location='seite.php?p=' + orgPart + '&m=' + orgMain + '&s=' + orgSub + "&exAct=" + index
}

function setWMP(media){
	HTs=""
	HTs+='<OBJECT ID="myPlayer"  width="148" height="45" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" CODEBASE=" http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
		HTs+='<PARAM NAME="FileName" VALUE="' + media + '">'
		HTs+='<PARAM NAME="TransparentAtStart" Value="false">'
		HTs+='<PARAM NAME="AutoStart" Value="false">'
		HTs+='<PARAM NAME="AnimationAtStart" Value="false">'
		HTs+='<PARAM NAME="ShowStatusBar" Value="false">'
		HTs+='<PARAM NAME="ShowControls" Value="true">'
		HTs+='<PARAM NAME="autoSize" Value="true">'
		HTs+='<PARAM NAME="displaySize" Value="false">'
		HTs+='<PARAM NAME="ShowAudioControls" Value="true">'
		HTs+='<PARAM NAME="ShowPositionControls" Value="false">'
		HTs+='<Embed type="application/x-mplayer2" pluginspage=" http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" FileName="' + media + '" ID="myPlayer" Name="myPlayer"  width="148" height="45" transparentAtStart="false" autostart="false" animationAtStart="false" ShowControls="true" ShowAudioControls="true" ShowPositionControls="false" autoSize="true" ShowStatusBar="false" displaySize="false">'
		HTs+='</embed>'
	HTs+='</OBJECT>'
	return HTs
}

function mpPlay(index){
	if(isSound>-1){
		obj=eval('document.getElementById("soundsName' + isSound + '")')
		obj.style.color="#000000"
		document.getElementById("myPlayer").stop()
	}
	isSound=index
	
	y=334
	for(n=0;n<soundList.length;n++){
		obj=eval('document.getElementById("soundsName' + n + '")')
		obj.style.top=y
		if(n==isSound){
			obj=eval('document.getElementById("soundsName' + n + '")')
			obj.style.color="#cc0000"			
			obj=document.getElementById("soundsOn")
			obj.style.top=y+3
			obj.style.visibility="visible"
			y=y+30
			obj=document.getElementById("soundPlayer")
			obj.style.top=y
			obj.style.visibility="visible"
			y=y+20
		}
		y=y+30
	}
	y=y+30
	document.getElementById("cd4ladies").style.top=y
	y=y+120
	document.getElementById("repertoire").style.top=y
	
	document.getElementById("myPlayer").fileName="content/sounds/" + soundList[isSound][0]
	document.getElementById("myPlayer").autoStart="true"
}

function mpStop(){
	obj=eval('document.getElementById("soundsName' + isSound + '")')
	obj.style.color="#000000"	
	document.getElementById("myPlayer").stop()
	obj=document.getElementById("soundsOn")
	obj.style.visibility="hidden"
	obj=document.getElementById("soundPlayer")
	obj.style.visibility="hidden"	
	y=334
	for(n=0;n<soundList.length;n++){
		obj=eval('document.getElementById("soundsName' + n + '")')
		obj.style.top=y
		y=y+30
	}
	y=y+30
	document.getElementById("cd4ladies").style.top=y
	y=y+120
	document.getElementById("repertoire").style.top=y	
	isSound=-1
}

function goRepertoire(){
	w=600;h=500
	winPos=windowPlace(w,h)
	window.open("repertoire.php","","left=" + winPos[0] + ", top=" + winPos[1] + ", width=" + w + ", height=" + h)		
}

function goGala(){
	w=800;h=600
	winPos=windowPlace(w,h)	
	window.open("content/download/gala_flyer.pdf","","left=" + winPos[0] + ", top=" + winPos[1] + ", width=" + w + ", height=" + h)	
}

function goUnterricht(){
	goFormatKapitel('0,5,0')
}

function goBooking(index){
	w=400;h=500
	winPos=windowPlace(w,h)
	window.open("buchung.php?typ=" + index + "&lang=" + language,"","left=" + winPos[0] + ", top=" + winPos[1] + ", width=" + w + ", height=" + h)	
}

function sysMenuResize(){ 
	//x=m_menuX
	x=235
	for(n=0;n<m_buts[0].length;n++){
		nText=m_buts[0][n].split(/\#/)
		if(nText[0].substr(0,1)!="-" & nText[0].substr(0,2)!="??"){
			newText=nText[0+language].split(/\|/)
			newText[0]=newText[0].replace(/\?/g,"");newText[0]=newText[0].replace(/ /g,"#")
			obj=eval('document.getElementById("menuMainText' + n + '")')
			obj.style.width=10;obj.innerHTML=newText[0];w=obj.scrollWidth+20
			newText[0]=newText[0].replace(/\#/g," ")
			obj.innerHTML=newText[0];obj.style.width=w;obj.style.left=x
			obj=eval('document.getElementById("menuBack' + n + '")')
			obj.style.left=x;menuClip[n][0]=x;menuClip[n][2]=w
			x=x+w+6
		}
	}
}

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
}
