
var swf = null;

function initialize() {
    dhtmlHistory.initialize();
    dhtmlHistory.addListener( historyChange );
    swf = document.getElementById("mainSWF");
	
	var hash = document.location.hash;
	hash = hash.substring(1, hash.length);
	refreshTitle( hash );
	
}

function insertFlash()
{
    document.write('<object type="application/x-shockwave-flash" id="mainSWF" name="mainSWF" data="flash/nexus.swf"  width="100%" height="100%">\n');
    document.write('    <param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('    <param name="swliveconnect" value="true" />\n');
    document.write('    <param name="movie" value="flash/nexus.swf" />\n');
    document.write('    <param name="base" value="flash/" />\n');
    document.write('    <param name="quality" value="high" />\n');
    document.write('    <p>Ihr Browser verfügt offensichtlich derzeit nicht über das Flashplugin,\n');
    document.write('    jedenfalls nicht in der erforderlichen Version.<br>\n');
    document.write('    Bitte laden Sie es unter folgendem Link herunter.<br>\n');
    document.write('    <a href="http://www.macromedia.com/go/getflashplayer">\n');
    document.write('    http://www.macromedia.com/go/getflashplayer</a></p>\n');
    document.write('</object>\n');
    
}

function historyChange(newLocation, historyData) {
    //callAS("switchMenu", newLocation);
    if(swf != null) swf.switchMenu( newLocation );
    refreshTitle( newLocation );
}

/* function callAS(command, arg) {
    if( swf != null) swf.SetVariable("/jsCon:callAS", command + "|" + arg );
} */

function refreshTitle( arg ) {
	if( arg != null && arg != "" ) {
		// var mID = Number(arg.split("-")[0])-1;
		// var sID = Number(arg.split("-")[1])-1;
		var segs = arg.split("/"); // #news/001/interactive/mission
		document.title = "n-load.com // v3 nexus / fullservice agency / " + segs[0];

//		s_btn = new Array();
//		s_btn[0] = new Array();
//		s_btn[1] = new Array();
//		s_btn[2] = new Array();
//		s_btn[3] = new Array();
//		
//		s_btn[0][0] = "news";
//		s_btn[1][0] = "showcases";
//		s_btn[2][0] = "company";
//		s_btn[3][0] = "contact";
		
//	    document.title = "nexus is coming // " + s_btn[mID][0];
	}
}
