//document.writeln('<link rel="stylesheet" href="file:///C:/Styles/eMB/default.css" type="text/css">');
//var isRight2Left = (langId==971 || langId==972) ? true : false;
	// global variables

	// --- Resize Fix for Layers
	// Opera & NS4 resize-Topnavigation Fix START

	var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0, IE4 = 0, MAC = 0, NT4=0, IE6 = 0, WIN = 0;
	var channelImagePath;


	DHTML_init(); // this library is automaticly initialized during loading	

	var orgYpos=-1; // holds original y-position of funcnavi
	var maxStopperYPosition=-1;
	var repositionTimer=null;
	var funcNaviNewYPosition;
	var funcNavLayer = null;

	var funcNaviShowTimer = null;	

	// initializing the repositioning of the funcnav layer
	if (MS) window.offScreenBuffering=true; // to be tested -> couldn't find detailed explanation
	if (MS && !MAC){
		window.onscroll=handleScroll; // does not work with NS4.x,NS6 and OP
		window.onresize=handleScroll;
	}

	var oldCoordX, oldCoordY;
	// <!-- BM


/* BM:>>
var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0, IE4 = 0, MAC = 0, NT4=0, IE6 = 0, WIN = 0;
var channelImagePath;
*/
function DHTML_init() {
	if (window.opera) OP = 1;
	if(document.getElementById) {
		DHTML = 1;
		DOM = 1;
	}
	if(document.all && !OP) {
		DHTML = 1;
		MS = 1;
	}
	if(document.layers && !OP) {
		DHTML = 1;
		NS = 1;
	}
	if (MS && !DOM) IE4 = 1;
	// check for Mac.
	if (navigator.userAgent.toLowerCase().indexOf("mac")>-1) MAC = 1;
	// has to be extended so msie7+ are recognized too!
	if (navigator.userAgent.toLowerCase().indexOf("msie 6")>-1) IE6 = 1;
	if (navigator.userAgent.toLowerCase().indexOf("windows nt;")>-1) NT4 = 1;
	if (navigator.userAgent.toLowerCase().indexOf("windows")>-1) WIN = 1;
	

}


// service function to get Layer-object in NS4 no matter how much surrounding layers
function getLayerObjectForNS4(id, d){
	if (!NS) return null;
	var searchResult = null;
	if (!d) d = document;
	if (d.layers[''+id+'']) searchResult = d.layers[''+id+''];
	for (var i=0; !searchResult && i < d.layers.length; i++){			 
		searchResult = getLayerObjectForNS4( id, d.layers[i].document );
	}
	return searchResult;
}
// almost like the getElem-function of DHTML.js, but can only get layer-objects
// and has advanced capabilities for NS4 using getLayerObjectForNS4()
function getLayerById(id, d){
	if (id == '' && !id ) return null;
	var layerObject = null;
	if (NS) layerObject = getLayerObjectForNS4( id, d );
	else if (MS) layerObject = document.all[''+id+''];
	else if (DOM) layerObject = document.getElementById(id);	
	return layerObject;
}
// START: eMBLayer - Object
function eMBLayer ( id ){
	// data member
	this.object = getLayerById( id ); // can be used if direct access on the layer-object is required
	this.id = id; // the id of the layer as a string
	
	// member functions 
	this.isObject = isObject; // returns true if layer was found, else false, object.isObject()
	this.getParentLayer = getParentLayer; // returns the parent layer as an eMBLayer object, object.getParentLayer()
	this.convertLayerToEmbLayer = convertLayerToEmbLayer; /* converts an usual layer object to an eMBLayer object, 
																													 targetEmbLayerObject.convertLayerToEmbLayer( sourceLayerObject )*/
	 
	this.getId = getId; // writes the id of the calling object into the "id"-property
	this.show = show; // object.show()
	//this.hide = hide; // object.hide()
	
	this.setBgColor = setBgColor; // sets the background color of the caling eMBLayer, object.setBgColor("#ffffff")
	
	this.setX = setX; // set x Position of the layer, object.setX( int-Value )
	this.setY = setY; // set y Position of the layer, object.setY( int-Value )
	
	this.getX = getX; // retrieves x Position of the layer, relative to parent element, object.getX()
	this.getY = getY; // retrieves y Position of the layer, relative to parent element, object.getY()
	this.getAbsoluteY = getAbsoluteY; // retrieves y Position of the layer, relative to browser window, object.setAbsoluteX()
	
	this.getWidth = getWidth; // retrieves the width of the layer, object.getWidth()
	this.getHeight = getHeight; // retrieves the height of the layer, object.getHeight()
	
	this.setSize = setSize; // sets the size for the layer, object.setSize( int-Value width, int-Value height )

}
// member functions implementations, do NOT use as standalone function!
// if needed, can be used as follows: 
// (new eMBLayer(IdOfTheLayerYouWantToUseTheFunctionWith)).theFunctionYouWantToUse();
function convertLayerToEmbLayer( layerObject ){
	this.object = layerObject;
	this.id = this.getId();
	return this;
}

