
aFiles=new Array()
function DoGal(Files,ii){
	aFiles=Files
	if(typeof ii == 'undefined')ii=0;
//	window.setTimeout("changeImg(0)",1000);
}
function changeImg(i){
	oID('imgShowtime').src="fileadmin/Dateien/Bilder/Schaufenster/"+aFiles[i]
	if(i < (aFiles.length-1)){
		i++;
	}else{
		i=0
	}
	window.setTimeout("changeImg("+i+")",3000);
}

function colalign(master,slave){
	oID('c'+slave).style.display='block';
	oID('c'+slave).style.height=oID('c'+master).offsetTop;
}

var bla=""
function myonload(){
	if(! oID('SMLi1ACT')){
		bla=oID('contentMain').innerHTML;
		showD('flashContainer');
		oID('flashContainer').innerHTML=bla;
		oID('contentMain').innerHTML="";
		hideD('contentMain');
		hideD('innerWrapper');
		hideD('MenuTop');
		hideD('MenuLeft');
		window.setTimeout("CloseIntro()",5000)
	}else{
		pagealias=getActTitle()
		if((pagealias=='Schaufenster') || (pagealias=='Signet') || (pagealias=='Team')){
			var inhalt=oID('contentMain').innerHTML;
			if(pagealias!='Team'){
				if(pagealias!='Team'){
					var aaParts=getScrollbarSection(inhalt);
					var aParts=aaParts[1].split(/\Image block\: \[begin\] \-\-\>/i);
					NewcCont=aParts[1];
					oIMG=oID('totGal').firstChild;
					aWTot=aHMax=0;
					var Ausdruck = /(\d+)/;
					while(oIMG){
						aAttrs=oIMG.innerHTML.split(/ width=/i);
						Ausdruck.exec(aAttrs[1]);
						aWTot=aWTot+parseInt(RegExp.$1)+20;

						aAttrs=oIMG.innerHTML.split(/ height=/i);
						Ausdruck.exec(aAttrs[1]);
						aHMax=Math.max(aHMax,parseInt(RegExp.$1)+20);

						oIMG=oIMG.nextSibling;
					}
					oID('contentMain').innerHTML="<div id='Gal'><div id='lyr1' style='width:"+aWTot+"px;'><div id='t1' style='width:"+aWTot+"px;'><div id='myPos' style='position:absolute;left:0px;'></div>"+NewcCont + " --></div></div></div>"+aaParts[0];
//					oID('lyr1').style.width=aWTot;
//					oID('t1').style.width=aWTot;
					oID('Gal').style.height=aHMax;
					if(pagealias=='Signet'){
						oID('scrollbar').style.top="170px";
					}
				}else{
					var aaParts=getScrollbarSection(inhalt);
					var aParts=aaParts[1].split(/\<IMG src=\"/i);
					var instyle=false;
					if(aParts.length < 2){
						instyle=true;
						var aParts=aaParts[1].split(/\<IMG border=0 alt=\"\" src=\"/i);
					}
					aWTot=0;
					NewCont="";
					for(var i = 1; i < aParts.length; i++){
						aPart1=aParts[i].split("\" ");
						aSrc=aPart1[0];
						if(instyle==true){
							aPart2=aParts[i].split("width=");
							aPart3=aParts[i].split("height=");
						}else{
							aPart2=aParts[i].split("width=\"");
							aPart3=aParts[i].split("height=\"");
						}
						aWidth=parseInt(aPart2[1]);
						aWTot=aWTot+aWidth+20;
						aHeight=parseInt(aPart3[1]);
						NewCont=NewCont+"<img class=galerie src='"+aSrc+"' alt='' width="+aWidth+" height="+aHeight+">";
					}
					oID('contentMain').innerHTML="<div id=Gal><div id=lyr1 style='margin-left:0;'><div id=t1>"+NewCont+"</div></div></div>"+aaParts[0];
					oID('lyr1').style.width=aWTot;
					if(pagealias=='Signet'){
						oID('scrollbar').style.top=170;
					}
				}
			}else{
				var aParts=getScrollbarSectionAfter(inhalt);
				NewCont=aParts[0];
				ScrollPart=aParts[1];
				aWTot=1309;
				oID('contentMain').innerHTML="<div id=Gal><div id=lyr1 style='margin-left:0;'><div id=t1>"+NewCont+"</div></div></div>"+ScrollPart;
				oID('scrollbar').style.top="222px";
				oID('lyr1').style.width=aWTot;
				oID('dragBar').style.width=aWTot;
				oID('Gal').style.height=oID('lyr1').style.height=oID('t1').style.height=oID('contentMain').style.height="690px";
//				oID('lyr1').style.height=690;
//				oID('t1').style.height=690;
//				oID('contentMain').style.height=690;
			}		
			showD('contentMain');
		}
	}
}
filmRunning=false;
function loadVistaFilm(){
	if(filmRunning==true){
		filmRunning=false;
		hideD('divvistafilm');
		oID('divvistafilm').innerHTML=''
		oID('imgvistafilmklein').src='fileadmin/templates/gfx/vistafilmklein.jpg'
	}else{
		filmRunning=true;
		hideD('imgvistafilm')
		showD('divvistafilm')
		oID('imgvistafilmklein').src='fileadmin/templates/gfx/vistafilmoff.jpg'
		showD('imgvistafilmklein')
		oID('divvistafilm').innerHTML="<embed id=embvpfilm src='fileadmin/Dateien/Flash/vistapointfilm.swf' quality='high' height='100%' width='100%'></embed>";
		oID('divvistafilm')
	}
}
function ImgOver(me){
//	dw_Scrollbar_Co.scroll();
}
function ImgClick(me){
		pagealias=getActTitle()
jump=((pagealias=='Schaufenster') ? (me.firstChild.width+20) : 630);
oID('myPos').style.left=-parseInt(oID('lyr1').style.left)+jump +'px';
dw_scrollObj.scrollToId('Gal','myPos','lyr1',500)
}

function getActTitle(){
	Title=document.getElementById("SMLi1ACT")
	if(Title){
		return(Title.firstChild.firstChild.data);
	}else return("undefined")
}

var wndo = null;
function init_dw_Scroll() {
    wndo=new dw_scrollObj('Gal', 'lyr1', 't1');
    wndo.setUpScrollbar("dragBar", "track", "h", 1, 1, true);
    wndo.setUpScrollControls('scrollbar',1,"h");
}

function getScrollbarSectionAfter(inhalt){
	var aParts=inhalt.split(/<div class="tx-mnxhscrollbar-pi1">/i);
	if(aParts.length < 2){
		aParts=aParts[0].split(/<DIV class=tx-mnxhscrollbar-pi1>/i);
	}
//	aaParts=aParts[0].split(/<!-- begin plugin mnx_hscrollbar -->/i);
	return(new Array(aParts[0],aParts[1]))
}

function getScrollbarSection(inhalt){
	var aParts=inhalt.split(/<!-- end plugin mnx_hscrollbar -->/i);
	aaParts=aParts[0].split(/<div class="tx-mnxhscrollbar-pi1">/i);
	if(aaParts.length < 2){
		aaParts=aParts[0].split(/<DIV class=tx-mnxhscrollbar-pi1>/i);
	}
	return(new Array(aaParts[1],aParts[1]))
}

function CloseIntro(){
	if(window.location.href.substring(0,17)=="http://localhost/"){
		this.location.href='./index.php?id=profil'
	}else{
		this.location.href='./profil/'
	}
}
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
		if(opacity <= 0){
			object.display='none';
		}else{
			object.display='block';
		}		
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = 'alpha(opacity=' + opacity + ')';
}

function __myonload(){
	endCont=document.createElement("p");
	endCont.id='endCont';
	oID("contentMain").appendChild(endCont);

	endContR=document.createElement("p");
	endContR.id='endContR';
	oID("contentRightCol").appendChild(endContR);

	contHeight=parseInt(oID('endCont').offsetTop);
	contHeightR=parseInt(oID('endContR').offsetTop);
	contHeightWin=parseInt(oID('breadcrumb').offsetTop);
	theH=Math.max(contHeight,contHeightR)+145;
	if(oWin.Height < theH)oID('BodyID').style.overflow='auto';
	oID('BodyID').style.height=Math.max(theH,oWin.Height);
	oID('outerWrapper').style.height=contHeightWin-60;
	oID('contentMain').style.height=contHeightWin-318;
	oID('contentRightCol').style.height=contHeightWin-316;
	oID('searchMenu').style.top=contHeightWin-105;
}



function onmout(which,L){
	aM[which]=aM[which]-1;
	setTimeout('onmout2(\"'+which+'\",\"'+L+'\")',1);
}
function onmout2(which,L){
		if(aM[which]==0){
			oID('mml_'+which).src='fileadmin/templates/gfx/menu/'+L+'/'+which+'_off.gif'
			hideD('ULSub_'+which);
		}
}

function onmover(which,L){
		aM[which]=aM[which]+1;
		oID('mml_'+which).src='fileadmin/templates/gfx/menu/'+L+'/'+which+'_on.gif';
}

function onsover(me,which){
	me.style.color='#FF0000';
}
function onsout(me,which){
	me.style.color='#000000';
}

var DHTML=0, DOM=0, MS=0, NS=0, OP=0;

function DHTML_init(){
	if(window.opera){OP=1;}
	if(document.getElementById){DHTML=1;DOM=1;}
	if(document.all && !OP){DHTML=1;MS=1;}
	if(window.netscape && window.screen && !DOM && !OP){DHTML=1;NS=1;}
}

function oID(ID){
	if(DOM){if(typeof document.getElementById(ID)=='object')return(document.getElementById(ID)); else return(void(0));
	}else if(MS){if(typeof document.all[ID]=='object')return(document.all[ID]);else return(void(0));
	}else if(NS){if(typeof document[ID]=='object')return(document[ID]);else return(void(0));}
}
function oName(p2){
	if(DOM){if(typeof document.getElementsByName(p2)=="object")return(document.getElementsByName(p2)[0]);	else return(void(0));
	}else if(MS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));
	}else if(NS){if(typeof document[p2]=="object")return(document[p2]);	else return(void(0));}
}
DHTML_init();

