/*
	11.07.2008 Daan Meskers
	$last_change: 13.07.2008 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
	}	
	var myurl = "/fileadmin/templates/swf/sehnerv.swf"
	if ( query["id"] )
		myurl += "?myid="+query["id"]
	else {
		var myhref = window.location.href
		myhref = myhref.replace(/http:\/\/[\w\d-_\.]+\.\w{2,5}[\/]/gi, "" )
		myurl += "?mylink="+escape( myhref )
	}
	so = new SWFObject(myurl, "´flash", "100%", "100%", "9.0.0");
	so.addParam('allowScriptAccess', 'always');
	so.addParam('wmode', 'opaque');
	so.write("flash");
}


// ============ 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" />' )
} 