function isObject(){
	return ( (this.object==null)?false:true );
}
// returns the parent-eMBLayer of the layer with the given id as an object
function getParentLayer( ){
	if (!this.isObject()) return null;
	var parentLayerObject = null;
	if (NS) parentLayerObject = new eMBLayer( this.object.parentLayer.name );
	else if (MS){
		var parentObject = this.object.parentElement;
		while (parentObject && parentObject.parentElement && parentObject.tagName.toLowerCase() != "div")
			parentObject = parentObject.parentElement;
		if (parentObject && parentObject.tagName.toLowerCase() != "div") parentObject = null;
	} else if (DOM){
		var parentObject = this.object.parentNode ;
		while (parentObject && parentObject.parentNode && !((parentObject.nodeType==1 || OP) && parentObject.tagName.toLowerCase()=="div") )
			parentObject = parentObject.parentNode ;
		if ( !( parentObject && (parentObject.nodeType==1 || OP) && parentObject.tagName.toLowerCase()=="div") ) parentObject = null;
	}
	return (new eMBLayer(null)).convertLayerToEmbLayer( parentObject );
}
function getId(){
	if ( !this.isObject() ) return null;
	if (MS || DOM) return this.object.id;
	else if (NS) return this.object.name;
}
function show(){
 	if ( !this.isObject() ) return true;
	if (NS) this.object.visibility = "show";
	else if (MS || DOM) this.object.style.visibility = "visible";
}
function hide(){
	if ( !this.isObject() ) return true;
	if (NS) this.object.visibility = "hide";
	else if (MS || DOM) this.object.style.visibility = "hidden";
}
function setBgColor( newColor ){
	if ( !this.isObject() ) return true;
	if (NS) this.object.bgColor = newColor;
	else this.object.style.backgroundColor = newColor;
}
function setX( newXPosition ){
	if ( !this.isObject() ) return true;
	if (NS) this.object.left = newXPosition;
	else if (MS || DOM) this.object.style.left=newXPosition+"px";
}
function setY( newYPosition ){
	if ( !this.isObject() ) return true;
	if (NS) this.object.top = newYPosition;
	else if (MS || DOM) this.object.style.top = newYPosition+"px";
}
function getX(){
	var w = -1;
	if ( !this.isObject() ) return w;
	if (MS || DOM) w = this.object.offsetLeft;
	else if (NS) w = this.object.left;
	return w;
}
function getY(){
	var w = -1;
	if ( !this.isObject() ) return w;
	if (MS || DOM) w = this.object.offsetTop;
	else if (NS) w = this.object.top;
	return w;
}
function getAbsoluteY(){
	var absTop = 0;
	if ( !this.isObject() ) return -1;
	var layerObject = this;
	if (NS) return this.object.pageY;
	while( layerObject.isObject() ){
		absTop = absTop + layerObject.getY();
		layerObject = layerObject.getParentLayer();
	}
	return absTop;
}
function getWidth(){
	var w = -1;
	if ( !this.isObject() ) return w;
	if (DOM && !OP) this.object.style.width = "auto"; // needed but can reset a layers size in strict HTML4.01
	if (IE4 || OP) w = this.object.style.pixelWidth;
	else if (MS || (DOM && !OP)) w = this.object.offsetWidth; // IE5+ & NS6
	else if (NS) w = this.object.clip.width;
	return w;
}
function getHeight(){
	var w = -1;
	if ( !this.isObject() ) return w;
	if (DOM && !OP) this.object.style.height = "auto";
	if (MS || (DOM && !OP)) w = this.object.offsetHeight;
	else if (NS) w = this.object.clip.height;
	else if (OP) w = this.object.style.pixelHeight;
	return w;
}
// setting width and height for layers
// used on initalization and when positioning highlight layers
// on Mozilla 0.9x+ don't use getWidth or getHeight (on the same layer) after this function, this
// would shrink layer size to its contents size
function setSize( newWidth, newHeight ){
	if ( !this.isObject() ) return true;
	if (!NS){
		with (this.object.style) {
			if (MS || OP){
				pixelWidth = newWidth;
				pixelHeight = newHeight;
			}	else if (DOM && !OP){		
				width = newWidth+"px";
				height = newHeight+"px";
			}
		}
	} else if (NS){
		this.object.resizeTo(newWidth, newHeight);
		with(this.object.clip){
			top = 0;
			left = 0;
			width = newWidth;
			height = newHeight;
		}
	}
}
// END: eMBLayer - Object

