var strCssImport = "<link href='/dms/css/screen.css' rel='stylesheet' type='text/css'>";

function cssImport(doc) {
	if (!doc) doc=document;
	try{
		var css = top.document.styleSheets[0];
		if(css && css.cssText){
			var strOutPut = "";
			strOutPut +="<style>";
			strOutPut += top.document.styleSheets[0].cssText;
			strOutPut +="</style>";
			doc.write(strOutPut);
		} else
			doc.write(strCssImport);
	}
	catch(e){
		doc.write(strCssImport);
	}
}

cssImport();

// Manipulation der Status Zeile
function drebaState() {
	window.status='Dresdner Bank - Die Beraterbank';
	return true;
}

// Update Frames, only Defaults
var strIndexSite    = "/dms/index.html";
var strBodySeite    = "/dms/index.html";
var strUrl          = self.location.href;
var strControler    = "/dms/menu/menu.php?menuid=";

function updateFrames(strMenuId,strHeaderId,strChannel,strContentPage) {
try{
	
	//alert(strIndexSite+'\n'+strBodySeite+'\n'+strUrl+'\n'+strControler);
	
	if (!strContentPage || strContentPage=='' || strContentPage.indexOf(strBodySeite)==-1) {	
		var strMenuId = strMenuId.toString()
		// Ob Menue erforderlich
		var blnMenue  = (!strMenuId || strMenuId == 'default' || strMenuId == 'ignore' || strMenuId == '' || strMenuId == null || strMenuId == 'false')? false : true;
		// Ob Content
		var blnContentPage = (!strContentPage || strContentPage  == 'default' || strContentPage  == 'ignore' || strContentPage  == '' || strContentPage  == null)? false : true;
		// Ob alle Frames da sind und ggf. nachladen ----------------------- //
		if (!top.body || !top.header) {
			
			var strNewUrl = strIndexSite;
			if(blnContentPage){
				if(strContentPage == "self"
				|| (strContentPage != "philosophie" && strContentPage != "produkteservices" && strContentPage != "maerkteanalysen" && strContentPage != "infocenter" && strContentPage != "login" && strContentPage != "home")){
					// Navigation
					if(blnMenue)
						strNewUrl += "?nav="+strMenuId +"&";
					else
						strNewUrl += "?";
					// Content
					if(strContentPage == "self")
						strNewUrl += "con=" + strUrl.substring((strUrl.indexOf(self.location.host)+self.location.host.length),strUrl.length);
					else
						strNewUrl += "con=" +strContentPage;
				}
				else
					// Einstiegsseite
					strNewUrl += "?entry=" + strContentPage;
			}
			top.location.replace(strNewUrl);
		}
		// Ob Navigation geladen ist --------------------------------------- //
		else if (blnMenue && !top.body.nav && top.body) {
			var strNewUrl   = strBodySeite;
			var strBodyUrl  = top.body.location.href;
			// Content
			if(blnContentPage){
				if(strContentPage == "self" 
				|| (strContentPage != "konto" && strContentPage != "brokerage" && strContentPage != "produkte" && strContentPage != "services" && strContentPage != "login" && strContentPage != "home"))
				{
					if(strContentPage == "self")
						strNewUrl += "?con=" + strBodyUrl.substring((strBodyUrl.indexOf(self.location.host)+self.location.host.length),strBodyUrl.length);
					else
						strNewUrl += "?con=" +strContentPage;
					// Navigation
					strNewUrl += "&nav=" + strMenuId;
					top.body.location.replace(strNewUrl);
				}
				else
				{
					top.location.replace(strIndexSite + "?entry=" +strContentPage);
				}
			}
			else
			{
				top.location.replace(strIndexSite);
			}
		}
		// Ob richtige Navigation geladen ist ------------------------- //
		else if (blnMenue && top.body.strMenuId != strMenuId) {
			var blnUpdateMenue = true;
			if(strMenuId.indexOf(",")!=-1){// mehrere MenueID moeglich
				var arrMenueIds = strMenuId.split(",");
				strMenuId = arrMenueIds[0];
				for(i=0; i<arrMenueIds.length; i++){
					if(arrMenueIds[i] == top.body.strMenuId){
						blnUpdateMenue = false;
						break;
						
					}
				}
			}
			if (strMenuId == 'default') strMenuId = 'home';
			if (blnUpdateMenue){
				top.body.nav.location.replace(strControler + strMenuId);
				top.body.strMenuId = strMenuId;
			}
		} 
		if(strChannel != "ignore" && top.strChannelAktiv != strChannel && top.header) {// Channel Check (Privat/Gesch&auml;ftskunden)
			top.header.updateChannel(strChannel);
		}
		
		if(strHeaderId != "ignore" && top.header && top.header.strHighlight != strHeaderId) {
			//without an alertbox the following function will never be called (timing-problem?)
			//alert("No call for updateMenue without this alert.");
			top.header.updateMenue(strHeaderId);
		}
	}
}catch(e){
	//uncomment the following line to debug
	//alert("Error: "+e);
}
}