// JavaScript Document - Created by Martin Kremecek May 2004

index = new Array;
index['newsball_slice'] = new Array('newsball_slice.gif', 'newsball_slice_f2.gif', 'newsball_slice_f3.gif', 'news_slice', 'news_slice.gif', 'news_slice_f2.gif'); 
index['filmoball_slice'] = new Array('filmoball_slice.gif', 'filmoball_slice_f2.gif', 'filmoball_slice_f3.gif', 'filmo_slice', 'filmo_slice.gif', 'filmo_slice_f2.gif'); 
index['produball_slice'] = new Array('produball_slice.gif', 'produball_slice_f2.gif', 'produball_slice_f3.gif', 'produ_slice', 'produ_slice.gif', 'produ_slice_f2.gif');
index['dvdball_slice'] = new Array('dvdball_slice.gif', 'dvdball_slice_f2.gif', 'dvdball_slice_f3.gif', 'dvd_slice', 'dvd_slice.gif', 'dvd_slice_f2.gif' );
index['serviceball_slice'] = new Array('service_ball_slice.gif', 'service_ball_slice_f2.gif', 'service_ball_slice_f3.gif', 'service_slice', 'service_slice.gif', 'service_slice_f2.gif' );
index['aboutball_slice'] = new Array('aboutball_slice.gif', 'aboutball_slice_f2.gif', 'aboutball_slice_f3.gif', 'about_slice', 'about_slice.gif', 'about_slice_f2.gif');
index['contactball_slice'] = new Array('contactball_slice.gif', 'contactball_slice_f2.gif', 'contactball_slice_f3.gif', 'contact_slice', 'contact_slice.gif', 'contact_slice_f2.gif');
index['guestball_slice'] = new Array('guestball_slice.gif', 'guestball_slice_f2.gif', 'guestball_slice_f3.gif', 'guest_slice', 'guest_slice.gif', 'guest_slice_f2.gif');
index['linksball_slice'] = new Array('linksball_slice.gif', 'linksball_slice_f2.gif', 'linksball_slice_f3.gif', 'links_slice', 'links_slice.gif', 'links_slice_f2.gif');
index['home_slice'] = new Array( 'home_slice.gif','home_slice_f2.gif', 'home_slice_f2.gif', 'home_slice', 'home_slice.gif', 'home_slice_f2.gif' );

pageToSlice = new Array;
pageToSlice['FILMS'] = 'filmoball_slice';
pageToSlice['NEWS'] = 'newsball_slice';
pageToSlice['IN_PRODUCTION'] = 'produball_slice';
pageToSlice['DVD'] = 'dvdball_slice';
pageToSlice['SERVICE'] = 'serviceball_slice';
pageToSlice['ABOUT'] = 'aboutball_slice';
pageToSlice['CONTACT'] = 'contactball_slice';
pageToSlice['GUESTBOOK'] = 'guestball_slice';
pageToSlice['LINKS'] = 'linksball_slice';
pageToSlice['HOME'] = 'home_slice';

mlink = new Array;
mlink['newsball_slice'] = 'news.htm'; 
mlink['filmoball_slice'] = 'films.htm'; 
mlink['produball_slice'] = 'inproduction.htm'; 
mlink['dvdball_slice'] = 'dvd.htm'; 
mlink['serviceball_slice'] = 'service.htm'; 
mlink['aboutball_slice'] = 'about.htm'; 
mlink['contactball_slice'] = 'contact.htm'; 
mlink['guestball_slice'] = 'guestbook.php'; 
mlink['linksball_slice'] = 'links.htm'; 
mlink['home_slice'] = 'start2.htm'

mlink['aw'] = 'about.htm'
mlink['disclaimer'] = 'disclaimer.htm'

subdir="navpics/";
selected = null;

function MM_findObj(n, d) 
{ 
  var p,i,x=null;  
  
  if(!d) d=document; 
  if( (p=n.indexOf("?") ) >0 && parent.frames.length) 
  {  
    d=top.parent.frames['upperframe'].document; 
	if( !d ) alert("DOCUMENT NOT FOUND");
	n=n.substring(0,p);
  }
  if( !( x=d[n] ) && d.all ) 
      x=d.all[n]; 
  for ( i=0; !x && i<d.forms.length; i++) 
  		x=d.forms[i][n];
  for ( i=0; !x && d.layers && i<d.layers.length; i++) 
  		x=MM_findObj(n, d.layers[i].document);
  if( !x && d.getElementById) 
  		x=d.getElementById(n);
  //if( !x ) 
  	//alert("ELEMENT " + n + " NOT FOUND");
  return x;
}


function MM_swapImage() 
{
  var i,j=0,x,a=MM_swapImage.arguments; 
   
   document.MM_sr=new Array; 
   for(i=0;i<(a.length-2);i+=3)
    {	
	   if ((x=MM_findObj(a[i]))!=null)
	   {
		   document.MM_sr[j++]=x; 
		   if(!x.oSrc) 
		        x.oSrc=x.src; 
		   x.src=a[i+2];	   
	   }
	}
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function swapSlice( name, ind  ){
 
   if ( selected && (selected == name)) return; 
   img2 = subdir+index[name][ind+4];
   img1 = subdir+index[name][ind];
   name2 = index[name][3];
  
   if( img1 ) MM_swapImage( name, '', img1, 1);
   if( img2 ) MM_swapImage( name2, '', img2, 1 );
  
}

function updateClick( pitem )
{
  	top.parent.frames['contentframe'].location.href = mlink[ pitem ]	
}

function selectSlice( name, ind ) {
  if( ind == 1 ) ind = 2;
  img = subdir+index[name][ind];
  
  if ( img ) 
  {
    MM_swapImage( name, '', img, 1 );  
	
    if( selected != null )
	{ oldsel = selected
	  selected = name;
	  swapSlice( oldsel, 0 );
	}
	selected = name;
	updateClick(selected);
  }
}

function setSubdir( dir )
{
	subdir = dir
}


//called at onLoad of a page to make sure the navigation is corrected if user jumps to a page without using the navigation (e.g. with back and forward browser buttons)
function pageRecallSelect( name ) {
   
   slicename = pageToSlice[name];	
   navbar =  top.parent.frames.upperframe.navbar;
   //navbar.setSubdir("navpics/")
   navbar.selected = null;
   navbar.deselectAll();   
					
   navbar.swapSlice( slicename, 1 );  
   img = "navpics/"+index[slicename][2];
   navbar.MM_swapImage( slicename, '', img, 1 );
   
   navbar.selected = slicename;
	//navbar.setSubdir("")
}

function deselectAll(  )
{	
	 selected = null;
	 	 
	 for( var el in index )
	 {	  
	  swapSlice( el, 0 );	  	 
	 }		 
}

function linkClick( pitem )
{
  	top.parent.frames['contentframe'].location.href = mlink[ pitem ]	
}
//////////////////////////////////////////////////////
//language function stuff
//////////////////////////////////////////////////////


inv_lang = new Array;
inv_lang['de'] = 'en';
inv_lang['en'] = 'de';

function setLang( lang )
{	
	//document.all[ lang ].className = "unlangsel";
	//document.all[ inv_lang[lang]].className = "langunsel";	
}


