	// ----------------------------- //
	//  FIRST ENTERTAINMENT WEBSITE  //
	//  <c> 2005 engine-productions  //
	// ----------------------------- //
	//  don't copy JavaScript Codes  //
	// ----------------------------- //



	// --- CONSTANTS

		var LAYERS = new Array(); // all layers
		var VISION = new Array(); // all layer visions
		var SELECTED="none";
		var CX, CY, MX, MY;
		var LOADING=false;
		var LANG;
		var spURL="", selKAT="";

		// Static Layers: (Name,Cont_X,Cont_Y);
		LAYERS[0] = Array('logo',	 	 80, 50); // +50 wegen neuer Stage
		LAYERS[1] = Array('line1',		243, 58); // +50 wegen neuer Stage
		LAYERS[2] = Array('navi',		230,103);
		LAYERS[3] = Array('line2',		798,110);
		LAYERS[4] = Array('line3',		827,111);
		LAYERS[5] = Array('address',	800,491);
		LAYERS[6] = Array('lang',		912,577);
		LAYERS[7] = Array('loading',	  0,  0);

		// Content Layers: (Name,Line_X,Line_Y,Line_W,Line_H,Cont_X,Cont_Y,Cont_W,Cont_H);
		LAYERS[8]  = Array('news',		280,118,1,25,220,143,250,420);
		LAYERS[9]  = Array('profil',	337,118,1,50,300,168,380,375);
		LAYERS[10] = Array('projekte',	426,118,1,25,380,143,350,405);
		LAYERS[11] = Array('presse',	514,118,1,25,480,143,300,360);
		LAYERS[12] = Array('team',		571,118,1,25,400,143,375,460);
		LAYERS[13] = Array('kontakt',	638,118,1,50,410,168,400,310);
		LAYERS[14] = Array('impressum',	711,118,1,75,200,193,540,346);

		// Foto Layers
		LAYERS[15] = Array('floriundjuergen.jpg',	245,208,55,1, 85,168,160,200);

		// Additional Content Layers
		LAYERS[16] = Array('add_event',		250,380,130,  1,150,300,150,250);
		LAYERS[17] = Array('add_staffel',	350,380, 30,  1,200,300,150,250);
		LAYERS[18] = Array('add_pilot',		250,480,130,  1,150,350,150,250);
		LAYERS[19] = Array('add_service',	350,480, 30,  1,200,350,150,250);
		LAYERS[20] = Array('add_kontakt',	350,350, 60,  1,150,300,200,250);



	// -+- FUNCTIONS
	//  |
	//  +--- ERROR-TERMINATION

		function noError() {
			return false;
		} window.onerror = noError

	//  |
	//  +--- MOUSE-COORDINATES

		var nc  = !!(document.captureEvents && !document.getElementById);
		var nc6 = !!(document.captureEvents && document.getElementById);
		var yPos;
		function get_yPos(e) {
			yPos = (document.all) ? window.event.y : e.pageY;
		} document.onmousemove = get_yPos

	//  |
	//  +--- LAYERS

		function positionize() {
			CX = (window.navigator.appName.indexOf("Explorer")!=-1) ? document.body.clientWidth : window.innerWidth;
			CY = (window.navigator.appName.indexOf("Explorer")!=-1) ? document.body.clientHeight : window.innerHeight;
			MX = ( ( CX / 2 ) - 450 ); MX = (MX<0) ? 0 : MX; MX-=50;
			MY = ( ( CY / 2 ) - 300 ); MY = (MY<10) ? 10 : MY; MY-=50;

			for(i=0;i < 7;i++) { document.getElementById(LAYERS[i][0]).style.visibility = 'hidden';
					     document.getElementById(LAYERS[i][0]).style.left = ( LAYERS[i][1] + MX ) + 'px';
					     document.getElementById(LAYERS[i][0]).style.top  = ( LAYERS[i][2] + MY ) + 'px'; }
			hide("loading");
			showAll();
		}

		function positionizeGroup(groupID,linename,contname) {
			parent.document.getElementById(linename).style.left   = ( LAYERS[groupID][1] + parent.MX ) + 'px';
			parent.document.getElementById(linename).style.top    = ( LAYERS[groupID][2] + parent.MY ) + 'px';
			parent.document.getElementById(linename).style.width  = ( LAYERS[groupID][3] ) + 'px';
			parent.document.getElementById(linename).style.height = ( LAYERS[groupID][4] ) + 'px';
			parent.document.getElementById(contname).style.left   = ( LAYERS[groupID][5] + parent.MX ) + 'px';
			parent.document.getElementById(contname).style.top    = ( LAYERS[groupID][6] + parent.MY ) + 'px';
			parent.document.getElementById(contname).style.width  = ( LAYERS[groupID][7] ) + 'px';
			parent.document.getElementById(contname).style.height = ( LAYERS[groupID][8] ) + 'px';
		}

		function positionizeContent(cont) {
			if(parent.LOADING==false && (navigator.userAgent.indexOf("Safari")<1)) { window.setTimeout("positionizeContent('" + cont + "');",100); }
			else {	positionizeGroup(getLayerNR(cont),"line_cont","content");
				// NEU:
				   parent.parent.document.getElementById("content").firstChild.width   = LAYERS[getLayerNR(cont)][7];
				   parent.parent.document.getElementById("content").firstChild.height  = LAYERS[getLayerNR(cont)][8] - 2;
				// ----
				show("line_cont");
				show("content");
				parent.parent.document.getElementById("content").firstChild.src="content.php?cont=" + cont + "&LANG=" + parent.LANG + spURL;
				spURL=""; }
		}

		function startFirst(lang) {
			/* if(lang=="en") {
				CX = (window.navigator.appName.indexOf("Explorer")!=-1) ? document.body.clientWidth : window.innerWidth;
				CY = (window.navigator.appName.indexOf("Explorer")!=-1) ? document.body.clientHeight : window.innerHeight;
				MX = ( ( CX / 2 ) - 125 ); MX = (MX<0) ? 0 : MX;
				MY = ( ( CY / 2 ) - 100 ); MY = (MY<0) ? 0 : MY;
				document.getElementById("content").style.left   = MX + 'px';
				document.getElementById("content").style.top    = MY + 'px';
				document.getElementById("content").style.width  = '250px';
				document.getElementById("content").style.height = '200px';
				show("content"); hide("loading");
				parent.document.getElementById("content").firstChild.src="content.php?cont=noenglish";
			} else { */
				positionize();
				newMenue(lang,"news");
		}

		function showAll() {
			for(i=0;i < 7;i++) document.getElementById(LAYERS[i][0]).style.visibility = 'visible';
		}

		function show(layer) {
			parent.document.getElementById(layer).style.visibility = 'visible';
		}

		function hide(layer) {
			parent.document.getElementById(layer).style.visibility = 'hidden';
			if(layer=="foto") parent.document.foto_img.src="grafik/page/pixel_trans.png";
			if(layer=="foto2") parent.document.foto2_img.src="grafik/page/pixel_trans.png";
		}

		function hideAllLayers(layer) {
			hide("line_cont"); hide("content");
			hide("line_foto"); hide("foto");
			hide("line_flash"); hide("flash");
			hide("line_foto2"); hide("foto2");
			hide("line_add"); hide("add");
			hide("line_add2"); hide("add2");
			hide("line_toolbar"); hide("toolbar");
		}

		function getLayerNR(layer) {
			for(i=0;i<LAYERS.length;i++) if( LAYERS[i][0] == layer ) { return i; break; }
		}

		function resizeFotoContainer(obj) {
			if((parent.document[obj + '_img'].width > 1) && (parent.document[obj + '_img'].height > 1)) {
				parent.document.getElementById(obj).style.width = parent.document[obj + '_img'].width + 'px';
				parent.document.getElementById(obj).style.height = parent.document[obj + '_img'].height + 'px';
			} else setTimeout('resizeFotoContainer("' + obj + '");',50);
		}



		function showFoto(fotoname) {
			hide("line_foto"); hide("foto");

			if(fotoname=="collage.jpg") { fotoname="collage" + Math.round((Math.random() * 3)) + ".jpg"; positionizeGroup(getLayerNR('collage.jpg'),"line_foto","foto"); }
			else positionizeGroup(getLayerNR(fotoname),"line_foto","foto");
			parent.document.foto_img.src="grafik/pics/" + fotoname;
			show("line_foto"); show("foto");
			resizeFotoContainer('foto');

		}


		function showFlash(flashname) {
			hide("line_flash"); hide("flash");
			positionizeGroup(getLayerNR(flashname),"line_flash","flash");
			show("line_flash"); show("flash");
			var so = new SWFObject("grafik/flash/gallery.swf", "intro", "272", "144", "9", "#ffffff");
			so.write(parent.document.getElementById('flash'));
		}


		function showFoto2(fotoname) {
			hide("line_foto2"); hide("foto2");
			positionizeGroup(getLayerNR(fotoname),"line_foto2","foto2");
			parent.document.foto2_img.src="grafik/pics/" + fotoname;
			show("line_foto2"); show("foto2");
			resizeFotoContainer('foto2');
		}

		function showProjektFoto(fotoname) {
			hide("line_foto"); hide("foto");
			parent.document.foto_img.src="grafik/page/pixel_trans.png";
			if(fotoname!="") {
				positionizeGroup(getLayerNR(fotoname),"line_foto","foto");
				parent.document.getElementById('line_foto').style.top = ( yPos + parseInt(parent.document.getElementById('add').style.top)      ) + 'px';
				parent.document.getElementById('foto').style.top      = ( yPos + parseInt(parent.document.getElementById('add').style.top) - 15 ) + 'px';
				parent.document.foto_img.src="grafik/thumbnail.php?scale=50&path=../data/" + fotoname;
				show("line_foto"); show("foto");
				resizeFotoContainer('foto'); }
		}

		function showProjektFotoBig(fotoname) {
			hide("line_foto"); hide("foto");
			parent.document.foto_img.src="grafik/page/pixel_trans.png";
			if(fotoname!="") {
				positionizeGroup(getLayerNR(fotoname),"line_foto","foto");
				parent.document.foto_img.src="grafik/thumbnail.php?scale=150&path=../data/" + fotoname;
				show("line_foto"); show("foto");
				resizeFotoContainer('foto'); }
		}

		function openProject(ID,kat) {
			hideAllLayers();
			parent.LOADING=false;
			parent.parent.document.getElementById("content").firstChild.src="dummy.html";
			spURL="&ID=" + ID + "&kat=" + kat;
			positionizeProjectContent(); // Rahmen anzeigen und Content laden
		}

		function positionizeProjectContent() {
			if(parent.LOADING==false && (navigator.userAgent.indexOf("Safari")<1)) { window.setTimeout("positionizeProjectContent('projekte');",100); }
			else {	show("line_cont");
					show("content");
					parent.parent.document.getElementById("content").firstChild.src="content.php?cont=projekte&LANG=" + parent.LANG + spURL;
				    spURL=""; }
		}

		function showAddLoader(addname) {
			if(parent.LOADING==false && (navigator.userAgent.indexOf("Safari")<1)) { window.setTimeout("showAddLoader('" + addname + "');",100); }
			else {  if(addname=="event" || addname=="staffel" || addname=="pilot" || addname=="service") { filename="projekte"; addVar="kat"; }
				if(addname=="kontakt") { filename="kontakt"; addVar="FORM"; }
				parent.document.getElementById("add").firstChild.src="content.php?LANG=" + parent.LANG + "&cont=" + filename + "&" + addVar + "=" + addname;
				show("line_add"); show("add"); }
		}

		function showAdd(addname) {
			hide("line_add"); hide("add");
			parent.LOADING=false;
			parent.document.getElementById("add").firstChild.src="dummy.html";
			if(addname=="event" || addname=="staffel" || addname=="pilot" || addname=="service") {
				document.event_img.src="grafik/page/projects_event_out.png";
				document.staffel_img.src="grafik/page/projects_staffel_out.png";
				document.pilot_img.src="grafik/page/projects_pilot_out.png";
				document.service_img.src="grafik/page/projects_service_out.png";
				document[addname + "_img"].src="grafik/page/projects_" + addname + "_selected.png"; }
			positionizeGroup(getLayerNR("add_" + addname),"line_add","add");
			// NEU:
			   parent.parent.document.getElementById("add").firstChild.width   = LAYERS[getLayerNR("add_" + addname)][7];
			   parent.parent.document.getElementById("add").firstChild.height  = LAYERS[getLayerNR("add_" + addname)][8] - 2;
			// ----
			showAddLoader(addname);
		}

		function showToolbar(ID) {
			hide("line_toolbar"); hide("toolbar");
			positionizeGroup(getLayerNR('toolbar'),"line_toolbar","toolbar");
			// NEU:
			   parent.parent.document.getElementById("toolbar").firstChild.width   = LAYERS[getLayerNR('toolbar')][7];
			   parent.parent.document.getElementById("toolbar").firstChild.height  = LAYERS[getLayerNR('toolbar')][8];
			// ----
			parent.document.getElementById("toolbar").firstChild.src='content.php?cont=toolbar&LANG=' + parent.LANG + '&ID=' + ID;
			show("line_toolbar"); show("toolbar");
		}

		function itemDataLoader(page,ID) {
			if(parent.LOADING==false && (navigator.userAgent.indexOf("Safari")<1)) { window.setTimeout("itemDataLoader('" + page + "'," + ID + ");",100); }
			else {  parent.document.getElementById("add").firstChild.src="content.php?cont=" + page + "&LANG=" + parent.LANG + "&ID=" + ID;
				show("line_add"); show("add"); }
		}

		function openItemData(art,ID) {
			hide("line_add"); hide("add");
			hide("line_foto"); hide("foto");
			parent.LOADING=false;
			parent.document.getElementById("add").firstChild.src="dummy.html";
			page="";
			  if(art=="bild") page="bildergalerie";
			  if(art=="movie") page="movieselect";
			  if(art=="doc") page="docselect";
			  if(art=="stats") page="stats";
			  if(art=="newsletter") page="newsletter";
			layer=page;

			if(art=="team") 		{ page="team";       layer="teaminfo"; } // <- Sonderf�lle
			if(art=="newsdetails") 	{ page="news";       layer="newsdetails"; }
			if(art=="pressdetails") { page="presse";     layer="pressdetails"; }

			positionizeGroup(getLayerNR(layer),"line_add","add");
			// NEU:
			   parent.parent.document.getElementById("add").firstChild.width   = LAYERS[getLayerNR(layer)][7];
			   parent.parent.document.getElementById("add").firstChild.height  = LAYERS[getLayerNR(layer)][8] - 2;
			// ----
			itemDataLoader(page,ID);
		}

		function openWebNewsLoader() {
			if(parent.LOADING==false && (navigator.userAgent.indexOf("Safari")<1)) { window.setTimeout("openWebNewsLoader();",100); }
			else {  parent.document.getElementById("add2").firstChild.src="content.php?cont=news&ADDNEWS=true";
				show("line_add2"); show("add2"); }
		}

		function openWebNews() {
			hide("line_add2"); hide("add2");
			parent.LOADING=false;
			parent.document.getElementById("add2").firstChild.src="dummy.html";
			positionizeGroup(getLayerNR("neuaufseite"),"line_add2","add2");
			openWebNewsLoader();
		}



	// |
	// +--- GRAPHICS

		function menueReplacer(lang,imgname,stat) {
			if(SELECTED!=imgname) parent.document[imgname].src = 'grafik/page/menue_' + lang + '_' + imgname + '_' + stat + '.png';
		}

		function newMenue(lang,imgname) {
			hideAllLayers();
			parent.LOADING=false;
			parent.LANG=lang;
			parent.parent.document.getElementById("content").firstChild.src="dummy.html";
			SELECTED=imgname;
			menueReplacer(lang,'news','out');
			menueReplacer(lang,'profil','out');
			menueReplacer(lang,'projekte','out');
			menueReplacer(lang,'presse','out');
			menueReplacer(lang,'team','out');
			menueReplacer(lang,'kontakt','out');
			menueReplacer(lang,'impressum','out');
			parent.document[imgname].src = 'grafik/page/menue_' + lang + '_' + imgname + '_selected.png';
			parent.document.background_img.src = 'grafik/page/background_' + imgname + '.jpg';
			positionizeContent(imgname); // Rahmen anzeigen und Content laden
		}

		function loadNew(lang,imgname) {
			hideAllLayers();
			parent.LOADING=false;
			parent.LANG=lang;
			parent.parent.document.getElementById("content").firstChild.src="dummy.html";
			spURL="&selKAT=" + parent.selKAT;
			positionizeContent(imgname); // Rahmen anzeigen und Content laden
		}