var oWin=new oWIN();
var curMenu="";
var curUMenu="";
var oldUMenu="";

function hide(ID){
	oID(ID).style.visibility="hidden";
}
function show(ID){
	oID(ID).style.visibility="visible";
}
function hideD(ID){
	oID(ID).style.display="none";
}
function showD(ID){
	oID(ID).style.display="block";
}
function hideIF(Name){
	oID(Name).style.visibility="hidden";
}
function showIF(Name){
	oID(Name).style.visibility="visible";
}
function LoadIFrame(mytarget,file){
	oID(mytarget).src=file;
}


function oWIN(){
	this.BodyName='BodyID';
	this.Width=0;
	this.Height=0;
	this.init=_oWIN_init;
	this.setName=_oWIN_SetName;
//	this.resize2min=_oWIN_resize2min;
}
function _oWIN_SetName(BodyName){
	this.BodyName=BodyName;
}
function _oWIN_init(){
	if((document.all)&& (OP==0)){
		this.Width=oID(this.BodyName).offsetWidth;
		this.Height=oID(this.BodyName).offsetHeight;
	}else{
		this.Width=window.innerWidth;
		this.Height=window.innerHeight;
	}
	if(typeof this.Width=="string")this.Width=parseInt(this.Width);
	if(typeof this.Height=="string")this.Height=parseInt(this.Height);
}

function _oWIN_resize2min(minWidth,minHeight){
	if(this.Width < minWidth){
		window.resizeBy(minWidth-this.Width,0);
	}
	if(this.Height < minHeight){
		window.resizeBy(0,minHeight-this.Height);
	}
	this.init();
}
oWin=new oWIN();
// window.onresize=myonload