/*BM:>>
var popUps = new Array();
*/


//BM:>>
//DHTML_init(); // this library is automaticly initialized during loading	
	
/*
external js file for dynamical positioning of the functional navigation
$Source: /usr/cvs/eMB/Clickstream_DCVD/js/nav5.js,v $
$Revision: 1.1 $
Check-In $Date: 2002/10/08 10:14:32 $
*/
/* BM:>>
var orgYpos=-1; // holds original y-position of funcnavi
var maxStopperYPosition=-1;
var repositionTimer=null;
var funcNaviNewYPosition;
var funcNavLayer = null;
*/
function repositionFuncNav() {
	var thisYposStopper=0;
	var i=1;
	if (maxStopperYPosition<0){
		while(thisYposStopper>-1) {
			var currentLayer = new eMBLayer("stopper"+i);
			thisYposStopper = currentLayer.getAbsoluteY();
			if(thisYposStopper>maxStopperYPosition) maxStopperYPosition=thisYposStopper;
			i++;
		}
		maxStopperYPosition+=3;
	}
	//window.status=kalle+","+maxStopperYPosition ;
	
	if (funcNaviNewYPosition < maxStopperYPosition) funcNaviNewYPosition = maxStopperYPosition; 
	// just reposition if scrollposition has changed
	if (orgYpos != funcNaviNewYPosition) {
		orgYpos = funcNaviNewYPosition;
		clearTimeout(repositionTimer);
		if (!NS) repositionTimer = setTimeout("funcNavLayer.setY("+funcNaviNewYPosition+")", 30);
		else funcNavLayer.setY( funcNaviNewYPosition );
	}
	return true;
}
function setFuncNaviNewYPosition(){
	if(MS || OP) {
		//IE needs an offset of 4 #tbd: test on other platforms
		if (IE6) {
				// document.body.scrollTop no longer supported in IE6 (now scrollTop is part of html-object)
				var documentBody = document.getElementsByTagName("html")[0];
		} else {
			var documentBody = document.body;
		}
		var clHeight = documentBody.clientHeight;
		var navHeight= funcNavLayer.getHeight();
		var scrollHeight=documentBody.scrollTop;
		funcNaviNewYPosition = documentBody.clientHeight - navHeight + scrollHeight;
		// recognize horizontal scrolling not needed for IE
	}
	else if (NS || DOM)
	{		
		funcNaviNewYPosition= window.innerHeight - funcNavLayer.getHeight() + window.pageYOffset;
		// recognize horizontal scrolling
		if ( !MAC && NS && window.innerWidth < 770 ) funcNaviNewYPosition=funcNaviNewYPosition-14;
		else if ( !OP && !NS && window.innerWidth < 784 ) funcNaviNewYPosition=funcNaviNewYPosition-15;
	}
}
// BM:>>
//var funcNaviShowTimer = null;
function handleScroll(nullEv, fNNYP) {
	if (funcNavLayer==null) funcNavLayer = new eMBLayer( "footer" );
	setFuncNaviNewYPosition();
	var go = (funcNaviNewYPosition!=fNNYP);
	if ((MS && !MAC) || go){ 
		clearTimeout(funcNaviShowTimer);	
		//funcNavLayer.hide();
		repositionFuncNav();
		if (!MAC) funcNaviShowTimer=setTimeout("funcNavLayer.show()", (MS||NS)?150:350);
		else funcNaviShowTimer=setTimeout("funcNavLayer.show()", 500);
	}
	if (!MS || (MAC && !DOM))
		repositionTimer = window.setTimeout("handleScroll("+null+","+funcNaviNewYPosition+")",(NS)?60:150);
	else if (MAC && MS)
		repositionTimer = window.setTimeout("handleScroll("+null+","+funcNaviNewYPosition+")",350);
}
// from snv_script -->
// <-- from snv_script
function doBeforeLoad() {
	var x=0;
	DHTML_init(); // this library is automaticly initialized during loading	
	navElements();
	init();
	setAllQuickAccessTabs();
	handleScroll();
	enableGallery();
	hideTopNav();
}

function doBeforeLoadSplash() {
	DHTML_init(); // this library is automaticly initialized during loading	
	navElements();
	init();
	setAllQuickAccessTabs();
	handleScroll();
	enableGallery();
}

function doBeforeUnLoad() {

}