	// general var inits	var i, j, s, simpleMime;	var menus = [{ file:'intro.html', text:'General' }, { file:'modules.html', text:'Modules' }, { file:'performances.html', text:'Performances' }, { file:'workshops.html', text:'Workshops' }, { file:'output.html', text:'Output' }, { file:'personnel.html', text:'Personnel' }, { file:'imprint.html', text:'Imprint' }];	var objectCount = 0;	// split path part of URL and 'search' part	var locFull = location.href;	var locPath, locParams, locFile;	i = locFull.indexOf("?");	if( i >= 0 ) {		locPath		= locFull.substring( 0, i );		locParams	= locFull.substring( i + 1 );	} else {		locPath		= locFull;		locParams	= "";	}	i = locPath.lastIndexOf("/")+1;	j = locPath.indexOf(".htm",i);	if( j > i ) {		locFile = locPath.substring( i, j );	} else {		locFile = locPath;	}			// retrieve parameters and put them into an array of objects	var paramStrings	= locParams.split("&");	var paramArray		= new Array();			for( i = 0, j = 0; i < paramStrings.length; i++ ) {		s = paramStrings[i].split("=");		if( s.length == 2 ) {			paramArray[j++]	= { name: s[0], value: s[1] };//			alert("name:"+s[0]+",value:"+s[1]);		}	}	for( i = 0, j = paramArray.length; i < j; i++ ) {		paramArray[paramArray[i].name]	= paramArray[i];	}	s			= navigator.userAgent;	// opera 6 doesn't understand video/mp4 and audio/mp3 ...	simpleMime 	= s.indexOf('Opera') != -1;	// split path part of URL and 'search' part	var locFull = location.href;	var locPath, locParams, locFile;	i = locFull.indexOf("?");	if( i >= 0 ) {		locPath		= locFull.substring( 0, i );		locParams	= locFull.substring( i + 1 );	} else {		locPath		= locFull;		locParams	= "";	}	i = locPath.lastIndexOf("/");	locFile = locPath.substring( i+1 );			function showElement( id, state )	{		var element;			element = document.getElementById( id );		if( element ) {			element.style.display = (state ? "block" : "none" );		}	}	// create a table for page navigation	function writeNavBar()	{		var htmlNav = '<DIV ID="left"><IMG SRC="../images/left.jpg" WIDTH=196 HEIGHT=44 ALT=""></DIV><DIV ID="menu"><UL>';		var i;				for( i = 0; i < menus.length; i++ ) {			if( locFile.indexOf( menus[i].file ) == -1 ) {				htmlNav += '<LI><A HREF="'+menus[i].file+'">'+menus[i].text+'</A></LI>';			} else {				htmlNav += '<LI>'+menus[i].text+'</LI>';			}		}		htmlNav += '</UL></DIV>';		document.write( htmlNav );	}	function checkMime( exactMime )	{		var i;			if( simpleMime ) {			i = exactMime.indexOf( "mp3" );			if( i == - 1 ) {				i = exactMime.indexOf( "mp4" );			}			if( i != -1 ) {				return( exactMime.substring( 0, i ) + "mpeg" );			}		}		return exactMime;	}	function createURL( name, newParams )	{		var locFull = name;		var delim	= "?";		var i;				for( i = 0; i < paramArray.length; i++ ) {			locFull += delim + paramArray[i].name + "=" + paramArray[i].value;			delim	 = "&";		}		if( newParams ) {			for( i = 0; i < newParams.length; i++ ) {				locFull += delim + newParams[i].name + "=" + newParams[i].value;				delim	 = "&";			}		}		return locFull;	}			function load( name )	{		closeContextWindows();		location.href = createURL( name );	}		// reload page to adapt to new size settings etc.	// browser history is not affected	function reload()	{		closeContextWindows();		location.replace( createURL( locPath ));	}	function closeContextWindows()	{	}	function setTitle( name )	{		document.title = name;	}	// read a parameter like language, image size etc.	function getParam( name, defValue )	{		var obj = paramArray[ name ];		if( obj && (typeof obj.value != "undefined") ) {			return obj.value;		} else {			return defValue;		}	}	// likewise set an parameter			function setParam( name, value )	{		var obj = paramArray[ name ];		if( obj ) {			obj.value = value;		} else {			obj = { name: name, value: value };			paramArray[paramArray.length] = obj;			paramArray[name] = paramArray[paramArray.length-1];		}	}	function writeAudioObject( humanName, fileName, mimeType )	{		var htmlCode = '<DIV CLASS="audioobject" STYLE="top:'+(objectCount*36+308)+'px;">';		htmlCode += '<SPAN CLASS="objectdescr">'+humanName+'</SPAN>';		mimeType  = checkMime( mimeType );		htmlCode += '<OBJECT CLASS="audioobject" STYLE="top:'+(objectCount*36+324)+'px;" CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="160" HEIGHT="16" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"><PARAM name="SRC" VALUE="'+fileName+'"><PARAM NAME="AUTOPLAY" VALUE="false"><PARAM NAME="CONTROLLER" VALUE="true"><PARAM NAME="SCALE" VALUE="tofit"><EMBED SRC="'+fileName+'" TYPE="'+mimeType+'" WIDTH="160" HEIGHT="16" SCALE="tofit" PLUGINSPAGE="http://www.apple.com/quicktime/download/" AUTOPLAY="false" CONTROLLER="true"></OBJECT>';		htmlCode += '</DIV>';		document.write( htmlCode );				objectCount++;	}	function showMovie( file, width, height, addParams )	{		var newParams = [{name:"mov",value:file}];		var i;		if( typeof addParams != "undefined" ) {			for( i = 0; i < addParams.length; i++ ) {				newParams[newParams.length] = addParams[i];			}		}		var movWindow = window.open( createURL("viewmov.html",newParams), "movWindow", "toolbar=no,resizable=yes,scrollbars=no,directories=no,status=no,width="+width+",height="+(height+16) );	} 	function writeQuickTimeObject( humanName, fileName, mimeType, width, height, params )	{		var i;		var htmlCode = '<DIV CLASS="videoobject">';				htmlCode += '<SPAN CLASS="objectdescr">'+humanName+'</SPAN>';		mimeType  = checkMime( mimeType );		htmlCode += '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="'+width+'" HEIGHT="'+height+'" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"><PARAM NAME="SRC" VALUE="'+fileName+'">';		for( i = 0; i < params.length; i++ ) {			htmlCode += '<PARAM NAME="'+params[i].key+'" VALUE="'+params[i].value+'">';		}		htmlCode += '<EMBED SRC="'+fileName+'" TYPE="'+mimeType+'" WIDTH="'+width+'" HEIGHT="'+height+'" ';		for( i = 0; i < params.length; i++ ) {			htmlCode += params[i].key+'="'+params[i].value+'" ';		}		htmlCode += 'PLUGINSPAGE="http://www.apple.com/quicktime/download/"></OBJECT>';		i		  = fileName.lastIndexOf( '.' );		htmlCode += '<DIV CLASS="videoctrl" STYLE="padding-left:'+(width-112)+'px"><A HREF="javascript:showMovie(\''+fileName+'\',600,600)"><IMG SRC="../images/fullscreen.gif" ALT="fullscreen"></A><A HREF="'+fileName.substring( 0, i )+'.qtl"><IMG SRC="../images/qtplayer.gif" ALT="qt player"></A></DIV>';		htmlCode += '</DIV>';		document.write( htmlCode );	}
