
aHeadImg=new Array();
iHeadImg = 0;
iHeadImgTime = 2000;

function myOnload(){
//	myonresize()
// alert(tstr);
	flipImages();
//	alert(aImgs.join("\n"))
//	myObj=actImage();
}

function flipImages(){
	iHeadImg=0;
	aHeadImg=tstr.split(",");
	oID("HeadImg").src="uploads/media/"+aHeadImg[iHeadImg];
	window.setTimeout("nextImage("+iHeadImg+")",iHeadImgTime)
}

function nextImage(i){
	iHeadImg=i+1
	if(iHeadImg == aHeadImg.length) iHeadImg = 0;
	oID("HeadImg").src="uploads/media/"+aHeadImg[iHeadImg];
	window.setTimeout("nextImage("+iHeadImg+")",iHeadImgTime)
}

function _myonload(){
	oWin.init()
	if(oWin.Width>890){
		oID('outerWrapper').style.left=parseInt((oWin.Width-890)/2)
	}else{
		oID('outerWrapper').style.left=0
	}

	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);
	

	theH=Math.max(contHeight,contHeightR);
	theH=Math.max(440,theH);
	theH=Math.min(oWin.Height,theH+140);
	
	oID('contentWrapper').style.height=parseInt((theH-20))
	oID('contentMainWrapper').style.height=parseInt((theH-140))
	if(oID('ULSubMenu').innerHTML=='')hideD('subMenu')
	if(oWin.Height < theH)oID('BodyID').style.overflow='auto';
}
function myonresize(){
	oWin.init()
	window.defaultStatus=(oWin.Width + " / " + oWin.Height)
	if(oWin.Width < 1200){
		oID('outherWrapper').style.left=0;
		oID('outherWrapper').style.marginLeft=0;
	}else{
		oID('outherWrapper').style.marginLeft=-600;
		oID('outherWrapper').style.left="50%";
	}
	if(oWin.Height < 800){
		oID('outherWrapper').style.top=0
		oID('outherWrapper').style.marginTop=0
	}else{
		oID('outherWrapper').style.marginTop=-400;
		oID('outherWrapper').style.top="50%";
	}
	if((oWin.Height < 680) || (oWin.Width < 1000)){
		oID('BodyID').style.overflow="auto";
	}else{
		oID('BodyID').style.overflow="hidden";
	}
}

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 LoadTeam(me,wich){
	parent.LoadTeam(me,wich);
}





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();
}

function mlncdm(maddress,mdomain){
	mailaddr=maddress+"@"+mdomain;
	location.href="mailto:"+mailaddr.replace(/ /g,".");
}
function mlncd(maddress,mdomain,what){
	mailaddr=maddress+"@"+mdomain;
	return mailaddr.replace(/ /g,".");
}

function actNextImage(){
	alert(1)
	myObj=actImage();
	myObj.className="singleact";
	// document.location.href=myObj.nextSibling.nextSibling.firstChild.nextSibling.firstChild.nextSibling.firstChild.nextSibling;
	// if(myObj.nextSibling.nextSibling.firstChild.firstChild.firstChild){
	// alert(myObj.nextSibling.className)
	if(myObj.nextSibling.className == "single"){
		document.location.href=myObj.nextSibling.firstChild.firstChild.firstChild.href;
	}else{
		document.location.href=myObj.nextSibling.nextSibling.firstChild.firstChild.firstChild.href;
	}
}
function actImage(){
	alert(1)
	aThLinks=document.getElementsByTagName("DIV");
	var firstSingle=-1;
	var i=0;
	for (i=0; i < aThLinks.length; i++){
		if(aThLinks[i].className === "singleact"){
			firstSingle=i;
			myObj=aThLinks[i];
		}else{
			if((firstSingle==-1) && (aThLinks[i].className === "single")){
				firstSingle=i;
				myObj=aThLinks[i];
			}
		}
	}
	myObj.className="singleact";
	// oID("Legende").innerHTML=myObj.firstChild.nextSibling.nextSibling.nextSibling.innerHTML;
	oID("Legende").innerHTML=myObj.firstChild.nextSibling.innerHTML;
return(myObj);
} 
