/*
	BOB Design http://www.bob-design.de/
	Imagion AG http://www.imagion.de/
	Javascript Datei
	15.11.2007 Daan Meskers
	$last_change: 16.11.2007 Daan Meskers
*/



window.onload = function() {
		var query = window.location.search
			query = query.substring(1)
			searchArray = query.split("&")
		var query = new Array()
		for (var i=0; searchArray[i]; i++ ){
			var daten = searchArray[i].split("=")
			var key = daten[0] 
			var myvalue = daten[1]
			query[key] = myvalue
		}
			
		// so = new SWFObject("/fileadmin/templates/swf/presentation.swf?myid="+query["id"], "BOBflash", "100%", "100%", "9", "");
		var myurl = "/fileadmin/templates/swf/bob.swf"
		if ( query["test"] )
			myurl = "/fileadmin/templates/swf/bob2.swf"
		if ( query["id"] )
			myurl += "?myid="+query["id"]
		else {
			var myhref = window.location.href
			myhref = myhref.replace(/http:\/\/[\w\d-_\.]+\.\w{2,5}[\/]/gi, "" )
			//window.alert( myhref+ " - "+ myhref.indexOf( "#"))
			myurl += "?mylink="+escape( myhref )
		}
		so = new SWFObject(myurl, "BOBflash", "100%", "100%", "9", "");
		so.addParam('allowScriptAccess', 'always');
		so.addParam('wmode', 'opaque');
		so.write("BOBflash");
}


// ============ setURL :: Flash interaction  ============ 
function setURL( mylink ) {
	var myurl = window.location.href
	window.location.hash = "/"+mylink
}

// ============ onload CSS Loader ============ 
var msie, dom, opera, mozilla
if ( !window.opera && navigator.userAgent.indexOf( "MSIE" ) > 0 ) {
	/* msie = 4; writeCSS( "bc.msie.styles" );
	if ( navigator.userAgent.indexOf( "MSIE 7" ) > 0 ) {
		msie = 7; writeCSS( "bc.msie7.styles" );
	} else if ( navigator.userAgent.indexOf( "MSIE 6" ) > 0 ) {
		msie = 6; writeCSS( "bc.msie6.styles" );
	} else if ( navigator.userAgent.indexOf( "MSIE 5" ) > 0 ) {
		msie = 5; writeCSS( "bc.msie5.styles" );
	} */
} else if ( window.opera ) {
	// opera = true; writeCSS( "bc.opera.styles" );
} else if ( navigator.userAgent.indexOf( "Gecko" ) > 0 ) {
	/* mozilla = 2
	if ( navigator.userAgent.indexOf( "Firefox\/1.5" ) > 0 ) 	mozilla = 1.5
	else if ( navigator.userAgent.indexOf( "Firefox\/1" ) > 0 )	mozilla = 1
	else if ( navigator.userAgent.indexOf( "Firefox\/0" ) > 0 )	mozilla = 0
	*/
	if ( navigator.userAgent.indexOf( "KHTML" ) > 0 )
		writeCSS( "safari" );
}
function writeCSS( cssurl ) {
	document.write( '<link href="lib/css/bc.'+cssurl+'.styles.css" rel="Stylesheet" type="text/css" />' )
} 

