var movieNames = {
	1: 'henry.swf',
	2: 'margret.swf',
	3: 'stephan.swf',
	4: 'bernd.swf',
	5: 'gaby_jane.swf'
}

if(self.innerWidth <= 400 || window.innerHeight <= 400 || (document.documentElement.clientHeight<= 400 & document.documentElement.clientHeight!= 0)){	
	self.focus();
	self.resizeTo(980, 760); 	
	if (self != top) top.location = self.location	
}

function randomMovie() {
    do { 
    	index = Math.round(Math.random()*5);
    } while(index == 0)    
    Effect.Appear('mov_film' + index, { duration: 0.1 });

  }


function changeLayers() {
	
	v=location.search.substring(1, location.search.length).split('&');
	getVars = new Array();	
	for (var i = 0; i < v.length; i++) {
	 	var temp = v[i].split('=');
	 	getVars[temp[0]] = temp[1];
	}
	if(getVars['mailed']=="success"){		
    	Effect.Appear("form_danke", { duration: 0.3 });
	}else if(getVars['mailed']=="failed"){
		Effect.Appear("form_error", { duration: 0.3 });
	}else if(getVars['allLayers']!="fadeOut"){
		movie_ids = new Array('mov_film1','mov_film2','mov_film3','mov_film4','mov_film5')
	   	do { 
	    	index = Math.round(Math.random()*movie_ids.length)
	    	} while(index == 0)
	    	Effect.Appear('mov_film' + index, { duration: 0.1 })
	    	Element.update($('mov_film'+index),'<embed name="movie'+index+'" id="movie'+index+'" type="application/x-shockwave-flash" src="filme/'+movieNames[index]+'" width="324" height="202"></embed>');
	  	}		
		
	}
	
  function killGet (){
   
   window.location.href = "./index.html?allLayers=fadeOut";    
 }

  function sendTrailer(trailer){
   Effect.Appear("trailer_form", { duration: 0.3 });        
   document.form.sendTrailer.value = trailer;    
 }
  
  
function showHideMovies(showMovie){
	var movie_divs = document.getElementsByClassName('movie_div');
	for(var i=1; i<=movie_divs.length; i++){
		// wenn der Parameter keine Zahl ist (weil eins von den Navi-Elementen), dann alle movies ausblenden; ansonsten alle bis auf den uebergebenen movie ausblenden
		if(isNaN(showMovie) || i != parseInt(showMovie)){
			// alle Filme bis auf den zu zeigenden ausblenden
			Effect.Fade($('mov_film'+i), { duration: 0.1 });
			// Film loeschen
			Element.update($('mov_film'+i),'');
		}else{
			// den showMovie einblenden
			Effect.Appear($('mov_film'+i), { duration: 0.1 });
			// Film einbinden
			Element.update($('mov_film'+i),'<embed name="movie'+i+'" id="movie'+i+'" type="application/x-shockwave-flash" src="filme/'+movieNames[i]+'" width="324" height="202"></embed>');
		}
	}
	Effect.Fade('trailer', { duration: 0.1 });
	// Trailer enthaelt wieder einen Flash-Film, also auch hier das innerHTML loeschen
	if(showMovie != 'trailer'){
		Element.update($('trailer'),'');
	}else{
		// trailer anzeigen
		Element.update($('trailer'),'<embed name="movie'+i+'" id="movie'+i+'" type="application/x-shockwave-flash" src="filme/trailer.swf" width="268" height="224"></embed>');
	}
	Effect.Fade('info', { duration: 0.1 });
	Effect.Fade('impressum', { duration: 0.1 });
	Effect.Fade('downloads', { duration: 0.1 });
	Effect.Fade('shop', { duration: 0.1 });
	Effect.Fade('diskussion', { duration: 0.1 });
	if(isNaN(showMovie)){
		divName = showMovie;
		setTimeout("Effect.Appear(divName, { duration: 0.1 });",350);
	}
}



function openWindow (url) {
  win = window.open(url, "Forum", "width=750, height=530, left=100, top=200, scrollbars=yes");
  win.focus();
}



 
button1= new Image();
button1.src = "img/film1.png"
button2= new Image();
button2.src = "img/film2.png"
button3= new Image();
button3.src = "img/film3.png"
button4= new Image();
button4.src = "img/film4.png"
button5= new Image();
button5.src = "img/film5.png"


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
