// Global library Philips Internet
// Check www.crsc.philips.com/crsc/scripts/lib_global.js for latest version
// Version: 3.09
// Date: January 18 2008

/* 
****************************
***** Global variables *****
****************************
*/

// Initiate menu array
var menuArray = new Array();
menuArray[1] = 'about';
menuArray[2] = 'consumer';
menuArray[3] = 'medical';
menuArray[4] = 'lighting';

var _page = new Object();		// Object representing the page
_page.topNav = new Array();		// defined in locale files 
_page.text = new Array();		// defined in locale files 
_page.link = new Array();		// defined in locale files 

_page.leftNav = new Array();  	// Store left menu values 
_page.leftNavItem = "";			// Current Active left menu item 
_page.leftNavOnload = true;		// Load leftnav onload of page
_page.breadCrumbItem = "";			// Current Active breadcrumb item 
_page.leftmenuarray = new Array();	// Array to store menu items
_page.flyoutarray = new Array();	// Array to store fly out items
leftmenulength = 0;				// Length of flyout string at start 
flyoutlength = 0;				// Length of flyout string at start 
	
_page.values = new Object(); 	// Stock quote values 
_page.locales = new Object(); 	// Locale files 
_page.currentLocale = "";		// Current locale of user
_page.hideGlobalStyle = false;	// Show or hide global stylesheet
_page.activateActiveX = false;	// Activate active-x objects onload of page, windows IE only

/* Settings for microsite header */
_page.showLocales = true; 		// Boolean to show the Locale selector 
_page.useGlobalStyle = false;	// Extra setting to allow global stylesheets in Microsite

/* Settings for extranet header */
_page.topNavType = "";				// External extranet navigation type
_page.pageWidth = "800";			// Default 800x600 in extranet
_page.topNavXN = new Array();		// Defined in extranet locale files 
_page.supportLinks = new Array(); 	// Multiple supportlinks in header
_page.customLogo = new Array();		// Custom logo attributes

/* Settings for global header*/

_page.crsc_server = get_crsc_server();  // Get location of the Global library file. Used to determine where the files need to be included from.

_page.area = "";						// Page area has to be defined in HTML code when creating the header
_page.hideFlashSectionBanner = false;	// default show flash section banner
_page.disableReplaceSpecialCase = false;// default load replace speciale case on page load
_page.showSBFlashSectionBanner = "";	// default, don't show specialized business flash section banner
_page.altLocaleFlag = "";				// allow alternative locale flag (Country C)
_page.altLocaleText = "";				// allow alternative locale text (Country C)
_page.selectedLocale = "";				// allow other selected locale in localelist (Country C)
_page.GlobalLanguageSwitch ="";			// allow for internet header/footer links a global language switch
_page.loadBrowserInfo = false; 			// Tmp added
_page.browserInfo = new Array();		// Tmp added
_page.arrCaseMapping = new Array();		// Casemapping execeptions
_page.arrLCase = new Array();			// Lowercase execeptions
_page.arrUCase = new Array();			// Uppercase execeptions

/* Third party settings */
_page.loadSIFR = false;					// false, allows siteowner to disable GMM SIFR (script + config)
_page.loadSIFRScript = false; 			// true, allows siteowner to load the base SIFR script file for all locales without any respects to the locales
_page.loadSIFRConfig = false;			// false, allow siteowner to disable GMM SIFR config loading
_page.disabledLocalesSIFR = ["zh","ko","he","ja","cs","sk","pl","ro","ru","bg","el","th","tr","hu"];
_page.loadESurvey = false;
_page.loadOmniture = true;

/* Rescale fontsize*/
_page.articleCSSFontsizeDefault = "100";
_page.articleCSSFontsizeCurrent = '';
	
/* Settings for Special section */
_page.sectionMain = new Array();
_page.sectionSpecial = new Array();

/* Settings for rich content popup */
_page.popupHideHeader = false; // Allow disabled popup header
_page.popupHideFooter = false; // Allow disabled popup footer
_page.popupAutoFitWindowToContent = true;
_page.popupHeight = 1;
_page.popupWidth = 1;

/* Settings for statistics */
_page.statsCollector = new Array() 		// Statistics collector
_page.statsCollector["Locale"] = ""; 	// Default value, can be overruled
_page.statsCollector["PageName"] = ""; 	// Default value, can be overruled
	
var complete_string = ""; 		// String used for debugging purposes
_page.browser = new BrowserDetect();
var browser = _page.browser;	// Keep another variable for compatibility
var useIframe = (_page.browser.isIE5up &&  (!_page.browser.isIE5x || _page.browser.isIE55)); // Boolean to set use of iframe behind layers, only IE 5.5 or higher
_page.leftNavOnload = (_page.browser.isNS && !_page.browser.isNS7up?false:true);	// Disable for Netscape version lower than 7

var isMacIE = (_page.browser.isIE && _page.browser.isMac?true:false);
var currSection = ""; 			// The section which is currently active (clicked)
var menuDown = "";				// The section which is currently highlighted (mouseover)
var dropDown = 0;
var hideMenu = 0;
var buttonOff = 0;
var section = '';

/*
****************************
***** General settings *****
****************************
*/

_page.showSearch=true;			// The search box should be shown. Possibilty for page owners to disable showing the search box
var menu_hide_delay = 600; 		// Delay of hiding all drop-down menus on a mouseout of the top-menu
var dropdown_show_delay = 200;	// Delay of showing the drop-down menu on a mouseover

var max_item_levels = 7;		// Max number of levels in the left menu, excluding flyouts
var max_menu_levels = 7;		// Max number of levels in the left menu, including flyouts	
var topmenu_dd_spacer = 6;		// Vertical space between the topmenu buttons and the corresponding dropdowns

var intTableCount = 0;
var tabTables = new Array();	// Tabbed table array
var arrLoad = new Array();		// Onload array
var arrDOMLoad = new Array();	// DOM Onload array

/*
*************************************
***** Include global stylesheet *****
*************************************
*/

function include_stockquotes(){
	if(window.location.protocol == "http:") {
		var stockquotes = "<script DEFER type='text/javascript' src='http://www.stockquotes.philips.com/asp/ir/philips_java.aspx'></script>";
		document.write(stockquotes);
	}	
};

function include_stylesheets(){
	// This function will be used to include stylesheets
	// Values in extra stylesheets will overrule values in global stylesheet
	var stylesheet='';
	if(_page.hideGlobalStyle == false){
		// Show global stylesheet
		//stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/global.css\" />\n";
		// Add specific stylesheet for printing
		//stylesheet += "<link media=\"print\" rel=\"stylesheet\" type=\"text/css\" href=\"css/printbrowser.css\" />\n";
	}
	// Show stylesheet for components
	stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/components.css\" />\n";
	if(_page.hideGlobalStyle == false){
	// Add specific stylesheet for printing
	stylesheet += "<link media=\"print\" rel=\"stylesheet\" type=\"text/css\" href=\"css/printbrowser.css\" />\n";
	}
	if(_page.headerType == "external_extranet") {
		// Show stylesheet for extranet
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/external_extranet.css\" />\n";
	}
	if(_page.headerType == "microsite") {
		// Show stylesheet for microsite
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/microsite.css\" />\n";
	}
	if(_page.headerType == "popup") {
		// Show stylesheet for rich content popup
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/popup.css\" />\n";
	}
	// Include RTL stylesheet when RTL language is used
	if(_page.direction=="rtl"){
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/rtl.css\" />\n";
	}
	if(_page.browser.isMac){
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/mac.css\" />\n";
	}
	if(_page.browser.isNS6x){
		// Add temp for fix NS6.2 drop down menu
		stylesheet += "<style>td.dd-inactiveItem{font-size:80%;}td.dd-activeItem{font-size:80%;}.p-table_flyout{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:70%;}</style>";
	}
	if(_page.browser.isNS6x || _page.browser.isNS7x){
		// Remove border-collapse for Netscape. This causes problems when JS files are included in the content area
		stylesheet += "<style>.p-content-grid{border-collapse:inherit;}</style>";
	}
	if(_page.browser.isNS7x){
		// Remove border in menu for Netscape. This was showing grids when menu should be  hidden
		stylesheet += "<style>table.p-dropdown table td{border-width:0px;}</style>";
	}
	if(_page.browser.isOpera && _page.browser.isWin){
		stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/opera.css\" />\n";
	}
	// Adjust styles of some locales
	if(_page.locale) {
		if(_page.locale.substring(3,5)=="zh"){
			// Add extra stylesheet for Chinese  and Korean locales
			stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/zh.css\" />\n";
		}
		else if(_page.locale.substring(3,5)=="ko"){
			// Add extra stylesheet for Japanese locales
			stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ko.css\" />\n";
		}
		else if(_page.locale.substring(3,5)=="ja"){
			// Add extra stylesheet for Japanese locales
			stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ja.css\" />\n";
		}
		else if(_page.locale.substring(3,5)=="th"){
			// Add extra stylesheet for Thai locales
			stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/th.css\" />\n";
		}
		else if(_page.locale.substring(3,5)=="ru"){
			// Add extra stylesheet for russian locales
			stylesheet += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ru.css\" />\n";
		}
	}	
	// Write stylesheets to screen
	if(stylesheet!="") document.write(stylesheet);
};

//Temp list till this is updated in Locale files
_page.countries = {};
_page.languages = {};
_page.countries = {
	"ar":"Argentina",
	"au":"Australia",
	"at":"Austria",
	"be":"Belgium",
	"bg":"Bulgaria",
	"br":"Brazil",
	"ca":"Canada",
	"ce":"Central America",
	"cl":"Chile",
	"cn":"China",
	"co":"Colombia",
	"hr":"Croatia",
	"cu":"Cuba",
	"cy":"Cyprus",
	"cz":"Czech Republic",
	"da":"Denmark",
		"dk":"Denmark",
	"ee":"Estonia",
	"eg":"Egypt",
	"fi":"Finland",
	"fr":"France",
	"de":"Germany",
	"gr":"Greece",
	"hk":"Hong Kong",
	"hu":"Hungary",
	"is":"Iceland",
	"in":"India",
	"id":"Bahasa Indonesia",
	"ir":"Iran",
	"iq":"Iraq",
	"ie":"Ireland",
	"il":"Israel",
	"it":"Italy",
	"jp":"Japan",
	"kr":"Korea",
	"lt":"Lithuania",
	"lu":"Luxembourg",
	"lv":"Latvia",
	"my":"Malaysia",
	"mx":"Mexico",
	"me":"Middle East and Africa",
	"ma":"Morocco",
	"nl":"Netherlands",
	"nz":"New Zealand",
	"no":"Norway",
	"om":"Oman",
	"pk":"Pakistan",
	"pe":"Peru",
	"ph":"Philippines",
	"pl":"Poland",
	"pt":"Portugal",
	"ro":"Romania",
	"ru":"Russian Federation",
	"sa":"Saudi Arabia",
	"sg":"Singapore",
	"sk":"Slovakia",
	"si":"Slovenia",
	"za":"South Africa",
	"es":"Spain",
	"se":"Sweden",
	"ch":"Switzerland",
	"tw":"Taiwan",
	"th":"Thailand",
	"tn":"Tunisia",
	"tr":"Turkey",
	"ua":"Ukraine",
	"ae":"United Arab Emirates",
	"gb":"United Kingdom",
	"us":"United States",
	"uy":"Uruguay",
	"ve":"Venezuela"
}
_page.languages = {
	"bg":"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",
	"cs":"\u010Ce\u0161tina",
	"da":"Dansk",
	"de":"Deutsch",
	"el":"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE",
	"en":"English",
	"es":"Espa\u00F1ol",
	"et":"Eesti keel",
	"fi":"Suomeksi",
	"fr":"Fran\u00E7ais",
	"he":"\u05E2\u05D1\u05E8\u05D9\u05EA",
	"hr":"Croatian",
	"hu":"Magyar",
	"id":"Indonesian",
	"it":"Italiano",
	"ja":"\u65E5\u672C",
	"ka":"Georgian",
	"ko":"\uD55C\uAD6D\uC5B4",
	"lt":"Lietuvi\u0173",
	"lv":"Lietuvi\u0173",
	"my":"Burmese",
	"nl":"Nederlands",
	"no":"Norsk",
	"pl":"Polski",
	"pt":"Portugu\u00EAs",
	"ro":"Rom\u00E2n\u0103",
	"ru":"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
	"sk":"Sloven\u010Dina",
	"sv":"Svenska",
	"th":"\u0E44\u0E17\u0E22",
	"tr":"T\u00FCrk\u00E7e",
	"zh":"\u4E2D\u6587",
	"za":"Chuang"
}
//End Temp list
	
// Page area have to be defined in HTML code when creating the header
_page.area = "";

// The search box should be shown. Possibilty for page owners to disable showing the search box
_page.showSearch=true;

// Cache background images 
try {document.execCommand("BackgroundImageCache", false, true);} catch(err) {}

// Print Philips favicon
//document.write('<link rel="shortcut icon" href="'+_page.crsc_server+'/crsc/images/favicon.ico">\n');

// Only show stockquotes on country landing pages
_page.showStockQuotes = false;
_page.values["aex"] = ""
_page.values["nyse"] = ""

var m_iRotatorIndex = 1;

// Update stockquotes	
_page.updateStockQuote = function() {
	if(_page.values["aex"]!=""){
		// Only show if data is available
		if( m_iRotatorIndex == 1 ){
			m_sStockQuoteTargetURL = "http://www.stockquotes.philips.com/asp/ir/philips_newdesign.aspx?market=0"; 
			sStockValue = "EUR";
			sStockPrice = _page.values["aex"];
			sStockExchange = "AEX";
		}
		else if( m_iRotatorIndex == 2 ){
			m_sStockQuoteTargetURL = "http://www.stockquotes.philips.com/asp/ir/philips_newdesign.aspx?market=1"; 
			sStockValue = "US$";
			sStockPrice = _page.values["nyse"];
			sStockExchange = "NYSE";
		}
		// Check if alert should be shown that language is not English
		current_language = _page.locale.substring(3,5);
		if(current_language!="en" && _page.locale!="global"){
			// Get translated version of English
			new_language=_page.text["lang_en"];
		} else{
			new_language = "";
		}
		if(!(_page.browser.isMac && _page.browser.isIE5x)){
			//Don't show stockquotes on Mac/IE5
			var stockQuotes = gE("p-stockquotes");
			if(stockQuotes) {
				stockQuotes.innerHTML = "<nobr><b>" + sStockExchange + "</b>&nbsp;|&nbsp;<a href=\""+m_sStockQuoteTargetURL+"\" onclick=\"return _page.switchHandler('"+m_sStockQuoteTargetURL+"', '', '"+new_language+"')\">" + sStockValue +"</a>&nbsp;"+sStockPrice+"</nobr>";
			}
		}
		m_iRotatorIndex++;		
		if(m_iRotatorIndex > 2){
			m_iRotatorIndex = 1;
		}
		setTimeout("_page.updateStockQuote()",6000);
	}	
};

_page.searchHandler = function (searchform_id) {
	// Create and show warning element
	var sMsg = _page.text["search_input"] || "";
	if(!gE('p-warning-wrapper') && sMsg!="") {
		var elWarningWrap = document.createElement("div");
		elWarningWrap.id = "p-warning-wrapper";
		elWarningWrap.innerHTML = "<div id=\"p-warning-search\"><b></b><strong class=\"p-content\">"+sMsg+"</strong><b></b></div>";
		var elParent = gE('p-topright-bottom');
		if(elParent) {
			elParent.appendChild(elWarningWrap);
			var elQuery = gE('p-searchquery');
			elQuery.onkeydown = function(){nE(gE('p-warning-search'))};
		}
	}

	// This function will open the standard search application. This function can be overruled.	
	var elSearch = gE("searchform");
	if(elSearch) {
		var strMatch  = trim(elSearch.q.value);
		if(_page.text["searchlabel"] == strMatch || strMatch == "") {
			elMsg = gE('p-warning-search');
			if(elMsg) dE(elMsg);
			elSearch.q.focus();
		} else {
			// Set new form attributess
			elSearch.action = "http://www.search.philips.com/search/search";
			elSearch.method = "GET"
			elSearch.acceptCharset = "UTF-8";		
			// Submit form
			elSearch.submit();
		}
	}
	// Cancel onclick/submit event
	return;
};   

_page.switchHandler = function (open_link, target, language_switch) {
	// This function will open the links clicked in the header and footer. This function can be overruled.
	// Check if there is a language switch
	if(language_switch=="" || typeof(language_switch)=="undefined"){
		open_page = true;
	} else {
		// Check if person wants to switch language
		if(confirm(_page.text["confirmation2"].replace("{LANGUAGE}", language_switch))){
			open_page = true;
		} else {
			open_page = false;
		}
	}
	if(open_page){
		if(target=="" || typeof(target)=="undefined"){
			// Open in same window if no extra parameters are send
			target = "_self";
			extra = "";
		}
		else if(target=="popup"){
			target = "_blank";
			extra = "height=500,width=700,toolbar=yes,scrollbars=yes";
		}
		else{
			extra="";
		}
		w=window.open(open_link, target, extra);
		
		if(target=="popup"){
			//Center popup window
			var intwidth=parseInt(screen.availWidth);
			var intheight=parseInt(screen.availHeight)
			if(intwidth>0&&intheight>0){
				w.moveTo(((intwidth-popup_width) / 2), ((intheight - popup_height) / 2));
				w.focus();
			}
		}
	} else {
		// Don't follow link
		//return false;
	}
	// Return false to make sure links in a href are not followed
	return false;
};

_page.setlocale = function (locale) {
	// Set cookie with user locale
	// Check if currently on philips.com domain
	current_url = escape(window.location);
	x = current_url.indexOf("philips.com/"); 
	y = current_url.indexOf("philips.com%3A"); // allow philips with port
	if(x!=-1 || y!=-1 ){
		// Set cookie when on philips.com domain
		var expires = new Date();
		expires.setFullYear(expires.getFullYear()+1);
		new_str = "Philips=userlocale=" + locale + ";expires="+expires.toGMTString()+";path=/;domain=philips.com";
		document.cookie = new_str;
		newLink = getLocaleURL(locale);
		// Redirect to site using the switchHandler function
		_page.switchHandler(newLink, "");
	} else{
		//create unique code to protect caching
		str = Math.round(Math.random()*100000).toString();
		// Set cookie on philips.com domain
		newLink = escape(getLocaleURL(locale));
		document.write("<script language=\"Javascript\" type=\"text/javascript\" src=\"http://www.crsc.philips.com/cookie/setcookie.asp?LocaleID="+locale+"&URL="+newLink+"&random="+str+"\"></script>");
	}
};

_page.changelocale = function (locale) {
	//check if new country selected
	var strCheckLocale = (_page.selectedLocale!=""?_page.selectedLocale:_page.locale);
	if(locale==""){
		// No Locale selected
		alert(_page.text["alert2"]);
	}
	else if(locale==strCheckLocale){
		// User is switching to the Locale that he is already using
		alert(_page.text["alert1"]);
	}
	else{
		var blnRedirect = false;
		if(locale!="others") {
			// Check if the user want to save this Locale
			// The function will also redirect the user
			if(confirm(_page.text["confirmation1"])) {
				// Set locale
				_page.switchHandler("Javascript:_page.setlocale('"+locale+"');", "");
			} else {
				blnRedirect = true;
			}
		} else {
			blnRedirect = true;
		}
		if(blnRedirect) {
			// Redirect to site with new Locale
			newLink = getLocaleURL(locale);
			// Redirect to site using the switchHandler function
			_page.switchHandler(newLink, "");
		}
	}
};

function getLocaleURL(locale){
	// Get correct link to switch to
	return _page.locales[locale];
};

_page.getlocale = function () {
		// Check if currently on philips.com domain
		current_url = escape(window.location);
		x = current_url.indexOf("philips.com/");
		if(x!=-1){
			var strCookie = unescape(document.cookie);
			var start = strCookie.indexOf("userlocale=");
			if(start!=-1){
				start += 11;
				var end = start +5;
				if(strCookie.substring(start,end)=="globa"){
					return_cookie="global";
				} else{
					return_cookie=strCookie.substring(start,end);
				}
			return return_cookie;
			} else{
			return "";
			}
		} else{
		// Currently not available
		return "N/A";
		}
};

/* Helper functions */
_page.write = function (str, last_item) {
	document.write(str);
};
/* end helper functions */

/* Helper function for locale switching pages */

	function set_localeselector(){
		if(!document.changelanguage) return;
		// Add text and global option on top of select box
		var optionName = new Option(_page.text["localeselector"], "");
		document.changelanguage.locale.options[0] = optionName;	
			
		var optionName2 = new Option("Global / English", "global");
		document.changelanguage.locale.options[1] = optionName2;	
	};
		
	function redirect_item(url){
		if(!document.changelanguage) return;
		if(document.changelanguage.locale.value!=""){
			if(document.changelanguage.remember.checked){
				// Remember locale setting
				_page.setlocale(url);
			} else{
				// Redirect directly to site
				window.open(_page.locales[document.changelanguage.locale.value], "_self");
			}
		} else{
			alert(_page.text["alert2"]);
		}
	};

 /* End helper function*/
 
updateLocales = function(area){
	// This function will update the list of locale files on basis of the Homepage file that is loaded
	// Set standard switching text + Global link
	if(!document.changelanguage) return;
	set_localeselector();
	nr_locale = 2;
	for(anItem in _page.locales){
			if(anItem!="global"){
				current_country = anItem.substring(0,2);
				current_language = anItem.substring(3,5);
				show_locale = _page.countries[current_country] +" / "+ _page.languages[current_language];
				var optionName = new Option(show_locale, anItem);
				document.changelanguage.locale.options[nr_locale] = optionName;
				nr_locale += 1;
			}		
	}
	// Sort list
	SortSelectList(document.changelanguage.locale);
	// Add others option at the last position in the list / Only applicable for normal internet site
	if(_page.headerType =="internet") {
		//_page.locales["others"] = "http://www.philips.com/countries";
		//var optionName = new Option("Others", "others" );
		//document.changelanguage.locale.options[nr_locale] = optionName;
	}
	// Set selected locale in localelist
	var strSelectedlocale = (_page.selectedLocale!=""?_page.selectedLocale:_page.locale);
	setSelectListLocale(strSelectedlocale);	
};

_page.writeHeader = function (area) {
	_page.headerType = "internet";
	// Include Locale redirect files
    locales_redirect = "homepages";
	// Settings
    _page.area = area;
    currSection = _page.area;

    var crsc = _page.crsc_server;
	// Include stylesheets
	_page.hideGlobalStyle = false;
	include_stylesheets();

	// Include stockquotes file, when needed
	if(_page.showStockQuotes) include_stockquotes();
	// Include Locale redirect files
	if(area=="about"||area=="consumer"||area=="lighting"||area=="medical"){
		locales_redirect = "homepages_"+area;
	} else{
		locales_redirect = "homepages";
	}
	// Include homepages file
	var homepages = "	<script type=\"text/javascript\" src=\"js/"+locales_redirect+".js\"></script>\n"
	document.write(homepages);
	// Settings
    _page.area = area;
    currSection = _page.area;
    var crsc = _page.crsc_server;
	var arrow_name = _page.direction=='ltr'?"arrow_header.gif":"arrow_header_rtl.gif";
	// Build header
    var header="";
	header+="	   <table id=\"p-containerx\" cellspacing=\"0\" border=\"0\" width=20>\n";
	header+="			<tr>\n";
	// FLAG
	header+="										            <td id=\"p-mainnav-rightcorner\" class=\"p-mainnav-rightcorner\">\n";
	var headerLS = new _page.ls('1');
	header+= headerLS.html;
	header+="									            	</td>\n";
	header+="			</tr>\n";
	header+="	    </table>\n";
	
    _page.write(header, false);
	includeSIFR(); // Include SIFR
	if(_page.loadBrowserInfo) _page.setBrowserInfo();
	if(_page.activateActiveX) includeActiveXFix();
	addDOMOnLoadEvent(processTables);
	if(!_page.disableReplaceSpecialCase) addOnLoadEvent(_page.checkSpecialCase);
};

_page.writeFooter = function () {
    var crsc = _page.crsc_server;
	var language_switch = _page.GlobalLanguageSwitch;
	var privacy_footer = _page.text["footer"];
	privacy_footer = privacy_footer.replace("{BR}", "<br />");
	privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
	privacy_footer = privacy_footer.replace("{PRIVACY}", "<a href=\""+_page.link["privacy"]+"\" onclick=\"return _page.switchHandler('"+_page.link["privacy"]+"','','"+language_switch+"')\">"+_page.text["privacy"]+"</a>");
	privacy_footer = privacy_footer.replace("{OWNER}", "<a href=\""+_page.link["owner"]+"\" onclick=\"return _page.switchHandler('"+_page.link["owner"]+"','','"+language_switch+"')\">"+_page.text["owner"]+"</a>");
	privacy_footer = privacy_footer.replace("{TERMS}", "<a href=\""+_page.link["terms"]+"\" onclick=\"return _page.switchHandler('"+_page.link["terms"]+"','','"+language_switch+"')\">"+_page.text["terms"]+"</a>");
	var strSitemapLink = _page.link["sitemap"];
	var strSitemapText = _page.text["sitemap"];
	if(_page.link["sitemap_"+_page.area+"_navdata"]) {
		strSitemapLink = (_page.link["sitemap_"+_page.area+"_navdata"]!="http://"?_page.link["sitemap_"+_page.area]:strSitemapLink);
	}
	privacy_footer = privacy_footer.replace("{SITEMAP}", "<a href=\""+strSitemapLink+"\" onclick=\"return _page.switchHandler('"+strSitemapLink+"','','"+language_switch+"')\">"+strSitemapText +"</a>");
	privacy_footer = privacy_footer.replace("{CAREERS}","<a href=\""+_page.link["careers"]+"\" onclick=\"return _page.switchHandler('"+_page.link["careers"]+"','','"+language_switch+"')\">"+_page.text["careers"]+"</a>");
	var footer = '';
	footer+="						</div>\n";
	footer+="					</div>\n";
	footer+="					<div id=\"p-body-bottomwrapper\"></div>\n";
	footer+="				</div>\n";
	footer+="			</div>\n";			
	footer+="			<div id=\"p-footer\">\n";
	footer+="				<div id=\"p-footer-wrapper\">\n";
	footer+="					<table id=\"p-footertable\" border=\"0\">\n";
	footer+="						<tr>\n";
	footer+="							<td id=\"p-footerleft\">\n";
	footer+= (_page.showStockQuotes?"<div id=\"p-stockquotes\">&nbsp;</div>\n":"&nbsp;");
	footer+="							</td>\n";
	footer+="							<td id=\"p-footertext\">\n";
	footer+="		<!-- footer text -->\n";
	footer+=" 								<div id=\"p-footertextcontainer\">"+privacy_footer+"</div>\n";
	footer+="		<!-- end footer text -->\n";	
	var bottomLS = new _page.ls('2');
	footer+= bottomLS.html;
	footer+="							</td>\n"
	footer+="							<td id=\"p-footerright\">&nbsp;\n";
	footer+="							</td>\n";
	footer+="						</tr>\n";
	footer+="					</table>\n";
	footer+="				</div>\n";
	footer+="			</div>\n";	
	footer+="		<!-- start mainnav dropdown menu divs -->\n";
	// create dropdown items
	for(counter=1;counter< menuArray.length;counter++) {
		var strID = menuArray[counter];
		footer += createTopNavMenu(strID);
	}
	footer+="		<!-- end mainnav dropdown menu divs -->\n";	
	_page.write(footer, false);	
	// Set dynamically page direction
	document.body.style.direction=_page.direction;
	// Set general settings
	document.onmouseover = hideAllMenus;
	// Set selected area
	if(_page.area=="about"||_page.area=="consumer"||_page.area=="lighting"||_page.area=="medical"){
		sectionButtonOn(_page.area);
	}
	addDOMOnLoadEvent(initSectionBanner);
	// Set analytics tools
	includeOmniture();
	// Make sure the ESurvey will not affect the site performance
	_page.eSurvey.include();
	onloadHandler();
};

_page.writeMicroHeader = function () {
	// Include extra stylesheets (now locale file is loaded)
	_page.headerType = "microsite";
	if(_page.useGlobalStyle == true) {
		// allow use of global styles by external setting: _page.useGlobalStyle == true
		_page.hideGlobalStyle = false;
	} else {
		// default disable global styles
		_page.hideGlobalStyle = true; 
	}	
	include_stylesheets();
	// Build header
	var crsc = _page.crsc_server;
	var header="";
	header+="	   <table id=\"p-container\" cellspacing=\"0\" border=\"0\">\n";
	// First row
	header+="			<tr>\n";
	header+="				<td id=\"p-topcontainertd\">\n";
	header+="					<table id=\"p-topcontainer\" cellspacing=\"0\" border=\"0\">\n";
	header+="						<tr>\n";
	header+="							<td id=\"p-mainlogo-micro\"><a href=\""+_page.link["home"]+"\" onclick=\"return _page.switchHandler('"+_page.link["home"]+"', '')\"><img alt=\"Philips\" src=\"images/mainlogo.gif\" /></a></td>\n";
	header+="							<td id=\"p-topright\">\n";
	header+="								<table id=\"p-topright-container\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
	header+="									<tr>\n";
	/* Philips Home link */
	var arrow_name = _page.direction=='ltr'?"arrow_header.gif":"arrow_header_rtl.gif";
	header+="										<td id=\"p-support-links\"><a href=\""+_page.link["home"]+"\" onclick=\"return _page.switchHandler('"+_page.link["home"]+"', '')\"><img alt=\"\" src=\"images/"+arrow_name+"\" class=\"p-sectionarrow\" />\n";
	header+= _page.text["home_site"]+"</a></td>\n";
	/* Locale selector */
	if(_page.showLocales) {
		header+="									<td id=\"p-localeselect\">\n";
		var headerLS = new _page.ls('1');
		header+= headerLS.html;
		header+="									</td>\n";
	}
	header+="									</tr>\n";
	header+="								</table>\n";
	header+="							</td>\n";
	header+="						</tr>\n";
	header+="					</table>\n";
	header+="				</td>\n";
	header+="			</tr>\n";
	header+="			<tr>\n";
	header+="				<td id=\"p-bodycontainer-td\">\n";
	header+="					<table id=\"p-bodycontainer-table\" cellspacing=\"0\">\n";
	header+="						<tr>\n";
	header+="							<td>\n";
	_page.write(header, false);
	if(_page.activateActiveX) includeActiveXFix();
	addOnLoadEvent(processTables);
};

_page.writeMicroFooter = function() {
	var crsc = _page.crsc_server;
   	var privacy_footer = _page.text["footer"];	
	privacy_footer = privacy_footer.replace("{BR}", "<br />");
	privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
	privacy_footer = privacy_footer.replace("{PRIVACY}", "<a href=\""+_page.link["privacy"]+"\" onclick=\"return _page.switchHandler('"+_page.link["privacy"]+"', '')\">"+_page.text["privacy"]+"</a>");
	privacy_footer = privacy_footer.replace("{OWNER}", "<a href=\""+_page.link["owner"]+"\" onclick=\"return _page.switchHandler('"+_page.link["owner"]+"', '')\">"+_page.text["owner"]+"</a>");
	privacy_footer = privacy_footer.replace("{TERMS}", "<a href=\""+_page.link["terms"]+"\" onclick=\"return _page.switchHandler('"+_page.link["terms"]+"', '')\">"+_page.text["terms"]+"</a>");
	privacy_footer = privacy_footer.replace("| {SITEMAP}","");
	privacy_footer = privacy_footer.replace("{CAREERS} | ","");
	var footer="";
	footer+="							</td>\n";
	footer+="						</tr>\n";
	footer+="					</table>\n";	
	footer+="				</td>\n";
	footer+="			</tr>\n";
	footer+="			<tr>\n";
	footer+="				<td id=\"p-footer\">\n";
	footer+="					<table id=\"p-footertable\">\n";
	footer+="						<tr>\n";
	footer+="							<td id=\"p-footerleft\">\n";
	footer+= (_page.showStockQuotes?"<div id=\"p-stockquotes\">&nbsp;</div>\n":"&nbsp;");
	footer+="							</td>\n";
	footer+="							<td id=\"p-footertext\">\n";
	footer+="		<!-- footer text -->\n";
	footer+=" 								"+privacy_footer+"\n";
	footer+="		<!-- end footer text -->\n";
	footer+="							</td>\n";
	footer+="							<td id=\"p-footerright\">\n";
	footer+="								&nbsp;\n";
	footer+="							</td>\n";
	footer+="						</tr>\n";
	footer+="					</table>\n";
	footer+="				</td>\n";
	footer+="			</tr>\n";
	footer+="		</table>\n";
	_page.write(footer, true);
	document.body.style.direction=_page.direction; 	// Set dynamically page direction
	if(_page.showLocales) document.onload = updateLocales(_page.area); // Update locale files when they should be shown
	initSectionBanner();
	includeOmniture();
	onloadHandler();
};

_page.writeExtranetHeader = function () {
	// Include extra stylesheets
	_page.hideGlobalStyle = false;
	_page.headerType = "extranet";
	include_stylesheets();
	// Build Extranet header
	var crsc = _page.crsc_server;
    var header="";
	header+="	   <table id=\"p-container\" cellspacing=\"0\">\n";
	header+="			<tr>\n";
	header+="				<td id=\"p-topcontainertd\">\n";
	header+="					<table id=\"p-topcontainer\">\n";
	header+="						<tr>\n";
	header+="							<td id=\"p-mainlogo-extra\"><a href=\""+_page.link["home"]+"\" onclick=\"return _page.switchHandler('"+_page.link["home"]+"', '')\"><img alt=\"Philips\" src=\"images/mainlogo.gif\" /></a></td>\n";
	if(_page.showSearch){
		header+="							<td class=\"p-extranet-search\" align=\"right\">\n";
		header+="								<form id=\"searchform\" name=\"searchform\" action=\""+_page.searchaction+"\">\n";
		header+="									<table cellspacing=\"0\">";
		header+="										<tr>\n";
		header+="											<td>"+_page.text["searchlabel"]+"&nbsp;</td>\n";
		header+="											<td><input type=\"text\" size=\"20\" name=\"searchtext\" class=\"p-searchfield\" /></td>\n";
		header+="											<td>\n";
		if (_page.direction=='ltr'){
			header+="											<input class=\"p-locale-submit\" type=\"image\" alt=\"Submit\" src=\"images/but_go.gif\" />\n";
		}
		else{
			header+="											<input class=\"p-locale-submit\" type=\"image\" alt=\"Submit\" src=\"images/but_go_rtl.gif\" />\n";
		}
		header+="											</td>\n";
		header+="										</tr>\n";
		header+="									</table>\n";
		header+="								</form>\n";
		header+="							</td>\n";
	}
	header+="						</tr>\n";
	header+="					</table>\n";
	header+="				</td>\n";
	header+="			</tr>\n";
	header+="			<tr>\n";
	header+="				<td class=\"p-extranet-extraspace\">\n";
	header+="				</td>\n";
	header+="			</tr>\n";
	header+="			<tr>\n";
	header+="				<td id=\"p-bodycontainer-td\">\n";
	header+="					<table id=\"p-bodycontainer-table\" cellspacing=\"0\">\n";
	header+="						<tr>\n";
	header+="							<td class=\"p-extranet-topline\">\n";
	_page.write(header, false);
	if(_page.activateActiveX) includeActiveXFix();
	addOnLoadEvent(processTables);
};

_page.writeExtranetFooter = function() {
	var crsc = _page.crsc_server;
   	var privacy_footer = _page.text["footer"];	
	privacy_footer = privacy_footer.replace("{BR}", "<br />");
	privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
	privacy_footer = privacy_footer.replace("{PRIVACY}", "<a href=\""+_page.link["privacy"]+"\" onclick=\"return _page.switchHandler('"+_page.link["privacy"]+"', '')\">"+_page.text["privacy"]+"</a>");
	privacy_footer = privacy_footer.replace("{OWNER}", "<a href=\""+_page.link["owner"]+"\" onclick=\"return _page.switchHandler('"+_page.link["owner"]+"', '')\">"+_page.text["owner"]+"</a>");
	privacy_footer = privacy_footer.replace("{TERMS}", "<a href=\""+_page.link["terms"]+"\" onclick=\"return _page.switchHandler('"+_page.link["terms"]+"', '')\">"+_page.text["terms"]+"</a>");
	privacy_footer = privacy_footer.replace("| {SITEMAP}", "");
	privacy_footer = privacy_footer.replace("{CAREERS} | ","");
 	var footer = "";
	footer += "							</td>\n";
	footer += "						</tr>\n";
	footer += "					</table>\n";	
	footer += "				</td>\n";
	footer += "			</tr>\n";
	footer += "			<tr>\n";
	footer += "				<td id=\"p-footer\">\n";
	footer += "					<table id=\"p-footertable\">\n";
	footer += "						<tr>\n";
	footer+="							<td id=\"p-footerleft\">\n";
	footer+= (_page.showStockQuotes?"<div id=\"p-stockquotes\">&nbsp;</div>\n":"&nbsp;");
	footer+="							</td>\n";
	footer += "							<td id=\"p-footertext\">\n";
	footer += "		<!-- footer text -->\n";
	footer += " 								"+privacy_footer+"\n";
	footer += "		<!-- end footer text -->\n";
	footer += "							</td>\n";
	footer += "							<td id=\"p-footerright\">\n";
	footer += "								&nbsp;\n";
	footer += "							</td>\n";
	footer += "						</tr>\n";
	footer += "					</table>\n";
	footer += "				</td>\n";
	footer += "			</tr>\n";
	footer += "		</table>\n";
	_page.write(footer,false)
	document.body.style.direction=_page.direction; 	// Set dynamically page direction
	onloadHandler();
};

_page.writeExternalExtranetHeader = function (area) {
	// Include stylesheets
	_page.hideGlobalStyle = true;
	_page.headerType = "external_extranet";
	include_stylesheets();
	// Settings
	var crsc = _page.crsc_server;
	var strWidth = _page.pageWidth;
	var arrow_name = _page.direction=='ltr'?"arrow_orange.gif":"arrow_orange_rtl.gif";
	// Generate Search form HTML
	var searchHTML="";
	searchHTML+="										<table id=\"p-search-form\" cellspacing=\"0\" border=\"0\">";
	searchHTML+="											<tr>\n";
	searchHTML+="												<form id=\"searchform\" name=\"searchform\" action=\""+_page.searchaction+"\">\n";
	searchHTML+="													<td><nobr>"+_page.text["searchlabel"]+"&nbsp;</nobr></td>\n";
	searchHTML+="													<td><input type=\"text\" size=\"20\" name=\"searchtext\" class=\"p-searchfield\" /></td>\n";
	searchHTML+="													<td>\n";
	if (_page.direction=='ltr'){
		searchHTML+="												<input class=\"p-locale-submit\" type=\"image\" alt=\"Submit\" src=\"images/but_go.gif\" />\n";
	} else{
		searchHTML+="												<input class=\"p-locale-submit\" type=\"image\" alt=\"Submit\" src=\"images/but_go_rtl.gif\" />\n";
	}
	searchHTML+="													</td>\n";
	searchHTML+="												</form>\n";
	searchHTML+="											</tr>\n";
	searchHTML+="										</table>\n";
	// Generate Author name HTML
	var authorHTML="";
	authorHTML+=" 										<table id=\"p-author-name\" cellspacing=\"0\" border=\"0\"><tr>\n";
	authorHTML+="											<td><nobr>"+_page.text["authorname"]+"</nobr></td>\n";
	authorHTML+="										</tr></table>\n";
	// Generate Support Links
	var supportLinksHTML= "";
	if(_page.supportLinks.length != 0) {
		supportLinksHTML+= "						<table id=\"p-support-links\" cellspacing=\"0\" border=\"0\"><tr>\n";
		for(i=0;i<_page.supportLinks.length;i++) {
			var supportText = _page.supportLinks[i][0];
			var supportLink = _page.supportLinks[i][1];
			supportLinksHTML+=" 							<td><a href=\""+supportLink+"\" onclick=\"return _page.switchHandler('"+supportLink+"','')\"><img alt=\"\" src=\"images/"+arrow_name+"\" class=\"p-sectionarrow\" />"+supportText+"</a></td>\n";
		}
		supportLinksHTML+="							</tr></table>\n";
	}	
	// Generate Header HTML
	var header="";
	header+="	   <table id=\"p-container\" cellspacing=\"0\" border=\"0\">\n";
	header+="			<tr>\n";
	header+="				<td id=\"p-topcontainertd\">\n";
	header+="					<table id=\"p-topcontainer-"+strWidth+"\" cellspacing=\"0\">\n";
	header+="						<tr>\n";
	header+="							<td id=\"p-mainlogo-extra\"><a href=\""+_page.link["home"]+"\" onclick=\"return _page.switchHandler('"+_page.link["home"]+"', '')\"><img alt=\"Philips\" src=\"images/mainlogo.gif\" /></a></td>\n";
	header+="							<td id=\"p-top-middle\">\n";
	header+="								<table id=\"p-top-options\" border=\"0\" cellspacing=\"0\"><tr>";
	// Show option boxes in top header
	if (_page.showAuthor && _page.authorPosition == "top") {
		header+="								<td>"+authorHTML+"</td>";
	} 
	if (_page.showSearch && _page.searchPosition == "top") {
		header+="								<td>"+searchHTML+"</td>";
	} 
	if(_page.showSupportLinks) {
		header+="								<td>"+supportLinksHTML+"</td>";
	} 
	header+="								</tr></table>";
	header+="							</td>\n";	
	// Define custom logo
	var customLogoSrc = "";
	var customLogoHref = "";
	var customLogoAlt = "";
	if(_page.customLogo[0]) customLogoSrc = _page.customLogo[0];
	if(_page.customLogo[1]) customLogoHref = _page.customLogo[1];
	if(_page.customLogo[2]) customLogoAlt = _page.customLogo[2];
	header+="							<td id=\"p-customlogo\"><a href=\""+customLogoHref+"\" onclick=\"return _page.switchHandler('"+customLogoHref+"', '')\"><img alt=\""+customLogoAlt+"\" src=\""+customLogoSrc+"\" /></a></td>\n";
	header+="						</tr>\n";
	header+="					</table>\n";
	header+="				</td>\n";
	header+="			</tr>\n";
	// Hide top navigation if type = hidden
	if(_page.topNavType != "hidden") {
		header+="		<tr>\n";
		header+="			<td id=\"p-headcontainer-td\">\n";
		header+="				<table id=\"p-headcontainer-table-"+strWidth+"\" cellspacing=\"0\" border=\"0\">\n";
		header+="					<tr>\n";
		header+="						<td>\n";
		header+="		<!-- main navigation bar -->\n";
		header+="							<table class=\"p-tight\" id=\"p-mainnavcontainer\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n";
		header+="								<tr>\n";
		// Disable left/right corner when using internet dropdown buttons
		if(_page.topNavType != "internet") {
			if (_page.direction=='ltr'){
				header+="								<td id=\"p-mainnav-leftcorner\" class=\"p-mainnav-leftcorner\"><img alt=\"\" src=\"images/t.gif\" width=\"1\" /></td>\n";
			} else{
				header+="								<td id=\"p-mainnav-rightcorner\" class=\"p-mainnav-rightcorner\"><img alt=\"\" src=\"images/t.gif\" width=\"1\" /></td>\n";
			}
		}
		// Start main nav LEFT
		header+="									<td id=\"p-mainnav-left\">\n";
		// Start creating top-menu buttons
		if(_page.topNavType == "internet") {
			// Dropdown menubar - internet style
			header+="									<table cellspacing=\"0\" border=\"0\">\n";
			header+="										<tr>\n";
			header+="											<td id=\"p-mainnav-dropdowns\">\n";
			header+="												<table class=\"p-tight\"  id=\"p-mainnav\" cellspacing=\"0\" border=\"0\">\n";
			header+="													<tr>\n";
			// Reset initialized menuArray
			menuArray = new Array();
			i=1;
			for(id in _page.topNavXN) {
				menuArray[i]=id;
				i++;
			}
			// Set current area
			if(typeof(area)!="undefined") {
				_page.area = area;
	    		currSection = _page.area;
			}
			// create button and divider html
			for(counter=1;counter< menuArray.length;counter++) {
				strID = menuArray[counter];
				header+="													<td class=\"navbutton\" id=\""+strID+"button\" onmouseover=\"sectionOn('"+strID+"', event)\" onmouseout=\"sectionOff('"+strID+"')\" onclick=\"Javascript:_page.switchHandler('"+_page.topNavXN[strID][0][1]+"', '')\"><div>"+_page.topNavXN[strID][0][0]+"</div></td>\n";
				header+="													<td id=\"p-mainnav-sep1\" class=\"mainnavsep\" onmouseover=\"hideAllMenus()\"><img alt=\"\" src=\"images/navsep.gif\" /></td>\n";
			}
			header+="													</tr>\n";
			header+="												</table>\n";
			header+="											</td>\n";
			header+="										</tr>\n";
			header+="									</table>\n";
		} else if(_page.topNavType == "icons") {
			// Menubar with icons
			header+="									<table id=\"p-mainnav-icons\" cellspacing=\"0\" border=\"0\">\n";
			header+=" 										<tr>\n";
			var butIcon = "";
			var butLink = "";
			var butText = "";
			for(id in _page.topNavXN) {
				butText = _page.topNavXN[id][0];
				butLink = _page.topNavXN[id][1];
				butImage = _page.topNavXN[id][2];
				butImageAlt = _page.topNavXN[id][3];
				header+="										<td class=\"p-iconbutton\" id=\"button"+"_"+id+"\" onclick=\"Javascript:_page.switchHandler('"+butLink+"', '')\"><a href=\""+butLink+"\">";
				if(typeof(butImage)!="undefined") {
					header+="									<img src=\""+butImage+"\" ";
					if(typeof(butImageAlt)!="undefined") {
						header+="								alt=\""+butImageAlt+"\" ";
					} else {
						header+="								alt=\"\" ";
					}
					header+="									/>";
				}
				header+="										"+butText+"</a></td>\n";
				header+="										<td class=\"p-iconbutton-sep\">&nbsp;</td>";
			}
			header+="										</tr>\n";
			header+="									</table>\n";
		} else {
			// Customised top navigation
			header+="									<table id=\"p-mainnav-custom\" cellspacing=\"0\" border=\"0\" >\n";
			header+="										<tr>\n";
			header+="											<td>"+_page.topNavHTML+"</td>\n";
			header+="										</tr>\n";
			header+="									</table>\n";
		}
		header+="									</td>\n";
		header+="									<td id=\"p-mainnav-right\">\n";
		// Include right column in menubar
		if(_page.showSearch || _page.showAuthor) {
			// Show quick search
			if(_page.showSearch && _page.searchPosition == "menu") {
				header+= 								searchHTML;	
			// Show author info	
			} else if (_page.showAuthor && _page.authorPosition == "menu") {
				header+= 								authorHTML;
			}
		}
		header+="									</td>\n";
		// End top-menu buttons
		if (_page.direction=='ltr'){
			header+="								<td id=\"p-mainnav-rightcorner\" class=\"p-mainnav-rightcorner\"><img alt=\"\" src=\"images/t.gif\" width=\"1\" /></td>\n";
		} else{
			header+="								<td id=\"p-mainnav-leftcorner\" class=\"p-mainnav-leftcorner\"><img alt=\"\" src=\"images/t.gif\" width=\"1\" /></td>\n";
		}
		header+="								</tr>\n";
		header+="							</table>\n";
		header+="		<!-- end main navigation bar -->\n";
		header+="						</td>\n";
		header+="					</tr>\n";
		header+="				</table>\n";
		header+="			</td>\n";
		header+="		</tr>\n";
	}
	header+="			<tr>\n";
	header+="				<td id=\"p-bodycontainer-td\">\n";
	header+="					<table id=\"p-bodycontainer-table-"+strWidth+"\" cellspacing=\"0\" border=\"0\">\n";
	header+="						<tr>\n";
	header+="							<td>\n";
	_page.write(header, false);
	if(_page.activateActiveX) includeActiveXFix();
	addOnLoadEvent(processTables);
};

_page.writeExternalExtranetFooter = function() {
	var crsc = _page.crsc_server;
   	var privacy_footer = _page.text["footer"];	
	privacy_footer = privacy_footer.replace("{BR}", "<br />");
	privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
	privacy_footer = privacy_footer.replace("{PRIVACY}", "<a href=\""+_page.link["privacy"]+"\" onclick=\"return _page.switchHandler('"+_page.link["privacy"]+"', '')\">"+_page.text["privacy"]+"</a>");
	privacy_footer = privacy_footer.replace("{OWNER}", "<a href=\""+_page.link["owner"]+"\" onclick=\"return _page.switchHandler('"+_page.link["owner"]+"', '')\">"+_page.text["owner"]+"</a>");
	privacy_footer = privacy_footer.replace("{TERMS}", "<a href=\""+_page.link["terms"]+"\" onclick=\"return _page.switchHandler('"+_page.link["terms"]+"', '')\">"+_page.text["terms"]+"</a>");
	privacy_footer = privacy_footer.replace("| {SITEMAP}", "");
	privacy_footer = privacy_footer.replace("{CAREERS} | ","");
	var footer = '';
	footer +="							</td>\n";
	footer +="						</tr>\n";
	footer +="					</table>\n";	
	footer +="				</td>\n";
	footer +="			</tr>\n";
	footer +="			<tr>\n";
	footer +="				<td id=\"p-footer\">\n";
	footer +="					<table id=\"p-footertable-"+_page.pageWidth+"\">\n";
	footer +="						<tr>\n";
	footer+="							<td id=\"p-footerleft\">\n";
	footer+= (_page.showStockQuotes?"<div id=\"p-stockquotes\">&nbsp;</div>\n":"&nbsp;");
	footer+="							</td>\n";
	footer +="							<td id=\"p-footertext\">\n";
	footer +="		<!-- footer text -->\n";
	footer +=" 								"+privacy_footer+"\n";
	footer +="		<!-- end footer text -->\n";
	footer +="							</td>\n";
	footer +="							<td id=\"p-footerright\">\n";
	footer +="								&nbsp;\n";
	footer +="							</td>\n";
	footer +="						</tr>\n";
	footer +="					</table>\n";
	footer +="				</td>\n";
	footer +="			</tr>\n";
	footer +="		</table>\n";
	if(	_page.topNavType == "internet") {
		// create dropdown items
		for(counter=1;counter< menuArray.length;counter++) {
			var strID = menuArray[counter];
			footer += createTopNavMenu(strID);
		}
		// Set selected area
		if(_page.area!="") sectionButtonOn(_page.area);
		// Set general settings
		document.onmouseover = hideAllMenus;
	}	
	_page.write(footer,false);
	document.body.style.direction=_page.direction; 	// Set dynamically page direction
	onloadHandler();
};

	_page.getstringlength = function(lbl){
		//Function to calculate length of a string where special chars are included (&....;)
		var i=0;
		var l=lbl.length;
		var count=0;
		for (var cc=0; cc<l; cc++) {
			if (lbl.slice(i,i+1)=='&') {
				if ((lbl.indexOf(';',i) > i) && ((lbl.indexOf('&',i+1)==-1) || (lbl.indexOf('&',i+1)>lbl.indexOf(';',i)))) {
					i=lbl.indexOf(';',i)+1;
				} else {
					i++;
				}
			} else {
					i++;
			}
			if(i<=l){
				count++;
			}
		}
		return count;
	};

	// Write breadcrumb
	_page.writeBreadCrumb = function (active_item) {
		_page.breadCrumbItem = active_item;
		var strThisId;
		var strNavTrail='';
		var max_length = 94;
		var total_length = 0;
		var first_item = 0;
		var spacing_length = 3; // Number of chars for spacing
		// Initalize array of breadcrumb ID's
		var parent_ids=active_item.split("_");
		for (var i=0; i<parent_ids.length; i++) {
			parent_ids[i]=(i>0?parent_ids[i-1]+"_"+parent_ids[i]:parent_ids[i]);
		}
		// Reduce length when font size is enlarged
		if(_page.locale.substring(3,5)=="zh" || _page.locale.substring(3,5)=="ja" || _page.locale.substring(3,5)=="ko"){
			max_length = max_length - 40; // Used to be 15
		}
		if(_page.locale.substring(3,5)=="th"){
			max_length = max_length - 10;
		}
		if(_page.locale.substring(3,5)=="ru"){
			max_length = max_length - 5;
		}
		// Get length of youarehere
		youarehere_length = _page.getstringlength(_page.text["youarehere"]);
		// Get length of home
		home_length = _page.getstringlength(_page.text["home_breadcrumb"]);
		// Reduce max length for 'you are here' and 'home' texts
		max_length = max_length - youarehere_length - home_length -2;
		strNavTrail+='<table class="p-breadcrumb-table" cellspacing="0">\n';
		strNavTrail+='	<tr>\n';
		strNavTrail+='		<td id="p-youarehere">'+_page.text["youarehere"]+':</td>\n';
		strNavTrail+='		<td id="p-home"><a href="'+_page.link["home"]+'">'+_page.text["home_breadcrumb"]+'</a></td>\n';
		// Set special section vars
		var strSectionMainName = (typeof _page.sectionMain[0]!="undefined"?_page.sectionMain[0]:'')
		var strSectionMainLink = (typeof _page.sectionMain[1]!="undefined"?_page.sectionMain[1]:'')
		var strSectionSpecialName = (typeof _page.sectionSpecial[0]!="undefined"?_page.sectionSpecial[0]:'')
		var strSectionSpecialLink = (typeof _page.sectionSpecial[1]!="undefined"?_page.sectionSpecial[1]:'')
		// Reduce max lenght for section
		var area_string='';
		if(_page.area!="" && strSectionSpecialName==""){
			if(_page.headerType == "external_extranet") {
				firstElement = (typeof(_page.topNavXN[_page.area])!="undefined"?_page.topNavXN[_page.area][0][0]:"");
			} else{
				firstElement = (typeof(_page.topNav[_page.area])!="undefined"?_page.topNav[_page.area][0][0]:"");
			}
			// Only show section when section is available
			if(active_item!="") {
				if(firstElement!="") {
					//Show translated section contents
					strNavTrail+='		<td class="p-microarrow"><a href="'+_page.locales[_page.locale]+'">'+firstElement+'</a></td>\n';
					area_string = firstElement;
				} else {
					strNavTrail+='		<td class="p-microarrow">'+_page.area+'</td>\n';
					area_string = _page.area;
				}
			} else {
				if(firstElement!=""){
					//Show translated section contents
					strNavTrail+='		<td class="p-microarrow">'+firstElement+'</td>\n';
					area_string = firstElement;
				}else{
					// Include text that is used in _page.area (other site)
					strNavTrail+='		<td class="p-microarrow">'+_page.area+'</td>\n';
					area_string = _page.area;
				}
			}
		} else if(strSectionSpecialName!="") {
			// Show special section items
			if(strSectionMainName!="")		strNavTrail+='		<td class="p-microarrow">'+(strSectionMainLink!=""?'<a href="'+strSectionMainLink+'">'+strSectionMainName+'</a>':strSectionMainName)+'</td>\n';
			if(strSectionSpecialName!="")	strNavTrail+='		<td class="p-microarrow">'+(strSectionSpecialLink!="" && active_item!=""?'<a href="'+strSectionSpecialLink+'">'+strSectionSpecialName+'</a>':strSectionSpecialName)+'</td>\n';
			area_string = strSectionMainName+strSectionSpecialName;
		}
		// reduce max length
		if(area_string!="") {
			max_length = max_length - _page.getstringlength(area_string);
		}
		if(active_item!=""){
			// Check if all items fit on 1 row			
			for (var i=0; i<parent_ids.length; i++) {
				total_length += _page.leftNav[parent_ids[i]].text.length;
			}
			counter = 0;
			if(total_length>max_length){
				while(total_length>max_length){
					total_length = total_length - _page.leftNav[parent_ids[counter]].text.length - spacing_length;
					i = i - 1;
					counter += 1;
				}
			}
			start_item = parent_ids.length - i;
			if(start_item!=0){
				strNavTrail+='		<td class="p-microarrow">...</td>\n';
			}
			for (var j=start_item; j<parent_ids.length; j++) {
				if(j!=(parent_ids.length-1)){
					strNavTrail+='<td class="p-microarrow"><a href="'+_page.leftNav[parent_ids[j]].link+'">'+_page.leftNav[parent_ids[j]].text+'</a></td>\n';
				}else{
					strNavTrail+='<td class="p-microarrow">'+_page.leftNav[parent_ids[j]].text+'</td>\n';
				}
			}
		}
		strNavTrail+='</tr>\n';
		strNavTrail+='</table>\n';
		document.write(strNavTrail);
	};
	
	/* 
	**********************************************
	*******       Locale selector layer functions      ******
	**********************************************
	*/
	_page.arrLS =[];
	_page.ls = function(type) {
		this.arrIndex = _page.arrLS.length;
		this.id = "ls_"+ this.arrIndex;
		this.timer = "";
		this.type = type;
		this.rows = 9;
		this.overflow = false;
		_page.arrLS[this.arrIndex] = this;	// Add to LS array
		this._init();						// Initialize LS
	}
	_page.ls.prototype = {
		_init:function() {
			this._build();
			var lsIndex = this.arrIndex;
			addDOMOnLoadEvent(function(){_page.arrLS[lsIndex]._update()});
		},
		_load:function() {
			this._update();
			this._renderImages();
			this._resize();
			this._position();
		},
		_mClick:function() {
			clearTimeout(this.timer);
			_page.arrLS[this.arrIndex]._show();
		},
		_mOver:function() {
			clearTimeout(this.timer);
			this.timer=setTimeout('_page.arrLS['+this.arrIndex+']._show()','2000');
		},
		_mClose:function() {
			clearTimeout(this.timer);
			this.timer=setTimeout('_page.arrLS['+this.arrIndex+']._hide()','1000');
		},
		_show:function() {
			this._load();
			var objLS = gE('p-ls-container-'+this.arrIndex);
			if(objLS) {
				var objLSBody = gE('p-ls-body-'+this.arrIndex);
				if(objLSBody && this.overflow) objLSBody.style.overflow = "auto";	
				if(this.type == '1') {
					var objFlag = gE('p-flag-'+this.arrIndex);
					if(objFlag) applyStyle(objFlag,'p-flag-on');
				}
				if(useIframe) {
					var objIframe = gE('p-lsIF-'+this.arrIndex);
					if(objIframe) sE(objIframe);
				}
				sE(objLS);
			};
		},
		_hide:function() {
			var objLS = gE('p-ls-container-'+this.arrIndex);
			if(objLS) {
				var objLSBody = gE('p-ls-body-'+this.arrIndex);
				if(objLSBody  && this.overflow) objLSBody.style.overflow = "hidden";	// Hidden due to mac NS/Camino/FF border visibility issues
				if(this.type == '1') {
					var objFlag = gE('p-flag-'+this.arrIndex);
					if(objFlag) applyStyle(objFlag,'p-flag');
				}
				if(useIframe) {
					var objIframe = gE('p-lsIF-'+this.arrIndex);
					if(objIframe) hE(objIframe);
				}
				hE(objLS);
			}
		},
		_build:function() {
			// Get alternative locale flag
			var strFlagLocale = (_page.altLocaleFlag==""?_page.locale:_page.altLocaleFlag);
			var strLocaleText = _page.altLocaleText;
			// Set locale flag
			if(strFlagLocale=="global"){
				flag_src="flag_global.gif";
				// Get ALT text for flag
				if(_page.altLocaleText=="") strLocaleText = "Global / English";
			} else{
				flag_src= "flag_"+strFlagLocale.substr(0,2)+".gif";
				// Get ALT text for flag
				current_country = strFlagLocale.substring(0,2);
				current_language = strFlagLocale.substring(3,5);
				if(_page.altLocaleText=="") strLocaleText = _page.countries[current_country] +" / "+ _page.languages[current_language];		
			}
			var strHTML = "";
			var crsc = _page.crsc_server;
			// Add onclick / mouse over HTML
			var strArrowName = (_page.direction == 'ltr'?"arrow_bottom_right.gif":"arrow_bottom_left.gif")
			if(this.type == "1") {
				strHTML+="<div class=\"p-ls-hover-container-1 p-click\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mClose()\" onclick=\"_page.arrLS["+this.arrIndex+"]._mClick()\"><nobr><table cellpadding=0 cellspacing=0><tr>";if (strFlagLocale=="global"){strHTML=strHTML+"<td style='padding-bottom:2px;'><font style='font-size:10px;color:#0e5fd8;'>Choose your language:</font></td>";}
				strHTML=strHTML+"<td><img title=\""+strLocaleText+"\" alt=\""+strLocaleText+"\" src=\"images/" + flag_src + "\" id=\"p-flag-"+this.arrIndex+"\" class=\"p-flag\" />&nbsp;<img alt=\"Show locale list\" src=\"images/"+strArrowName+"\" id=\"p-arrow-bottom-right-"+this.arrIndex+"\" class=\"p-arrow-bottom-right\" /></td></tr></table></nobr></div>\n";
			} else if(this.type == "2") {
				strHTML+="<div class=\"p-ls-hover-container-2 p-click\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mClose()\" onclick=\"_page.arrLS["+this.arrIndex+"]._mClick()\"><table class=\"p-ls-hover\" id=\"p-ls-hover-"+this.arrIndex+"\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td class=\"p-ls-hover-left\"><table cellpadding=0 cellspacing=0><tr>";if (strFlagLocale=="global"){strHTML=strHTML+"<td style='padding-bottom:2px;'><font style='font-size:10px;color:#0e5fd8;'>Choose<br>your language:</font></td>";}
				strHTML=strHTML+"<td><img title=\""+strLocaleText+"\" alt=\""+strLocaleText+"\" src=\"images/" + flag_src + "\" id=\"p-flag-"+this.arrIndex+"\" class=\"p-flag\" /></td></tr></table></td><td class=\"p-ls-hover-center\"><span id=\"p-ls-header-text-"+this.arrIndex+"\">"+strLocaleText+"</span></td><td class=\"p-ls-hover-right\"><img alt=\"Show locale list\" src=\"images/"+strArrowName+"\" id=\"p-arrow-bottom-right-"+this.arrIndex+"\"/></td></tr></table></div>\n";
			}
			// Add Dropdown HTML
			strHTML+="					<div id=\"p-ls-container-"+this.arrIndex+"\" class=\"p-ls-container\" onmouseover=\"_page.arrLS["+this.arrIndex+"]._mOver()\" onmouseout=\"_page.arrLS["+this.arrIndex+"]._mClose()\" style=\"visibility:hidden;\">\n";
			var strHeader = "<div id=\"p-ls-header-"+this.arrIndex+"\" class=\"p-ls-header\"><table cellspacing=\"0\" class=\"p-ls-header-table\"><tr><td><span id=\"p-ls-header-text-"+this.arrIndex+"\">"+strLocaleText+"</span></td></tr></table></div>\n";
			// Define overflow attribute, exception for Safari since it cannot be adjusted dynamically
			var strOverflow = (_page.browser.isSafari?'auto':'hidden');
			var strClass = (this.type=='1'?'p-ls-body-down':'p-ls-body-up');
			var strBody = "<div id=\"p-ls-body-"+this.arrIndex+"\" class=\""+strClass+"\" style=\"overflow:"+strOverflow+"\">Loading...</div>\n";
			if(this.type == "1") {
				strHTML+= strHeader + strBody;	// Header used which overlaps the topmenu

			} else if(this.type == "2") {
				strHTML+= strBody;
			}
			strHTML+="</div>";
			// Add IFRAME html
			if(useIframe) {
				strHTML+="		<iframe frameborder=0 id=\"p-lsIF-"+this.arrIndex+"\" src=\"javascript:false;\" scroll=none style=\"FILTER:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility:hidden;height:0;position:absolute;width:0px;top:0px;z-index:0\"></iframe>";
		    }
			this.html = strHTML;
		},
		_renderImages:function() {
			if(this.imagesRendered) return;
			var strLocale, strCurCountry, objLink, strNewClass;
			for(var i=0;i < arrLocales.length;i++) {
				strLocale = arrLocales[i][0];
				strCurCountry = (strLocale.indexOf("_")==-1?strLocale:strLocale.substring(0,2));
				objLink = gE("p-ls-list-"+this.arrIndex+"-flag-" + strCurCountry);
				strNewClass = "p-flag-" + strCurCountry;
				if(objLink)
					applyStyle(objLink,strNewClass);
			}
			this.imagesRendered = false;	
		},
		_update:function() {
			if(this.updated) return;
			if(!blnLocalesProcessed) processLocales(); // Create locale array of sorted locales
			var crsc = _page.crsc_server;
			var strHTML = '';
			var strCurCountry = '';
			var strLastCountry = '';
			var strLocale = '';
			strHTML += "<table class=\"p-ls-list\" cellspacing=\"0\" border=\"0\">\n";
			for(var i=0;i < arrLocales.length;i++) {
				strLocale = arrLocales[i][0];
				strCurCountry = (strLocale.indexOf("_")==-1?strLocale:strLocale.substring(0,2));
				if (strCurCountry != strLastCountry) {
					// Set flag dimensions;
					var objFlagDimensions = {width:'17',height:'13'};
					if(strCurCountry=="global" || strCurCountry=="me_en" || strCurCountry=="ce_es"|| strCurCountry=="others")
						objFlagDimensions = {width:'14',height:'14'};
					strHTML += 
					(i!=0?"</ul></td></tr>\n":"")+
					"<tr><td class=\"p-ls-list-left"+(!arrLocales[i+1]?" p-nobottomborder":"")+"\"><a id=\"p-ls-list-"+this.arrIndex+"-flag-"+strCurCountry+"\" href=\""+arrLocales[i][3]+"\" onclick=\"_page.changelocale('"+strLocale+"');return false;\" /></td><td  class=\"p-ls-list-right"+(!arrLocales[i+1]?" p-nobottomborder":"")+"\"><ul class=\"p-ls-localelist\">\n";
				}
				// Set country / language
				strHTML += "<li><a href=\""+arrLocales[i][3]+"\" onclick=\"_page.changelocale('"+strLocale+"');return false;\">"+arrLocales[i][4]+"</a></li>";
				strLastCountry = strCurCountry;			
			}
			strHTML += "</ul></td></tr>\n";
			strHTML += "</table>\n";
			var obj = gE('p-ls-body-'+this.arrIndex);
			if(obj) obj.innerHTML = strHTML;
			this.updated = true;
		},
		_resize:function() {
			if(this.resized) return;
			// Set dynamich height of dropdown by defined max rows;
			var intMaxRows = this.rows;
			var objDD = document.getElementById('p-ls-body-'+this.arrIndex);
			var arrRows = objDD.getElementsByTagName('tr');
			var intHeight = 0;
			var i= 0;
			while (i <= intMaxRows-1) {
				if(arrRows[i]) {
					var objCell = arrRows[i].childNodes[1];
					intHeight += objCell.offsetHeight;
				} 
				i++;
			}
			if(arrRows.length > intMaxRows) {
				intHeight--;
				this.overflow = true;	// Allow overflow / vertical scrollbar
			} else if(!_page.browser.isSafari) {
				var objList = objDD.firstChild;
				sW(objList,objDD.offsetWidth-2); // - 2  due to border
			}
			sH(objDD,intHeight);
			this.resized = true;
		},
		_position:function () {
			var posX = 0;
			var posY = 0;
			var objLS = gE('p-ls-container-'+this.arrIndex);
			var objRef = null;
			if(this.type == '1') {
				objRef = gE('p-arrow-bottom-right-'+this.arrIndex);
				if(_page.direction == 'rtl') {
					posX = getLeftPos(objRef) + objRef.offsetWidth - 2; //  Extra border
				} else {
					posX = getLeftPos(objRef) - objLS.offsetWidth + objRef.offsetWidth + 2; //  Extra border
					if(isMacIE) 
						posX -= findPosX(gE('p-topcontainer'));	// MAC IE 
				}
				posY = findPosY(objRef)-12;
			} else if(this.type == '2') {
				objRef = gE('p-ls-hover-'+this.arrIndex);
				posX = getLeftPos(objRef) +2 //  Extra border
				posY = findPosY(objRef)-objLS.offsetHeight;
			}
			sX(objLS,posX);
			sY(objLS,posY);
			// If browser is not NS or IE5, set size and position the iframe behind locale selector
			if (useIframe) {
				var	objIframe = gE('p-lsIF-'+this.arrIndex);
				sH(objIframe,(objLS.offsetHeight+3));
				sW(objIframe,(objLS.offsetWidth+3));
				sX(objIframe,posX);
				sY(objIframe,posY);
			}
		}
	}

	// Build locale sorted array, used for i.e. locale selector list
	var arrLocales = [];
	var blnLocalesProcessed = false;
	function processLocales() {
		// Build array
		var i = 1;
		for(anItem in _page.locales){
			if(anItem != "global") {
				var strCountry = _page.countries[anItem.substring(0,2)];
				var strLanguage = _page.languages[anItem.substring(3,5)];
				arrLocales[i] = [];
				arrLocales[i][0] = anItem;									// Store locale code
				arrLocales[i][1] = strCountry;								// Store country
				arrLocales[i][2] = strLanguage; 							// Store language
				arrLocales[i][3] = _page.locales[anItem]; 					// Store link
				arrLocales[i][4] = strCountry+" / "+strLanguage; 			// Store combi country/language
				i++;
			}
		}
		arrLocales[0] = []; 	// Create first container for locale global.
		arrLocales[0][4] = "/"	// Enter empty value, inorder to make sure the element is on top of the list
		// Sort array
		var sortCol=4;
		var sortOrder="asc";
		arrLocales.sort(sortArray);
		function sortArray(a,b) {
			if (a[sortCol]<b[sortCol]) return (sortOrder=="asc"?-1:1);
			if (a[sortCol]>b[sortCol]) return (sortOrder=="asc"?1:-1);
			return 0;
		}
		// Insert global locale as first element
		arrLocales[0][0] = "global";
		arrLocales[0][1] = "Global";
		arrLocales[0][2] = "English";
		arrLocales[0][3] = _page.locales["global"];
		arrLocales[0][4] =  arrLocales[0][1]+" / "+arrLocales[0][2];
		// Add others option at the last position in the list / Only applicable for normal internet site

        /*
		if(_page.headerType =="internet") {
			var lengthLocales = arrLocales.length;
			_page.locales["others"] = "?site=home&universe=home&lang=global";
			arrLocales[lengthLocales] = [];
			arrLocales[lengthLocales][0] = "others";
			arrLocales[lengthLocales][1] = "Others";
			arrLocales[lengthLocales][2] = "";
			arrLocales[lengthLocales][3] = _page.locales["others"];
			arrLocales[lengthLocales][4] = "Others";
		}
		*/
		// Set trigger
		blnLocalesProcessed = true;
	}
					
	/*
	**********************************
	******* Top menu functions *******
	**********************************
	*/
	
	// Fired on mouseover of a section
	function sectionOn(sect, event){
		event.cancelBubble = true;
		hideOtherMenus(sect);
		if(menuDown != sect){
			clearTimeout(dropDown);
			_page.topNavType == "internet"?sectionButtonOn(sect):sectionButtonHover(sect);
			menuDown = sect;
			section = sect;
			positionDropDown(sect);
			dropDown = setTimeout('dropdownMenu("' + sect + '")', dropdown_show_delay);
		}
	};

	// Fired on mouseout of a section
	function sectionOff(sect){				
		if(sect != section){
			sectionButtonOff(sect);
		}
	};

	// This function sets the style of section 'sect' to hover
	function sectionButtonHover(sect){
		var td = document.getElementById(sect + "button");
		if(td){
			if(sect != currSection){
				applyStyle(td, "sectionhover");	
			}
		}
	}
	
	// This function sets the style of section 'sect' to active
	function sectionButtonOn(sect){
		var td = document.getElementById(sect + "button");
		if(td){
			// Set style of this TD to 'active'
			if(_page.topNavType == "internet") {
				applyStyle(td, "sectionon");
			} else {
				applyStyle(td, "sectionon");
				sepLeft = td.previousSibling;
				if(sepLeft.nodeType == 3) sepLeft = sepLeft.previousSibling;
				if(sepLeft) applyStyle(sepLeft, "mainnavsep-left");	
				sepRight = td.nextSibling;
				if(sepRight.nodeType == 3) sepRight = sepRight.nextSibling;
				if(sepRight) applyStyle(sepRight, "mainnavsep-right");	
			}
		}		
	};

	// This function sets the style of section 'sect' to inactive 
	function sectionButtonOff(sect){
		var td = document.getElementById(sect + "button"); 
		if(td){
			if(sect != currSection){
				if (td.getAttribute("className") != "navbutton") {
					applyStyle(td, "navbutton");
				}
			}
		}
	};

	// This function shows the dropdown menu of section 'sect'
	function dropdownMenu(sect){
		// Show drop-down menu
		showDD(sect);
	};

	// This function hides all menu's with a delay of 'menu_hide_delay' (see general settings)
	function hideAllMenus() {
		clearTimeout(dropDown);
		hideMenu = setTimeout('hideIt()', menu_hide_delay);	
		menuDown = "";
	}

	// 	This function hides all menu's except the menu of the section 'skipSect'
	function hideOtherMenus(skipSect) {
		for(counter=1;counter<menuArray.length;counter++) {
			if(menuArray[counter] != skipSect){
				var sect = menuArray[counter];
				sectionButtonOff(sect);				
				hideDD(sect);
			};		
		};
	};

	// 	This function hides all menu's except the one that's currently active
	function hideIt(){
		for(counter=1;counter<menuArray.length;counter++) {
			if(menuArray[counter] != menuDown){
				var sect = menuArray[counter];
				sectionButtonOff(sect);
				hideDD(sect);
			};
		};
	};

	// This function shows the dropdown of 'sect'
	function showDD(sect) {
		var dd = 'p-' + sect + 'DD';
		var objDD = gE(dd);
		if(objDD){
			objDD.style.zIndex=1;
			sE(objDD);
			if (useIframe) {
				var	ddframe = 'p-' + sect + 'IF';	
				ddframe = gE(ddframe);
				if(ddframe) sE(ddframe);
			};
		};
	};
	
	// This function hides the dropdown of 'sect'
	function hideDD(sect) {
		var dd = 'p-' + sect + 'DD';
		var odd = gE(dd);
		if(odd) {
			hE(odd);		// Hide element
			if (useIframe) {
				var	ddframe = 'p-' + sect + 'IF';	
				ddframe = gE(ddframe);
				if(ddframe) hE(ddframe);
			};
		};
	};
		
	// This function sets the style of an active drop-down item
	function activeDDItem(td, extra_class){
		applyStyle(td, "dd-activeItem"+extra_class);
	};

	// This function sets the style of an inactive drop-down item
	function inactiveDDItem(td, extra_class){
		applyStyle(td, "dd-inactiveItem"+extra_class);
	};
	
	// This function returns the X position of 'objElement'
	function getLeftPos(objElement) {
		var offsetLeft = findPosX(objElement);
		return offsetLeft - 2;
	};

	// This function returns the Y position of 'objElement'
	// Note: instead of returning the top of the object, the bottom is returned!
	function getTopPosBottom(objElement) {
		var offsetTop = 0;
		var adjust = 0;
		// Onderstaand kan netter
		if(objElement != null){
			if(objElement.offsetHeight!=33){
				// 33 is height of top menu (return bottom of object). Return top of object for rest.
				if(objElement.offsetHeight==34){
					// Two lines in flyout
					adjust = objElement.offsetHeight - 18;
				}else{
					adjust = objElement.offsetHeight - 20;
				}		
			}
			return findPosY(objElement) + objElement.offsetHeight - adjust;
		}
		return 0;
	};

	// This function positions all the dropdown layers
	// Every dropdown is aligned with the corresponding menu-button
	function positionDropDown(section){
		// Position drop-down
		var objButton = gE(section + 'button');
		var dd = gE('p-' + section + 'DD');
		if(dd) {
			var extra_left = 1;
			// If page direction is RTL, then dropdown aligns with right-side of button
			if(_page.direction=="rtl"){
				// Calculate space to move box to the left
				extra_left = objButton.offsetWidth - dd.offsetWidth + 3;
			}
			// Position the dropdown-menu
			sX(dd, getLeftPos(objButton)+extra_left);
			sY(dd, getTopPosBottom(objButton));
			// If browser is not NS or IE5, set size and position the iframe behind dropdown
			if (useIframe) {
				var	ddframe = gE('p-' + section + 'IF');
				sH(ddframe, (dd.offsetHeight));
				sW(ddframe, (dd.offsetWidth));
				sX(ddframe, getLeftPos(objButton)+extra_left);
				sY(ddframe, getTopPosBottom(objButton));
			}
		}
	};

	// This function initiates the positioning of dropdowns and overlay fillers
	function initDropDowns(){
		for(counter=1;counter< menuArray.length;counter++) {
			// Position dropdown
			positionDropDown(menuArray[counter]);
		}
	}
	
	// Function to create the dropdown menu, append HTML to array
	function createTopNavMenu(m) {
		var tm = _page.headerType == "external_extranet"?_page.topNavXN[m]:_page.topNav[m];
		var dropdown = '';
      	dropdown+="		<!-- "+m+" section dropdown-->\n";
       	// If needed for browsertype, create IFRAME to solve select-problem
       	if(useIframe) {
			dropdown+="		<IFRAME frameborder=0 id=\"p-"+m+"IF\" src=\"javascript:false;\" scroll=none style=\"FILTER:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility:hidden;height:0;position:absolute;width:0px;top:0px;z-index:0;\"></iframe>";
    	}
       	// Create actual dropdown
		dropdown+="			<div id=\"p-"+m+"DD\" class=\"p-mainnavDD\" onmouseover=\"event.cancelBubble=true\">\n";
		if (tm.length>1) {
			// Only load table if submenu's are available
			if(_page.headerType == "external_extranet") {
				dropdown+="			<div class=\"p-mainnavDD-spacer\" style=\"height:"+topmenu_dd_spacer+"px\">&nbsp;</div>\n";
			}	
			dropdown+="			<table class=\"p-dropdown\" cellspacing=\"0\" onmouseover=\"sectionOn('"+m+"', event)\">\n";				
			for (var i=1;i<tm.length;i++) {
				dropdown+="							<tr>\n";
				// Get layout of item (check extra parameters)
				show_class  = "dd-inactiveItem";
				extra_class = "";
				language_switch = "";
				if(typeof(tm[i][2])!="undefined"){
					if(tm[i][2].indexOf("bold=yes")!=-1){
						show_class="dd-inactiveItem p-bold";
						extra_class = " p-bold";
					}
				}					
				// Check if there is a language switch
				var language_switch = '';
				if(tm[i][2]) language_switch = getLanguageSwitch(tm[i][2]);
				dropdown+="								<td class=\""+show_class+"\" onmouseover=\"activeDDItem(this, '"+extra_class+"')\" onmouseout=\"inactiveDDItem(this, '"+extra_class+"')\"\n";
				dropdown+="									onclick=\"Javascript:_page.switchHandler('"+tm[i][1]+"', '_self', '"+language_switch+"')\">\n";
				dropdown+="									"+tm[i][0]+"\n";
				dropdown+="								</td>\n";
				dropdown+="							</tr>\n";
			}
			dropdown+="						</table>\n";
		}
		dropdown+="		</div>\n";
		dropdown+="		<!-- end "+m+" section dropdown -->\n";
		return dropdown;
    };
	
	/*
	*********************************
	****** Left menu functions ******
	*********************************
	*/

	// Object for left menu items
	function _Item(text, link, options) {		
		this.text = text;
		this.link = link;
		this.options = options;
		this.flyoutid = 0;
		this.flyoutopenid = 0;
		this.parentid = "";
		this.level = 0;				// Default level, incremented during item_update
		this.children = false;		// By default -> no children. Value is changed in _Item_update()
		this.showlink = true; 		// Show standard the links in the menu
		this.showCategory = false;	// Item is not category by default
		/* Temporary options added for Philips Lighting */
		this.hideChilds = false;	// Always use flyout instead of childs in left-menu
		this.showAll = false;		// Show all childs or not
		this.hideLink = false;		// Hide current link from left menu
	};	
	
	// This function loops through all leftmenu-items and sets all variables 
	function _Item_update(){
		var item_update;
		var active_item = _page.leftNavItem;
		var leftNavItem_level = getItemLevel(_page.leftNavItem);
		var debug_flyouts = ""; // Used for debug options
		
		for (z=0; z < _page.sortedArray.length; z++){
			item_update=_page.sortedArray[z];	
			item_update.level = getItemLevel(item_update.id);
			// If not a top-item:
			// - add the ID of the parent item
			// - set the parent to have children
			if (item_update.level > 1) {
				next_item = item_update.id.lastIndexOf("_");
				item_update.parentid = item_update.id.substr(0,next_item);
				_page.leftNav[item_update.parentid].children = true;
			}
			// Get extra options if option-string is not empty
			if(item_update.options != "" && typeof(item_update.options)!="undefined"){
				// First, split option-string in seperate options
				array_options = item_update.options.split(",");
				// Initial / default option values
				var flyout = 1;
				var disable_link = false;
				var hide_childs = false;
				var show_all = false;		
				var hide_link = false;
				var show_category = false;
				// Check for options
				for(i=0;i<array_options.length;i++){
					if(array_options[i].indexOf("flyout=no")==0){
						// Don't show flyout
						flyout=0;
					}
					else if(array_options[i].indexOf("link=no")==0){
						//Don't show links
						disable_link = true;
					}
					else if(array_options[i].indexOf("hidechilds=yes")==0){
						// Don't show childs directly, only as flyout
						hide_childs = true;
					}
					else if(array_options[i].indexOf("showall=yes")==0){
						// Show all childs
						show_all = true;					
					}
					else if(array_options[i].indexOf("hidelink=yes")==0){
						// Hide this link
						hide_link = true;					
					}
					else if(array_options[i].indexOf("category=yes")==0){
						// Hide this link
						show_category = true;					
					}
				}
				// Update status of hide_childs
				item_update.hideChilds = hide_childs;
				// Update status of show_all
				item_update.showAll = show_all;
				// Update status of hide_link
				item_update.hideLink = hide_link;
				// Update status of show_category, only shown at level 1
				// if(item_update.level==1) item_update.showCategory = show_category;
				item_update.showCategory = show_category;
				// Update flyout status of item
				if(flyout==0 && item_update.level < max_item_levels && hide_childs==false){
					// No flyout is needed for first 'max_item_levels' levels
					item_update.flyout = false;
				}else{
					if(item_update.level < max_menu_levels){
						// Only flyout on levels < 'max_menu_levels'
						item_update.flyout = true;
					}else{
						// Level >= 'max_menu_levels'
						item_update.flyout = false;
					}
				}
				// Update status of link should be shown of item
				// Disable link is set in parameters			
				if(disable_link){
					item_update.showlink = false;
				}
			}else{
				// Nothing defined in options
				if(item_update.level < max_menu_levels){
					// Only flyout on levels < 'max_menu_levels'
					item_update.flyout = true;
				}else{
					// Level >= 'max_menu_levels'
					item_update.flyout = false;
				}				
			}						
			// Check if item is (parent of) active item and not more then 2 levels flyout
			active_item = _page.leftNavItem;
			item_update.active = false;						
			for(i=0;i<leftNavItem_level;i++){
				// Check if current item matches the string
				if(item_update.id==active_item) item_update.active = true
				// Remove last two characters from string (one level less)				
				get_items = active_item.lastIndexOf("_");
				active_item = active_item.substr(0,get_items)
			}			
			// Check if current flyout is allowed to be rendered
			if(item_update.active) {
				// No flyout allowed for active item at level 1-4 (show children first)
				if(item_update.level < max_item_levels) item_update.flyout = false;
			}
			else if(item_update.level>1) {
				if(_page.leftNav[item_update.parentid].flyout || item_update.parentid == _page.leftNavItem){
					// Parent has flyout or is active, flyout possible
					if(item_update.level>2 && _page.leftNav[_page.leftNav[item_update.parentid].parentid].flyout){
						item_update.flyout = false; // Grandparent already has flyout, flyout not allowed
					}else{
						// Parent has flyout or is active --> flyout is allowed
						if(item_update.flyout == true) item_update.flyout = true;
					}
				}else{
					item_update.flyout = false;
				}
			}
			else if(item_update.level==1) {
				//item_update.flyout = false;
			}
			else {
				item_update.flyout = false;
			}
			// If childs of active item are hidden in leftmenu, force flyout
			if(item_update.active == true && item_update.hideChilds == true && _page.leftNav[item_update.parentid].flyout == false) {
				item_update.flyout = true;
			}	
			// If item inherits a showall-property, all child are shown in leftmenu --> no flyout
			if (inheritsShowall(item_update)) item_update.flyout = false;
		}
	};
	
	/*
	***********************************
	****** Generate Left menu  ********
	***********************************
	*/
	_page.writeLeftNav = function (activeItem) {
		_page.leftNavOnload = false;
		if(_page.leftNavOnload) {
			// register onload event
			document.write('<div id=\"p-leftnav-container\">&nbsp;</div>');
			addOnLoadEvent("_page.writeLeftNav2('"+activeItem+"')");
		} else {
			// build left nav immediately
			_page.writeLeftNav2(activeItem);
		}
	}
	
	_page.writeLeftNav2 = function (activeItem) {
		// Set active item if given as function parameter
		if (activeItem != null && trim(activeItem) != "") {
			_page.leftNavItem = activeItem;
		} else {
			_page.leftNavItem = "";
		}
		// Sort item array
		_Item_sort();
		// Update all items objects
		_Item_update();
		// Build left nav menu
		var strHTML = '';
		// Don't build left nav table if no nav items present
		var blnShowTable = (_page.sortedArray.length>0?true:false);
		if(blnShowTable) {
			strHTML +=  "<table id=\"p-table-left\" class=\"p-section-nav\" cellspacing=\"0\">\n";
			var active_level = getItemLevel(_page.leftNavItem);
			var current_level = 1;
			var previous_level = 0;
			var previous_item = "";
			for (z=0; z < _page.sortedArray.length; z++){
			 	anItem = _page.sortedArray[z].id;
				show_active = false;
				show_item = false;			
				// Get level of current item
				current_level = _page.leftNav[anItem].level;
				// Check if item need to be shown
				// Only show if one of the following options is true:
				// Item is not hidden (hideLink)
				// - Item is level 1 item
				// - Item is active item
				// - Item is in currently opened menu
				if(_page.leftNav[anItem].hideLink){
					// Never show Link if this value is true
					show_item = false;
				}
				else{
				  if (current_level==1) show_item = true;	// First level items are always visible
				  else if (current_level > 1 && (_page.leftNav[anItem].active || (_page.leftNavItem!="" && _page.leftNav[_page.leftNav[anItem].parentid].id == _page.leftNavItem) || inheritsShowall(_page.leftNav[anItem]) || isSibling(_page.leftNav[anItem]))) {
					// An item-level should be < max_item_levels. No more levels are allowed on the left. A flyout is needed for the rest				
					if(_page.leftNav[_page.leftNav[anItem].parentid].hideChilds == true){
						//Check if this item is still active. Don't hide then
						if(_page.leftNav[anItem].active){
							show_item = true;
						} else{
							show_item = false;
						}
					}
					else if(current_level <= max_item_levels){
						show_item = true;
					}
				  }
				}
				if(show_item){
					if(previous_item!=""){
						// Skip first item
						// Solid for siblings disabled
						/*if (previous_level!=1 && current_level !=1 && (current_level<previous_level)){
							strHTML +=  "<tr><td><div class=\"p-solidsep\"> </div></td></tr>\n";
						}*/
					}
					// If flyout is allowed and children are present --> generate flyout 
					if(_page.leftNav[anItem].flyout && _page.leftNav[anItem].children){
						_page.flyout_create(anItem, 1);
					}
					// Add dotted seperator when a level 1 item starts, only not before the first one
					if (previous_level != 0){
						// Only show seperator when not the first item
						if (current_level==1 && previous_level!=1){
							//Only show solid seperator when previous item is not a level 1 item
							strHTML +=  "<tr><td><div class=\"p-solidsep\"> </div></td></tr>\n";
						}
					}
					strHTML +=  "	<tr>\n";
					// Get layout of this item
					if(_page.leftNav[anItem].showCategory) {
						set_class="p-left_level_"+ +current_level+ "_category";								// Category item
					}
					else if(_page.leftNavItem!="" && _page.leftNavItem == anItem) {		
						set_class="p-left_level_"+ +current_level+ "_active";	
					}
					else if(_page.leftNav[anItem].level==max_item_levels && _page.leftNav[anItem].flyout && _page.leftNav[anItem].children){
						set_class="p-left_level_" +current_level+ "_fly_active";		// Special item for flyout on active item on 'max_item_level'
					}
					else if(_page.leftNav[anItem].active && _page.leftNav[anItem].flyout) {
						set_class="p-left_level_" +current_level+ "_fly_active";		// Special item for flyout on active item with forced flyout
					}
					else if(_page.leftNav[anItem].active){
						set_class="p-left_level_" + current_level + "_open";			// Active item
					}
					else if(_page.leftNav[anItem].flyout && _page.leftNav[anItem].children){
						set_class="p-left_level_" + current_level + "_fly";				// Fly out item
					}
					else{
						set_class="p-left_level_" + current_level + "_closed";			// Inactive item
					}
					// Make sure no hand is shown when no link s available
					if(_page.leftNav[anItem].showlink==false){
						set_class += " p-nolink";
					}
					// Create item with or without mouseover for flyout 
					if(_page.leftNav[anItem].flyout && _page.leftNav[anItem].children && !_page.leftNav[anItem].showCategory){
						strHTML +=  "		<td id='"+anItem+"' class=\""+set_class + "\" onmouseover=\"_page.flyout('"+anItem+"', 1);_page.item_mouseover(this);\" onmouseout=\"_page.flyout_hide('"+anItem+"');_page.item_mouseout(this);\">";
					} else {		
						strHTML +=  "		<td id='"+anItem+"' class=\""+set_class + "\" onmouseover=\"_page.item_mouseover(this);\" onmouseout=\"_page.item_mouseout(this);\">";
					}
					// If this item has a link, create it
					if(_page.leftNav[anItem].showlink && !_page.leftNav[anItem].showCategory){
						strHTML +=  "			<a class=\"p-left-level_link_"+current_level+"\" href=\""+_page.leftNav[anItem].link+"\">";
						strHTML +=  "			"+_page.leftNav[anItem].text+"</a>";		
					} else {
						strHTML +=  "			<span class=\"p-left-level_link_"+current_level+"\">"+_page.leftNav[anItem].text+"</span>";		// Item without link
					}
					strHTML +=  "		</td>\n";
					strHTML +=  "	</tr>\n";
					previous_level = current_level; // used to check if dotted seperator is needed
					previous_item = anItem; 		// used to check if solid seperator need to be shown
				}
			}
			if(_page.sectionMain[0] && _page.sectionMain[1] && _page.sectionSpecial[0]) {
				strHTML +=  "	<tr>\n";
				strHTML +=  "		<td class=\"p-left_specialsection\" onmouseover=\"_page.item_mouseover(this);\" onmouseout=\"_page.item_mouseout(this);\"><a class=\"p-left-level_link_1\" href=\""+_page.sectionMain[1]+"\">"+_page.sectionMain[0]+"</a></td>\n";
				strHTML +=  "	</tr>\n";
			}
			strHTML +=  "	<tr>\n";
			strHTML +=  "		<td class=\"p-left-bottom\">&nbsp;</td>\n";
			strHTML +=  "	</tr>\n";
			strHTML +=  "</table>\n";
			//Write all items of flyout menu
			strHTML+="<div id=\"flyoutitems\">\n";
			var total_flyout_length=_page.flyoutarray.length;
			for(nr=0;nr<total_flyout_length;nr++){
				strHTML+=_page.flyoutarray[nr];
			}
			strHTML+="</div>\n";
		} else {
			strHTML+="&nbsp;\n";
		}
		// Write left navigation to screen
		if(_page.leftNavOnload) {
			// Replace
			var objLeftNav = gE("p-leftnav-container");
			if(objLeftNav) {
				objLeftNav.innerHTML = '' // MAC IE compat.
				objLeftNav.innerHTML = strHTML
			}
		} else {
			// Write direclty
			_page.write(strHTML,false);
		}
	};
	
	// This function generates a flyout layer for the current item
	_page.flyout_create = function(current_item, flyout_level){
		// Function to create the fly-out items
		var nr_flyout = 1; // Counter for number of items
		var flyoutmenu = "";
		var current_level = getItemLevel(current_item);
		for(anItem2 in _page.leftNav){
			// Loop through all items in array
			// Check if current item ID is included in name and next level
			if(anItem2.indexOf(current_item + "_")==0 && (_page.leftNav[anItem2].level==current_level+1) && _page.leftNav[anItem2].showCategory==false ){
				// Check if second level flyouts need to be generated
				if (_page.leftNav[anItem2].flyout && flyout_level==1 && _page.leftNav[anItem2].children){
					// Temp to store current position and menu
					temp_item = anItem2; 
					temp_flyoutmenu = flyoutmenu;
					temp_nrflyout = nr_flyout;	
					// Generate 2nd level 
					_page.flyout_create(anItem2, 2);
					// Continue current position and menu
					anItem2 = temp_item; 		
					flyoutmenu = temp_flyoutmenu;
					nr_flyout = temp_nrflyout;
					
				}
				// Check if second level flyouts need to be generated
				if(nr_flyout==1){
					// Add first part of table
					var menu_item = "";
					if(flyout_level==1){
						// Style for first level
						flyout_class="p-flyoutdiv";
						menu_item = current_item;
					} else{
						// Style for second level
						flyout_class="p-flyoutdiv-2";
						menu_item = current_item.substring(0,current_item.lastIndexOf("_"));
					}
					// Other style for first left part of item
					left_class = "p-flyout-left-first";
					flyoutmenu = "<div class=\""+flyout_class+"\" id=\"flyout_"+current_item+"\" onmouseover=\"_page.flyout_hide_cancel('"+current_item+"');_page.item_mouseover('"+menu_item+"');\" onmouseout=\"_page.flyout_hide('"+current_item+"');_page.item_mouseout('"+menu_item+"');\">\n";
					flyoutmenu += "	<table id=\"table-flyout\" class=\"p-table_flyout\" cellspacing=\"0\">\n";
					flyoutmenu += "	<tr>\n";
					flyoutmenu += "		<td class=\""+left_class+"\"><div id=\"right_arrow_"+current_item+"\" class=\"p-right_arrow\">&nbsp;</div></td>\n";
					flyoutmenu += "		<td class=\"p-flyout-right\">\n"; 
					flyoutmenu += "			<table cellspacing=\"1\" width=\"100%\">\n"; 
				} else{
					left_class = "p-flyout-left-middle";
				}
				if(_page.leftNav[anItem2].flyout && _page.leftNav[anItem2].children){
					// Add class for flyout
					content_class="p-flyout-content-flyout";
				} else{
					content_class="p-flyout-content";
				}
				// Make sure no hand is shown when no link is available
				if(_page.leftNav[anItem2].showlink==false){
					content_class += " p-nolink";
				}
				flyoutmenu += "		<tr>\n";		
				// Create item with or without flyout
				if (_page.leftNav[anItem2].flyout && flyout_level==1 && _page.leftNav[anItem2].children){
					flyoutmenu += "		<td	id='"+anItem2+"' class=\""+content_class+"\" onmouseover=\"_page.flyout('"+anItem2+"', 2);\" onmouseout=\"_page.flyout_hide('"+anItem2+"')\"";
				} else {	
					flyoutmenu += "		<td	id='"+anItem2+"' class=\""+content_class+"\"";
				}
				// Show item with/without link
				if(_page.leftNav[anItem2].showlink){
					flyoutmenu += " 		><a class=\"p-flyout_link_"+flyout_level+"\" id=\"left_level_link_"+anItem2+"\" href=\""+_page.leftNav[anItem2].link+"\"";
					flyoutmenu += "			>"+replaceAll(_page.leftNav[anItem2].text, '&nbsp;', ' ')+"</a>";
				} else{
					flyoutmenu += "			><span class=\"p-flyout_link_"+flyout_level+"\">"+_page.leftNav[anItem2].text+"</span>";		// Item without link
				}
				flyoutmenu += "			</td>\n";
				flyoutmenu += "		</tr>\n";
				nr_flyout += 1;
				
			}
		}
		flyoutmenu += "				</table>\n";
		flyoutmenu += "			</td>\n";
		flyoutmenu += "		</tr>\n";
		flyoutmenu += "	</table>\n";
		flyoutmenu += "</div>\n\n";
		// If needed for browsertype, create IFRAME to solve select-problem
       	if(useIframe) {
	    	flyoutmenu +="		<IFRAME frameborder=0 id=\"flyout-"+current_item+"-IF\" src=\"javascript:false;\" scroll=none style=\"FILTER:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);visibility:hidden;height:0;position:absolute;width:0px;top:0px;z-index:0\"></iframe>";
    	}
		_page.flyoutarray[flyoutlength++] = flyoutmenu;
	};
	
	_page.flyout_cancel = function(current_item){
		// Cancel timeout for opening new flyout
		clearTimeout(_page.leftNav[current_item].flyoutopenid);
		// Reset id
		_page.leftNav[current_item].flyoutopenid = 0;	
	};
	
	_page.flyout = function(current_item, flyout_level){
		// Cancel possibile hide-action on current_item
		_page.flyout_hide_cancel(current_item);
		// If flyout is not scheduled, schedule it		
		if(_page.leftNav[current_item].flyoutopenid==0){	
			// Wait short moment before flyout opens
			delay = (_page.browser.isMac?250:100);
			_page.leftNav[current_item].flyoutopenid = setTimeout("_page.flyout2('"+current_item+"', "+flyout_level+")", delay);
		}
	};
	
	_page.flyout2 = function(current_item, flyout_level){ 
		// Function to show the fly-out items
		// Hide all flyouts
		for(anItem_flyout in _page.leftNav){
			// Check if flyout is available and this is not the current item
			if(_page.leftNav[anItem_flyout].flyout && _page.leftNav[anItem_flyout].children && current_item!=anItem_flyout){
				// Don't close parent
				if(current_item.indexOf(anItem_flyout)!=0){
					_page.flyout_hide2(anItem_flyout);
				}
			}
		}
		// Lookup flyout item and set postion
		dd = gE("flyout_" + current_item);		
		var obj = gE(current_item);
		var arrow = gE("right_arrow_"+current_item);
		if(flyout_level==1){
			if(_page.direction=="rtl") {
				move_right = -142; 
			} else {
				move_right = 171; 	
			}			
			move_up = 21;
		}
		else{
			if(_page.direction=="rtl") {
				move_right = -142;
			} else {
				move_right = 125;
			}	
			move_up = 21;
		}
		// Flyout x and y positions
		var xPos = getLeftPos(obj)+move_right;
		var yPos = getTopPosBottom(obj)-move_up;
		// Get browser dimensions		
		var scrollPosTop = getScrollPosTop();  				 // Positon top in scrolled browser window
		var screenHeight = getScreenHeight();				// Available height browser window
		var scrollPosBottom = scrollPosTop + screenHeight;	// Positon bottom in scrolled browser window	
		// Flyout dimensions
		var flyoutWidth = dd.offsetWidth;					// Flyout width
		var flyoutHeight = dd.offsetHeight;					// Flyout height
		var flyoutPosTop = findPosY(obj); 					// Top position of flyout
		var flyoutPosBottom = flyoutPosTop + flyoutHeight; 	// Bottom position of flyout
		// Adjust positioning from top or bottom
		var screenAvailable = scrollPosBottom - scrollPosTop;
		var flyoutHeightAvailable = scrollPosBottom - flyoutPosBottom;
		if(flyoutHeightAvailable < 0) {  
			var i = 1;
			var objTopPosBottom = getTopPosBottom(obj);
			var td_item = current_item + "_" + i;
			var objTD = gE(td_item);
			var loop = true;
			while(loop != false) {
				if(objTD != null) {
					// Calculate positions
					flyoutPosBottom = flyoutPosBottom - objTD.offsetHeight-1;
					yPos = flyoutPosBottom - flyoutHeight; 
					// Statements to set the position
					if(flyoutPosBottom < objTopPosBottom) {
						yPos = yPos + (objTopPosBottom - flyoutPosBottom +1);
						loop = false;
					}
					else if(yPos < scrollPosTop) {
						yPos = yPosPrev;
						loop = false;
					} 
					else if(flyoutPosBottom < scrollPosBottom) {
						loop = false;
					}
					yPosPrev = yPos;
					// Get next TD item
					i = i + 1;
					position = td_item.lastIndexOf("_");
					td_item = td_item.substring(0,position) + "_" +i;
					objTD = gE(td_item);
				} else {
					loop = false;
				}
			}			
		}
		// Position Arrow 
		move_up = (flyout_level==1?-1:0);
		position = flyoutPosTop-yPos-move_up;
		if(arrow!=null) sY(arrow, position);
		// Position Flyout and Iframe
		if(useIframe){
			var fframe = gE("flyout-"+current_item+"-IF");
			// Initiate iframe behind flyout
			sH(fframe, flyoutHeight);
			sW(fframe, flyoutWidth);
			sX(fframe, xPos);
			sY(fframe, yPos);
			sE(fframe);
		}		
		sX(dd, xPos);
		sY(dd, yPos);
		sE(dd);	
		if(arrow!=null) sE(arrow);
	};
	
	_page.flyout_hide_cancel = function(current_item){
		// Cancel timeout for hiding
		clearTimeout(_page.leftNav[current_item].flyoutid);
		// Reset id
		_page.leftNav[current_item].flyoutid=0;
		if(_page.leftNav[current_item].level>1){
			// Only cancel timeout for parent if item is not first level
			clearTimeout(_page.leftNav[_page.leftNav[current_item].parentid].flyoutid);
			// Reset id
			_page.leftNav[_page.leftNav[current_item].parentid].flyoutid=0;
		}
	};
	
	_page.flyout_hide = function(current_item){
		// Cancel direct the opening of the flyout
		_page.flyout_cancel(current_item);
		// Set interval before removing flyout
		if(_page.leftNav[current_item].flyoutid==0){
			_page.leftNav[current_item].flyoutid = setTimeout("_page.flyout_hide2('"+current_item+"')", 100);
		}
		if(_page.leftNav[current_item].level>1){
			// Only check parent if item is not first level
			if(_page.leftNav[_page.leftNav[current_item].parentid].flyout){
				// Check if parentis also flyout
				if(_page.leftNav[_page.leftNav[current_item].parentid].flyoutid==0){
					// Set interval before removing parent flyout
					_page.leftNav[_page.leftNav[current_item].parentid].flyoutid = setTimeout("_page.flyout_hide2('"+_page.leftNav[current_item].parentid+"')", 1000);
				}
			}
		}
	};
	
	_page.flyout_hide2 = function(current_item){
		// Hide flyout
		dd = gE("flyout_" + current_item);
		if(dd)hE(dd);
		if (useIframe) {
	  		var fframe = gE("flyout-"+current_item+"-IF");
	  		if(fframe)hE(fframe);
		}
		// reset id
		_page.leftNav[current_item].flyoutid=0;
	};
	
	// Left navigation mouse over item
	_page.item_mouseover = function(el) {
		if(typeof(el)=="string") el = gE(el);
		if(el) {
			var strStyle = getStyle(el);
			if(strStyle.indexOf("active")==-1 && strStyle.indexOf("category")==-1 && strStyle.indexOf("1_open")==-1) {
				var strCurStyle = getStyle(el);
				var strNewStyle = strCurStyle + " p-left_hover";
				applyStyle(el,strNewStyle );
			}	
		}		
	}
	
	// Left navigation mouse out item
	_page.item_mouseout = function(el) {
		if(typeof(el)=="string") el = gE(el);
		if(el) {
			var strStyle = getStyle(el);
			if(strStyle.indexOf("active")==-1 && strStyle.indexOf("category")==-1 && strStyle.indexOf("hover")>-1) {
				var strNewStyle = strStyle.substring(0,strStyle.indexOf(" "));
				applyStyle(el,strNewStyle);
			}
		}		
	}
		
	_page.email = function(posturl) {
		try{strURL = encodeURI(document.location);}catch(e){strURL = escape(document.location)}
		window.location='mailto:?subject='+escape(document.title)+'&body=Please see '+strURL;
	};
	
	_page.printVersion = function(print_type) {
		var printarea = document.getElementById("p-printarea");
		if (printarea == null) {
			alert("no print area defined");
			return;
		}	
		// Create privacy footer
		var crsc = _page.crsc_server;
		var privacy_footer = _page.text["footer"];
		privacy_footer = privacy_footer.replace("{BR}", "<br />");
		privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
		privacy_footer = privacy_footer.replace("{PRIVACY}", "<a href=\""+_page.link["privacy"]+"\">"+_page.text["privacy"]+"</a>");
		privacy_footer = privacy_footer.replace("{OWNER}", "<a href=\""+_page.link["owner"]+"\">"+_page.text["owner"]+"</a>");
		privacy_footer = privacy_footer.replace("{TERMS}", "<a href=\""+_page.link["terms"]+"\">"+_page.text["terms"]+"</a>");
		privacy_footer = privacy_footer.replace("| {SITEMAP}", "");
		privacy_footer = privacy_footer.replace("{CAREERS} | ","");
		var print_body = '';
		print_body += '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\n';
		print_body += '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n';
		print_body += '<html xmlns="http://www.w3.org/1999/xhtml">\n';
		print_body += '<head>\n';
		print_body += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n';
		if(_page.headerType == "external_extranet") {
			// No global stylesheet when using external extranet
			var stylesheet_externalextranet = "	<link rel=\"stylesheet\" type=\"text/css\" href=\"css/external_extranet.css\" />\n";
			print_body += stylesheet_externalextranet;
		} else {
			//print_body += '  <link href="'+_page.crsc_server + '/crsc/styles/global.css" type="text/css" rel="stylesheet" />\n';
		}
		print_body += '  <link href="'+_page.crsc_server + '/crsc/styles/components.css" type="text/css" rel="stylesheet" />\n';
		print_body += '  <link href="'+_page.crsc_server + '/crsc/styles/print.css" type="text/css" rel="stylesheet" />\n';
		if(_page.direction=="rtl"){
			print_body += '  <link href="'+_page.crsc_server + '/crsc/styles/rtl.css" type="text/css" rel="stylesheet" />\n';
		}
		print_body += '  <link media="print" href="'+_page.crsc_server + '/crsc/styles/printbrowser.css" type="text/css" rel="stylesheet" />\n';
		// Adjust styles of some locales
		if(_page.locale) {
			if(_page.locale.substring(3,5)=="zh" || _page.locale.substring(3,5)=="ja" || _page.locale.substring(3,5)=="ko"){
				// Add extra stylesheet for Chinese and Japanese and Korean locales
				print_body += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/zh_ja.css\" />\n";
			}
			else if(_page.locale.substring(3,5)=="th"){
				// Add extra stylesheet for Thai locales
				print_body += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/th.css\" />\n";
			}
			else if(_page.locale.substring(3,5)=="ru"){
				// Add extra stylesheet for russian locales
				print_body += "<link rel=\"stylesheet\" type=\"text/css\" href=\"css/ru.css\" />\n";
			}
		}	
		print_body += '	<title>'+document.title+'</title>';
		print_body += '</head>\n';
		print_body += '<body style="direction:'+_page.direction+'" onload="setTimeout(\'window.print()\', 1000);setTimeout(\'window.close()\', 5000);">\n';
		print_body += '	<div class="p-printcontainer">\n';
		print_body += '  	<div class="p-print-logo"><img alt="Philips" src="images/mainlogo.gif" /></div>\n';
		if(print_type=='press'){
			print_body += '  	<div class="p-print-press"><img alt="Press information" src="'+_page.crsc_server + '/crsc/images/pressrelease_header.gif" /></div>\n';
		} else {
			print_body += '  	<div class="p-line"><img alt="" src="images/solidline.gif" /></div>\n';
		}
		print_body += '  	<div id="p-grid-c">'+printarea.innerHTML+'</div>\n';
		print_body += '  	<div class="p-line"><img alt="" src="images/solidline.gif" /></div>\n';
		print_body += '  	<div class="p-print-footer">\n';
		print_body += '  	  ' + privacy_footer +'\n';
		print_body += '		</div>\n';
		print_body += '	</div>\n';
		print_body += '</body></html>\n';
		// Create popup window
		var wHeight=500;
		var wWidth=700;
		var w=window.open('','','height='+wHeight+',width='+wWidth+',toolbar=yes,scrollbars=yes')
		// Center popup window
		var sWidth = parseInt(gsW());
		var sHeight = parseInt(gsH());
		if( sWidth>0&&sHeight>0 ){w.moveTo(Math.round((sWidth-wWidth)/2),Math.round((sHeight-wHeight)/2))};
		if( w.focus ) { w.focus(); }
		w.document.open();
		w.document.write(print_body);
		w.document.close();
	};
	
	_page.showPopup = function(url) {
		var wHeight=_page.popupHeight;
		var wWidth=_page.popupWidth;
		var w=window.open(url,'_blank','height='+wHeight+',width='+wWidth+',toolbar=no,scrollbars=yes,resizable=yes')
		return false;
	};
	
	resizePopup = function() {
		var w = window;
		// Get popup container div
		var oD = w.document.getElementById('p-inner-containertd'); if( !oD ) { return false; }
		// Get offset dimensions popup
		var oW = goW(oD);
		var oH = goH(oD); if( !oH ) { return false; }
		if(!_page.popupAutoFitWindowToContent)	{
			// Manual resize
			oW = _page.popupWidth;
			oH = _page.popupHeight;
			w.resizeTo(oW, oH);
		} 
		else if(_page.popupAutoFitWindowToContent) {
			// Auto resize
			// Resize popup use 200 width/height extra to force unknown scrollbars
			w.resizeTo( oW + 200, oH + 200 );
			// Get inside dimensions
			var myW = 0, myH = 0;
			myW = getScreenWidth()
			myH = getScreenHeight();
			if(window.opera && !document.childNodes) { myW -= 16; }
			// Resize popup / substract the 200 width/height
			w.resizeTo( oW + ( ( oW + 200 ) - myW), oH + ( (oH + 200 ) - myH) );
		}
		// Center popup
		w.moveTo(Math.round((gsW()-oW)/2),Math.round((gsH()-oH)/2));
		if( w.focus ) { w.focus(); }
	};
	
	_page.writePopupHeader = function() {
		_page.headerType = "popup";
		var strHTML = "";
		strHTML+='<link href="'+_page.crsc_server + '/crsc/styles/popup.css" type="text/css" rel="stylesheet" />\n';
		strHTML+='	<table cellspacing="0" cellpadding="0" id="p-container">\n';
		strHTML+='		<tr>\n';
		strHTML+='			<td id="p-containertd">\n';
		strHTML+='				<table  cellspacing="0" cellpadding="0" id="p-inner-container">\n';
		strHTML+='					<tr>\n';
		strHTML+='						<td id="p-inner-containertd">\n';
		strHTML+='							<table cellspacing="0" cellpadding="0" id="p-popup-container">\n';
		if(!_page.popupHideHeader) {
			strHTML+='							<tr>\n';		
			strHTML+='								<td id="p-popup-header">\n';		
			strHTML+='									<img alt="Philips" src="'+_page.crsc_server + '/crsc/images/mainlogo.gif" />\n';
			strHTML+='								</td>\n';		
			strHTML+='							</tr>\n';		
		}
		strHTML+='								<tr>\n';		
		strHTML+='									<td id="p-popup-body">\n';	
		_page.write(strHTML,false);
		if(_page.activateActiveX) includeActiveXFix();
	};
	
	_page.writePopupFooter = function() {
		var privacy_footer = _page.text["footer"];
		privacy_footer = privacy_footer.replace("{OWNER} | {PRIVACY} | {TERMS} | {SITEMAP}{BR}", "");
		privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
		privacy_footer = privacy_footer.replace("{CAREERS} | ","");
		var strHTML = "";
		strHTML+='									</td>';
		strHTML+='								</tr>';
		if(!_page.popupHideFooter) {
			strHTML+='							<tr>\n';		
			strHTML+='								<td id="p-popup-footer">\n';		
			strHTML+=									privacy_footer+'\n';
			strHTML+='								</td>\n';		
			strHTML+='							</tr>\n';		
		}
		strHTML+='							</td>';
		strHTML+='						</tr>';
		strHTML+='					</table>';
		strHTML+='				</table>';
		strHTML+='			</td>';
		strHTML+='		</tr>';
		strHTML+='	</table>';
		_page.write(strHTML,false);
		addOnLoadEvent(resizePopup);	// Fit window to content
		onloadHandler();
	};
	
	// Function to create cookie
	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		} else { 
			var expires = "";
		}	
		// document.cookie = name+"="+value+expires+"; path=/;domain=philips.com";
		document.cookie = name+"="+value+expires+"; path=/";
	};	

	// Function to read cookie
	function readCookie(name)	{
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++)	{
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length); // Remove spaces in front of cookie name
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	};

	// Function to erase cookie
	function eraseCookie(name)	{
		createCookie(name,"",-1);
	}

	// Function which replaces the current sectionBanner
	function replaceSectionBanner(useFlash,tmpSection){
		var crsc = _page.crsc_server;
		var showImage = true;
		var objSection = document.getElementById("p-sectionbanner");
		if(objSection) {
			if(useFlash) {
				// Call flash detection function if needed
				if(typeof(_page.browser.flashInstalled)=="undefined") {
					FlashDetect();
				}
				// Flash installed and version 6 or higher
				if(_page.browser.flashInstalled == 2 && (parseInt(_page.browser.flashVersion) >= 6)) {		
					var flashFileName = "";
					var flashPre = "section_banner";					
					var flashExt = ".swf";
					var curLocale = _page.locale;
					var flashDynamic = true;
					bannerDynamic = new Array();
					// consumer
					bannerDynamic["consumer_us_en"] = "section_banner_consumer_us";
					bannerDynamic["consumer_de_de"] = "section_banner_consumer_de_nl_uk";
					bannerDynamic["consumer_nl_nl"] = "section_banner_consumer_de_nl_uk";
					bannerDynamic["consumer_uk_en"] = "section_banner_consumer_de_nl_uk";
					// medical
					bannerDynamic["medical_it_it"] = "section_banner_medical_it";
					// all sections russian
					bannerDynamic[tmpSection+"_ua_ru"] = "section_banner_"+tmpSection+"_ru_ru";
					// asian english
					bannerDynamic["about_cn_en"] = "section_banner_about_asia";
					bannerDynamic["about_hk_en"] = "section_banner_about_asia";
					bannerDynamic["about_in_en"] = "section_banner_about_asia";
					bannerDynamic["about_my_en"] = "section_banner_about_asia";
					bannerDynamic["about_ph_en"] = "section_banner_about_asia";
					bannerDynamic["about_pk_en"] = "section_banner_about_asia";
					bannerDynamic["about_sg_en"] = "section_banner_about_asia";
					// fifa banner for all locales
					bannerDynamic["fifa_"+curLocale] = "section_banner_fifa_"+curLocale;
					bannerStatic = new Array("pl_pl","cz_cs","ro_ro","sk_sk","tr_tr","cn_zh","hk_zh","tw_zh","gr_el","ru_ru","kr_ko","th_th","jp_ja","il_he","bg_bg","hu_hu");
						// Returns static filename
						function chkBannerStatic(curLocale) {
						var flashFileName = "";
							for(i=0;i<bannerStatic.length;i++) {
								if(bannerStatic[i] == curLocale) {
									flashFileName = flashPre + "_" + tmpSection + "_" + curLocale + flashExt;
									return "true";
								}
							}
							return "false";
						}
					// Get filename				
					if(bannerDynamic[tmpSection+"_"+curLocale]){
						// Dynamic exception
						flashFileName = bannerDynamic[tmpSection+"_"+curLocale] + flashExt;
						flashDynamic = true;
					}else{
						// Specialized Business exceptions
						if(tmpSection == "streamium_consumer"  || tmpSection == "cineos_consumer" || tmpSection == "modea_consumer") {
							// Static
							flashFileName = flashPre + "_" + tmpSection + flashExt;
							flashDynamic = false;
						}
						// Normal flash sectionbanners
						else if(chkBannerStatic(curLocale) == "true"){
							// Static
							flashFileName = flashPre + "_" + tmpSection + "_" + curLocale + flashExt;
							flashDynamic = false;
						}else{
							// Dynamic
							flashFileName = flashPre + "_" + tmpSection + flashExt;
							flashDynamic = true;
						}
					}
					// Attach parameters to flash object if dynamic flash
					var tmpTargetVal = "sectionText1";
					var tmpReplaceVal = _page.text['sectionbanner_'+tmpSection];
					try{tmpReplaceVal=encodeURI(tmpReplaceVal);}catch(e){tmpReplaceVal=escape(tmpReplaceVal)}
					if(flashDynamic) flashFileName += "?"+tmpTargetVal+"="+tmpReplaceVal;
					// Set flashbanner HTML
					var flashHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+(window.location.protocol=="https:"?"https":"http:")+'//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="770" height="47" align="middle" id="flashSectionBanner">'; // CHECK
					flashHTML += '<param name="allowScriptAccess" value="sameDomain" />';
					flashHTML += '<param name="movie" value="'+_page.crsc_server+'/crsc/images/'+flashFileName+'" />';
					flashHTML += '<param name="quality" value="high" />';
					flashHTML += '<param name="scale" value="noscale" />';
					flashHTML += '<param name="salign" value="lt" />';
					flashHTML += '<param name="bgcolor" value="#ffffff" />';
					flashHTML += '<param name="wmode" value="opaque" />';
					flashHTML += '<embed swliveconnect="true" name="flashSectionBanner" src="'+_page.crsc_server+'/crsc/images/'+flashFileName+'" quality="high" bgcolor="#ffffff" width="770" height="47" align="middle"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="opaque" />';
					flashHTML += '</object>';
					// Get current sectionbanner HTML 
					var sectionBannerHTML = objSection.innerHTML;
					// Replace image by flash sectiobanner
					objSection.innerHTML = "";
					objSection.innerHTML = flashHTML;
				}
			}
			if(showImage) sE(objSection);
		}
	};
	
	// Function which iniates replace of sectionbanner depending on cookie
	function initSectionBanner() {
		var shFlashBanner = false;
		var cookieName = "flashbanner";
		var tmpSection = currSection.toLowerCase();	// Define tmp section
		if(_page.hideFlashSectionBanner == false) {
			if ((tmpSection == "about" || tmpSection == "consumer" || tmpSection == "medical"  || tmpSection == "lighting"  || tmpSection == "fifa" || _page.showSBFlashSectionBanner!="") 
			&& (_page.locale!="cn_en" && _page.locale!="cn_zh")		// disabled for china
			&& (!_page.browser.isOpera)){									// disabled for opera browsers e.g. 8.0 causes error; object error detection not possible
				// Allow specialized business flash banner
				if(_page.showSBFlashSectionBanner!="") tmpSection = _page.showSBFlashSectionBanner; 
				// Check if section is search, based on url's
				var otherSection = new Array();
				var urlLocation = "";
				// Use error handling to prevent security issues within winxp IE6.
				try {
					urlLocation = escape(window.location);
				} catch(e) {
				}
				otherSection["www.search.philips.com"] = "search";
				otherSection["www.consumer.philips.com/consumer/search"] = "search";
				for (var url in otherSection) {
					if(urlLocation.indexOf(url) != -1) {
					tmpSection = "search";
					break;
					}
			  	}			
				// Get cookie
				var tmpLocale = _page.locale;
				var cookieVal = readCookie(cookieName);
				if(cookieVal) {
					var subCookieExists = false;
					var cookieArray = cookieVal.split("--");
					// Check for each value in cookie, if section/locale combination exists
					for(i=0;i<cookieArray.length;i++) {
						var subArray = cookieArray[i].split("||");
						var subSection = (typeof(subArray[0])!="undefined"?subArray[0]:"");
						var subLocale = (typeof(subArray[1])!="undefined"?subArray[1]:"");
						if(subSection.indexOf(tmpSection) != -1 && subLocale.indexOf(tmpLocale) != -1) {
							subCookieExists = true;
						} 
					}
					// Append section/locale to cookie
					if(subCookieExists == false) {
						createCookie(cookieName,cookieVal+="--"+tmpSection+"||"+tmpLocale)
						shFlashBanner = true;
					}
				} else {
					// Set cookie(section/locale) and show flashbanner
					createCookie(cookieName,tmpSection+"||"+tmpLocale)
					shFlashBanner = true;
				}
			}
		}	
		replaceSectionBanner(shFlashBanner,tmpSection);	
	};
	
	// Function which checks the cases
	_page.checkSpecialCase = function() {
		// Initialize 
		var strMapping = _page.text["case_mapping"];
		if(strMapping != " " && strMapping != "") {
			// Set mappings if available
			var strSep1 = "&amp;&amp;";
			var strSep2 = ",";	
			_page.arrCaseMapping = strMapping.split(strSep1);
			for(var i=0;i<_page.arrCaseMapping.length;i++) {
				var position = _page.arrCaseMapping[i].indexOf(strSep2);
				_page.arrLCase[i] = _page.arrCaseMapping[i].substring(0,position);
				_page.arrUCase[i] = _page.arrCaseMapping[i].substring(position+1,_page.arrCaseMapping[i].length);
			}				
			// Check for all affected objects
			arrParentClass = new Array();
			arrParentClass["H4"] = new Array();
			arrParentClass["H4"]["p-header"] = new Array();
			arrParentClass["H4"]["p-header"]["p-form"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-payment"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-approval"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-approval-support"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-comparison"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-product-related"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-table"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-404"] = "ucase";
			arrParentClass["H4"]["p-header"]["p-contact-category"] = "ucase";
			for(strClassName in arrParentClass) {
				var arrObjReplace = document.getElementsByTagName(strClassName);
				for(var i=0;i < arrObjReplace.length;i++){
					var arrTmpClass = arrParentClass[strClassName];
					var strAction = getSpecialCaseAction(arrObjReplace[i],arrTmpClass);
					if(strAction!="") {
						replaceSpecialCase(arrObjReplace[i],strAction,"innerHTML");
					}
				}	
			}
		}
	}
		
	getSpecialCaseAction = function(objCompare, arrTmpClass) {
		// Current object
		var strStyleCur = "";
		var strAction = (typeof arrTmpClass == "string"?arrTmpClass:"");
		// Get parent objects
		while (objCompare.offsetParent && strAction=="") {
			objCompare = objCompare.offsetParent;
			strStyleCur = getStyle(objCompare);
			if(arrTmpClass[strStyleCur]) {
				if(typeof arrTmpClass[strStyleCur] == "string") {
					strAction = arrTmpClass[strStyleCur];
				} else {
					arrTmpClass = arrTmpClass[strStyleCur];	
				}
			}			
		}
		return strAction;
	}
	
	// Function which replaces exceptions on upper- and lowercasing
	replaceSpecialCase = function(sObject, sMethod, sAttribute) {
		if(sObject) {
			var strTmpValue = sObject[sAttribute];
			bContinue = true;
			// Catch unsupported encodeURI error's, like Win IE 5.0 / Mac IE 5+
			try { encodeURI(""); } catch(e) { bContinue = false; };
			if(bContinue) {			
				// Replace values
				strTmpValue = encodeURI(strTmpValue);
				for(var i=0;i<_page.arrLCase.length;i++) {
					// Set type switch
					switch(sMethod){
					case "ucase":
						strTarget = _page.arrLCase[i];
						strSource = _page.arrUCase[i];
						break;
					case "lcase":
						strTarget = _page.arrUCase[i];
						strSource = _page.arrLCase[i];					
						break;
					}
					strTarget = eval("/"+strTarget+"/g");
					strTmpValue = strTmpValue.replace(strTarget,strSource);
				}
				strTmpValue = decodeURI(strTmpValue);
			}
			switch(sMethod){	
			case "ucase":
				strTmpValue = strTmpValue.toUpperCase();
				break;
			case "lcase":
				strTmpValue = strTmpValue.toLowerCase();
				break;
			}
			sObject[sAttribute] = strTmpValue;
		}
	};
		
	// Function which set's active tab
	_page.showTab = function (intTable,intRow){	
		// Get table objects
		var tmpTableTop = gE("table_top"+intTable);
		var tmpTableContent = gE("table_content"+intTable);
		var rowsLength = gE("table_content"+intTable).rows.length;
		for(i=0;i<rowsLength;i=i+2){
			if(i==intRow){	
				//Display the tab as active.
				applyStyle(gE("headermain"+intTable+"_"+i),"p-tab-active");
				// Get selected boy node and duplicate it
				var tmpRowTop = tmpTableTop.rows[1];
				var tmpRowContent = gE("body"+intTable+"_"+(intRow+1));
				var tmpCellContentNew = tmpRowContent.firstChild;
				var tmpCellContentDup = tmpCellContentNew.cloneNode(true);
				applyStyle(tmpCellContentDup,"p-content");
				// Add extra cell and delete previous one
				tmpTableTop.rows[1].appendChild(tmpCellContentDup);
				tmpTableTop.rows[1].deleteCell(0);
				// Copy extra cell into new row
				var tmpRow = tmpRowTop.cloneNode(true);
				tmpRowTop.parentNode.insertBefore(tmpRow,tmpRowTop);
				tmpTableTop.deleteRow(1);
			}else{
				applyStyle(gE("headermain"+intTable+"_"+i),"p-tab-inactive");			
			}
		}
	};
 
 	// Function which creates tabbed tables
	_page.createTabs = function(intTableCount , tmpTableObj){
		var maxHeight = 0;
		var strTableType = tmpTableObj.type;
		// Set content table style to hidden or nodisply
		tmpTableObj.cellSpacing = 0;
		tmpTableObj.cellPadding = 0;
		applyStyle(tmpTableObj,(strTableType == "p-tab-double"?"p-tabbedtable-hidden":"p-tabbedtable-nodisplay"));	
		// Create Main Table
		var tmpTable = document.createElement("table");
		var tmpBody = document.createElement("tbody");
		var tmpRow = document.createElement("tr");
		var tmpCell = document.createElement("td");
		tmpTable.id = "table_top"+intTableCount;
		applyStyle(tmpTable,(strTableType == "p-tab-double"?"p-extrainfo-double":"p-extrainfo-multiple"));
		tmpTable.cellSpacing = 0;
		tmpTable.cellPadding = 0;
		tmpCell.className = "p-top";
		tmpTableObj.parentNode.insertBefore(tmpTable,tmpTableObj);
		tmpTable.appendChild(tmpBody);
		tmpBody.appendChild(tmpRow);
		tmpRow.appendChild(tmpCell);		
		//Process all rows and display the tabs
		maxRows = tmpTableObj.rows.length;
		intRow = 0;
		for(i=0;i<maxRows;i++) {
			curRow = tmpTableObj.rows[i];
			// Only process child rows, no nested table/rows (Opera compat. issue)
			if(curRow.parentNode.parentNode.id == tmpTableObj.id) {
			curRow.id = "body"+intTableCount+"_"+intRow;
				//Header row
				if(Math.round(intRow/2)==intRow/2){
					// Tab Header left
					var tmpDiv = document.createElement("div");
					applyStyle(tmpDiv,"p-tab-border-left");
					tmpDiv.id="headerleft"+intTableCount+"_"+intRow;
					tmpCell.appendChild(tmpDiv);					
					// Tab Header body
					var tmpDiv = document.createElement("div");
					applyStyle(tmpDiv,"p-tab-inactive");
					tmpDiv.id="headermain"+intTableCount+"_"+intRow;
					eval('tmpDiv.onclick = function() {_page.showTab('+intTableCount+','+intRow+')};');
					tmpCell.appendChild(tmpDiv);
					//Create a new text object in the cell object.
					var tmpText = document.createTextNode(ReplaceTags(curRow.firstChild.innerHTML));
					tmpDiv.appendChild(tmpText);
					// Tab Header right
					var tmpDiv = document.createElement("div");
					applyStyle(tmpDiv,"p-tab-border-right");
					tmpDiv.id="headerright"+intTableCount+"_"+intRow;
					tmpCell.appendChild(tmpDiv);
					// Tab spacer, only visibile between tabs
					if(tmpTableObj.rows[i+2]!=null) {
						var tmpDiv = document.createElement("div");
						applyStyle(tmpDiv,"p-tab-spacer");
						tmpCell.appendChild(tmpDiv);
					}	
				} else {
					// Get heighest tab
					if(strTableType=="p-tab-double") {
						var curHeight = curRow.firstChild.offsetHeight;
						maxHeight = (curHeight>maxHeight?curHeight:maxHeight);
					}	
				}
				intRow++;
			} else {
				maxRows++;
			}
		}
		// Create body row
		var tmpRowBody = document.createElement("tr");
		var tmpCellBody = document.createElement("td");
		tmpBody.appendChild(tmpRowBody);
		tmpRowBody.appendChild(tmpCellBody);
		if(strTableType=="p-tab-double") {
			// Create bottom, only in double tabbed table
			var tmpRowBottom = document.createElement("tr");
			var tmpCellBottom = document.createElement("td");
			applyStyle(tmpCellBottom,"p-bottom");
			tmpBody.appendChild(tmpRowBottom);
			tmpRowBottom.appendChild(tmpCellBottom);
			// Create footer table in cell bottom
			var tmpTableFooter = document.createElement("table");
			var tmpBodyFooter = document.createElement("tbody");
			var tmpRowFooter = document.createElement("tr");
			tmpTableFooter.cellSpacing = "0";
			tmpTableFooter.cellPadding = "0";
			tmpCellBottom.appendChild(tmpTableFooter);
			tmpTableFooter.appendChild(tmpBodyFooter);
			tmpBodyFooter.appendChild(tmpRowFooter);
			// Left footer cell
			var tmpCellFooter = document.createElement("td");
			applyStyle(tmpCellFooter,"p-bottom-left");
			tmpRowFooter.appendChild(tmpCellFooter);
			// Right footer cell
			var tmpCellFooter = document.createElement("td");
			applyStyle(tmpCellFooter,"p-bottom-right");
			tmpRowFooter.appendChild(tmpCellFooter);
			//Set max height to each body row
			intRow = 0;
			for(z=0;z<tmpTableObj.rows.length;z++) {
				curRow = tmpTableObj.rows[z];
				sH(curRow.firstChild,maxHeight+6);
			}
			//Set content table back top display: none
			applyStyle(tmpTableObj,"p-tabbedtable-nodisplay");
		}	
	};	
 
	function processTables(){	
		// Process tables
		allTables=document.getElementsByTagName("table");
		for(k=0;k<allTables.length;k++){
			if(getStyle(allTables[k]) == "p-tab-multiple" || getStyle(allTables[k]) == "p-tab-double") {
				allTables[k].type = getStyle(allTables[k]);
				allTables[k].id="table_content"+(intTableCount+1);
				tabTables[intTableCount] = allTables[k];
				intTableCount++;
			}
		}
		intTableCount=0;
		for(j=0;j<tabTables.length;j++){
			//Create a handle to the table.
			tmpTableObj=tabTables[j];
			//Increase the table counter.
			intTableCount++;
			//Create the tabs for all tabbed tables.
			_page.createTabs(intTableCount, tmpTableObj);
			// Set active tab
			maxRows = tmpTableObj.rows.length;
			intRow = 0;
			var bActivated = false;
			for(i=0;i<maxRows;i++) {
			curRow = tmpTableObj.rows[i];
				// Only process child rows, no nested table/rows (Opera compat. issue)
				if(curRow.parentNode.parentNode.id == tmpTableObj.id) {
					if(getStyle(curRow) == "active") {_page.showTab(intTableCount,intRow);bActivated = true}
					intRow++;
				} else {
					maxRows++;
				}
			}
			if(bActivated == false) _page.showTab(intTableCount,0);
		}
	};
	
	// Add onload event
	function addOnLoadEvent(fn) {
		arrLoad[arrLoad.length] = fn;
	};
	
	// Add DOM onload event fired by end of footer
	function addDOMOnLoadEvent(fn) {
		arrDOMLoad[arrDOMLoad.length] = fn;
	};
	
	// Generic onload handler
	function onloadHandler() {
		// Do DOM onload event requests
		for(var k=0;k<arrDOMLoad.length;k++) {
			try{arrDOMLoad[k]()}catch(err){};
		}
		// Load all arrays
		function doLoad(evt) {
			for(var k=0;k<arrLoad.length;k++) {
				try{arrLoad[k]()}catch(err){};
			}
		}
		//Setup onload function
		if(typeof window.addEventListener != 'undefined') {
				//.. gecko, safari, konqueror and standard
				window.addEventListener('load', function(){}, false); // Dummy function inorder to prevent removal of doLoad listner
				window.addEventListener('load', doLoad, false);
		} else if(typeof document.addEventListener != 'undefined') {
				//.. opera 7
				document.addEventListener('load', doLoad, false);
		} else if(typeof window.attachEvent != 'undefined') {
				//.. win/ie
				window.attachEvent('onload', doLoad);
		} else { 
				//.. mac/ie5 and anything else that gets this far
				//if there's an existing onload function
				if(typeof window.onload == 'function') {
					//store it
					var existing = onload;
					//add new onload handler
					window.onload = function() {
						//call existing onload function
						existing();
						//call generic onload function
						doLoad();
					};
				} else {
					//setup onload function
					window.onload = doLoad;
				}
		}
	};
	
	_page.get_fontsize = function() {
		var strCookie = readCookie("Philips-Fontsize");
		if(strCookie!=null) {
			_page.articleCSSFontsizeCurrent = strCookie.substr(strCookie.indexOf("fontsize=")+9,strCookie.length);
			_page.font_resize();
		}
	}
	
	_page.articleCSS = null;
	_page.font_resize = function(intFontsizeMultiplier) {
		// Set new font-size and define CSS rules
		var intFontsize = (_page.articleCSSFontsizeCurrent!=""?_page.articleCSSFontsizeCurrent:_page.articleCSSFontsizeDefault);
		// Only adjust font-size if multiplier has been set
		if(intFontsizeMultiplier) {
			if(intFontsizeMultiplier > 1){
				intFontsize = Math.round(parseInt(intFontsize) * intFontsizeMultiplier)
			} else {
				intFontsize = Math.round(parseInt(intFontsize) / (1+(1-intFontsizeMultiplier)))
			}
		}
		intListItemTop = Math.round((intFontsize / 100 * 0.2)*10)/10 // List item positioning
		var strCSSText =".p-article{font-size:"+intFontsize+"%!important;line-height:160%!important;}.p-article ul li{background-position:0 "+intListItemTop+"em;}";
		_page.articleCSSFontsizeCurrent = intFontsize;
		if(_page.articleCSS == null) {
			// Add new stylesheet
			_page.articleCSS = new _page.stylesheet();
			_page.articleCSS.add(strCSSText);
		} else {
			// Update stylesheet
			_page.articleCSS.update(strCSSText);
		}
	}
		
	// Function which created array with all current browser information
	_page.setBrowserInfo = function () {
		// Flash 
		if(typeof(browser_flashInstalled) == "undefined") {
			FlashDetect();
		}	 
		_page.browserInfo["browser_flash_installed"] = _page.browser.flashInstalled;
		_page.browserInfo["browser_flash_version"] = _page.browser.flashVersion;
		// Philips browser compliancy			
		_page.browserInfo["browser_name"] =_page.browser.name;
		_page.browserInfo["browser_version"] = _page.browser.versionMinor;
		_page.browserInfo["browser_platform"] = _page.browser.platform;
		_page.browserInfo["browser_dhtml"] = _page.browser.isDHTML;
		_page.browserInfo["browser_dom"] = _page.browser.isDOM;
		// Current browser supported
		_page.browserSupport = new Array();
		_page.browserSupport["1"] = [// Philips Supported browsers  / == if equal
										["win32","Internet Explorer",5.5],
										["win32","Internet Explorer",6],
										["win32","Netscape",6.2],
										["win32","Netscape",7],
										["win32","FireFox",1.0],
										["mac","Internet Explorer",5.23],
										["mac","Netscape",6.2],
										["mac","Netscape",7],
										["mac","Netscape",7.1]
									];									
		_page.browserSupport["2"] = [// Philips best-practise browsers  / => if equal or higher
										["win32","Internet Explorer",5],
										["win32","Mozilla",1.6],
										["win32","Opera",7.54],
										["win32","Firefox",0.9],
										["mac","Internet Explorer",5],
										["mac","OmniWeb",563],
										["mac","Firefox",0.9],
										["mac","Safari",1.2],
										["mac","Opera",7.54]
									];
		var intBrowserSupported = 3; // Default not supported (1/2/3)
		var fltMinBrowserVersion = parseFloat(_page.browser.versionMinor);
		intBreak = false;
		for(id in _page.browserSupport) {
			if(intBreak == false) {
				for(intBrowser=0;intBrowser<=(_page.browserSupport[id].length-1);intBrowser++) {
					strBrowserPlatform = _page.browserSupport[id][intBrowser][0];
					strBrowserName = _page.browserSupport[id][intBrowser][1];
					fltBrowserVersion = parseFloat(_page.browserSupport[id][intBrowser][2]);
					// Match platform and browser name
					if((strBrowserName.toLowerCase() == _page.browser.name.toLowerCase()) && (strBrowserPlatform == _page.browser.platform)) { 
						switch (id){
						case "1": 
							// Equal same version 
							if( fltMinBrowserVersion == fltBrowserVersion) {intBrowserSupported = id; intBreak = true}; 
							break;
						case "2":
							// Equal or higher version
							if( fltMinBrowserVersion >= fltBrowserVersion) {intBrowserSupported = id; intBreak = true}; 
							break;
						}
					}
				}
			}	
		}
		_page.browserInfo["browser_supported"] = intBrowserSupported;
	};

	// Print all browser info
	_page.printBrowserInfo = function() {
		var tableHTML = '';
		tableHTML += "<table class=\"p-table\" cellspacing=\"0\">\n";
		tableHTML += "	<tr>\n";
		tableHTML += "		<td class=\"p-header\"><H4>Browser info</H4></td>\n";
		tableHTML += "	</tr>\n";
		tableHTML += "	<tr>\n";
		tableHTML += "		<td class=\"p-content\">\n";
		tableHTML += "			<table cellspacing=\"0\">\n";
		tableHTML += "				<tr class=\"p-bold\">\n";
		tableHTML += "					<td>Id</td>\n";
		tableHTML += "					<td class=\"p-hl\">Value</td>\n";
		tableHTML += "				</tr>\n";
		if(_page.loadBrowserInfo == false) {
				tableHTML += "				<tr><td colspan=\"2\"><i>To retrieve browser info, make sure <b>_page.loadBrowserInfo = true;</b> has been set in the HTML header. </i></td></tr>\n";		
		} else {
			for(id in _page.browserInfo) {
				tableHTML += "				<tr>\n";
				tableHTML += "					<td>"+id+"</td>\n";
				tableHTML += "					<td class=\"p-hl\">"+_page.browserInfo[id]+"</td>\n";
				tableHTML += "				</tr>\n";
			}
		}		
		tableHTML += "			</table>\n";
		tableHTML += "		</td>\n";
		tableHTML += "	</tr>\n";
		tableHTML += "</table>\n";
		document.write(tableHTML);
	};
	
	/*
	*****************************
	****** Helper functions *****
	*****************************
	*/
	// 1k DHTML API - standards version
	d=document;l=d.layers;op=navigator.userAgent.indexOf('Opera')!=-1;px='px';	
	function gE(e,f){if(l){f=(f)?f:self;var V=f.document.layers;if(V){if(V[e])return V[e];for(var W=0;W<V.length;)t=gE(e,V[W++]);return t;}}if(d.getElementById)return d.getElementById(e);if(d.all)return d.all[e];else return null;};
	function sE(e){l?e.visibility='show':e.style.visibility='inherit';};
	function hE(e){l?e.visibility='hide':e.style.visibility='hidden';};
	function dE(e){e.style.display='block';};
	function nE(e){e.style.display='none';};
	function sZ(e,z){l?e.zIndex=z:e.style.zIndex=z;};
	function sX(e,x){l?e.left=x:op?e.style.pixelLeft=x:e.style.left=x+px;};
	function sY(e,y){l?e.top=y:op?e.style.pixelTop=y:e.style.top=y+px;};
	function sW(e,w){l?e.clip.width=w:op?e.style.pixelWidth=w:e.style.width=w+px;};
	function gW(e){if(l){return e.clip.width}else if(op){return e.style.pixelWidth}else{return e.style.width;}};
	function sH(e,h){l?e.clip.height=h:op?e.style.pixelHeight=h:e.style.height=h+px;};
	function sC(e,t,r,b,x){l?(X=e.clip,X.top=t,X.right=r,X.bottom=b,X.left=x):e.style.clip='rect('+t+px+' '+r+px+' '+b+px+' '+x+px+')';};
	function wH(e,h){if(l){Y=e.document;Y.open();Y.write(h);Y.close();}if(e.innerHTML)e.innerHTML=h;};
	// Additions
	function goW(e){return(e.clip?e.clip.width:e.offsetWidth)};
	function goH(e){return(e.clip?e.clip.height:e.offsetHeight)};
	function gsW(){return(screen.availWidth?screen.availWidth:screen.width)};
	function gsH(){return(screen.availHeight?screen.availHeight:screen.height)};
	
	// This function applies the style-class 'className' to the element 'elementId'
	function applyStyle(element, className) {
		if(_page.browser.isIE){
			element.setAttribute("className", className);
		} else {
			element.setAttribute("class", className);
		}
	};
	
	// This function returns the current style of the element
	function getStyle(element) {
		if(_page.browser.isIE){
			return element.getAttribute("className");
		} else {
			return element.getAttribute("class");
		}
	};
	
	function inheritsShowall(menu_item) {
		if(menu_item.level > 1 && _page.leftNav[menu_item.parentid].showAll == true && _page.leftNav[menu_item.parentid].active){
				return true;
		}
		else if (menu_item.level > 2 && (menu_item.level < getItemLevel(_page.leftNavItem)+1) && _page.leftNav[menu_item.parentid].active) {
			return inheritsShowall(_page.leftNav[menu_item.parentid]);
		}
		else return false;
	};

	//This function checks if this item is the sibling of the active item
	function isSibling(menu_item){
		if(_page.leftNavItem==""){
			// No selection
			return false;
		}
		else{
			// Check if current item and active item have the same parent
			if(menu_item.level>1){
				if(menu_item.parentid==_page.leftNav[_page.leftNavItem].parentid){
					return true;
				}
				else{
					return false;
				}
			}
			else{
					// Top level item
					return false;
			}
		}
	};

	// This function determines the level in the left menu of the passed item
	function getItemLevel(menu_item) {
		var counter = 1;
		for(i=0;i<menu_item.length;i++){
			if(menu_item.charAt(i)=="_"){
				counter += 1;
			}
		}
		return counter;
	};
	
	// This function returns the x-pos of 'obj'
	function findPosX(obj) {
		var curleft = 0;
		if(obj != null) {
			if (obj.offsetParent) {			
				while (obj.offsetParent) {
					curleft += obj.offsetLeft;
					obj = obj.offsetParent;
				}
			}
			else if (obj.x) curleft += obj.x;
		}
		return curleft;
	};

	// This function returns the y-pos of 'obj'
	function findPosY(obj) {
		var curtop = 0;
		if(obj != null) {
			if (obj.offsetParent) {
				while (obj.offsetParent) {
					curtop += obj.offsetTop;
					obj = obj.offsetParent;
				}
			}
			else if (obj.y)	curtop += obj.y;
		}
		return curtop;
	};
	
	// Returns top positon in scrolled browser window
	function getScrollPosTop(){
		var pos="";
		if( typeof(self.pageYOffset)!="undefined" ){ pos = self.pageYOffset; }
		else if( document.documentElement && document.documentElement.scrollTop ) { pos = document.documentElement.scrollTop; }
		else if( document.body ) { pos = document.body.scrollTop; }
		return pos;	
	};   
	
	// Returns available height browser window
	function getScreenHeight(){
		var pos="";
		if( typeof(self.innerHeight)!="undefined" ){ pos = self.innerHeight; }
		else if( document.documentElement && document.documentElement.clientHeight ){ pos = document.documentElement.clientHeight; }
		else if ( document.body ){ pos = document.body.clientHeight; }
		return pos;
	};
	
	// Returns available height browser window
	function getScreenWidth(){
		var pos="";
		if( typeof(self.innerWidth)!="undefined" ){ pos = self.innerWidth; }
		else if( document.documentElement && document.documentElement.clientWidth ){ pos = document.documentElement.clientWidth; }
		else if ( document.body ){ pos = document.body.clientWidth; }
		return pos;
	};
	
	// Flash detection
	function FlashDetect() {
		var flashInstalled = 0;			// 0 = not installed, 1 = unknown, 2 = installed 
		var flashVersion = 0;			// Flash version, default 0
		MSDetect = "false";				// MS IE detection, default false
		if (navigator.plugins && navigator.plugins.length)	{
			x = navigator.plugins["Shockwave Flash"];
			if (x)	{
				flashInstalled = 2;
				if (x.description)	{
					y = x.description;
					flashVersion = y.charAt(y.indexOf('.')-1);
				}
			} else {
				flashInstalled = 1;
			}
			if (navigator.plugins["Shockwave Flash 2.0"])	{
				flashInstalled = 2;
				flashVersion = 2;
			}
		} else if (navigator.mimeTypes && navigator.mimeTypes.length)	{
			x = navigator.mimeTypes['application/x-shockwave-flash'];
			if (x && x.enabledPlugin) {
				flashInstalled = 2;
		 	} else {
				flashInstalled = 1;
			}
		} else {
			MSDetect = "true";
		}
		// MS IE detect
		if(MSDetect == "true") {
			for(var i=9; i>0; i--){
				flashVersion = 0;
				try{
					var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
					flashVersion = i;
					flashInstalled = 2;
					break;
				}
				catch(e){
				}
			}
		}
		_page.browser.flashInstalled = flashInstalled;
		_page.browser.flashVersion = flashVersion;
	};
	
	// This function performs an extensive browser detection and stores 
	// all data in an object for later use.		
	function BrowserDetect() {
   		var ua = navigator.userAgent.toLowerCase(); 
   		// browser engine name
   		this.isGecko       = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
		this.isAppleWebKit = (ua.indexOf('applewebkit') != -1);
   		// browser name
   		if(ua.indexOf('opera') != -1) {this.isOpera = true; this.name = "Opera"};
   		if((ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) )) {this.isIE=true; this.name = "Internet Explorer"};
   		if(this.isGecko && ua.indexOf('gecko/') + 14 == ua.length) {this.isMozilla=true; this.name = "Mozilla"};
		if((this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && !this.isOpera && !this.isSafari && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) )) {this.isNS=true; this.name = "Netscape"};
   		if(ua.indexOf('firebird/') != -1) {this.isFirebird=true; this.name = "Firebird"};
		if(ua.indexOf('firefox/') != -1) {this.isFirefox=true; this.name = "FireFox"};
		if(ua.indexOf('safari/') != -1) {this.isSafari=true; this.name = "Safari"};
   		if(ua.indexOf('konqueror') != -1) {this.isKonqueror=true; this.name = "Konqueror"};
		if(ua.indexOf('omniweb') != -1) {this.isOmniweb=true; this.name = "Omniweb"};
		if(ua.indexOf('webtv') != -1) {this.isWebtv=true; this.name = "WebTV"};
		if(ua.indexOf('icab') != -1) {this.isICab=true; this.name = "Icab"};
		if(ua.indexOf('camino') != -1) {this.isCamino=true; this.name = "Camino"};
   		// spoofing and compatible browsers
   		this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   		this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
		// rendering engine versions
   		this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   		this.equivalentMozilla = ( (this.isGecko) ? parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) ) : -1 );
   		// browser version
		this.versionMinor = parseFloat(navigator.appVersion); 
   	   	// correct version number
   		if (this.isGecko && !this.isMozilla) {
			if(this.isFirefox) {
				this.versionMinor = parseFloat(ua.substring(ua.indexOf('firefox/')+8,ua.length));
			} else {
				this.versionMinor = parseFloat( ua.substring( ua.indexOf('/', ua.indexOf('gecko/') + 6) + 1 ) );
			}
   		}
   		else if (this.isMozilla) this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
	   	else if (this.isIE && this.versionMinor >= 4) this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
		else if(this.isSafari) this.versionMinor = parseFloat( ua.substring( ua.indexOf('safari/') + 7) );
		else if(this.isOmniweb) this.versionMinor = parseFloat(ua.substring( ua.indexOf('omniweb/v') + 9));
		else if(this.isOpera && !this.isMac) this.versionMinor = parseFloat(ua.substring( ua.indexOf('opera') + 6));
   		this.versionMajor = parseInt(this.versionMinor); 
   		// dom support 
		this.isDOM = (document.getElementById && document.createElement?true:false);
   		this.isDOM1 = (document.getElementById?true:false);
  		this.isDOM2Event = (document.addEventListener && document.removeEventListener?true:false);
		// dhtml support
		this.isDHTML = (document.getElementById || document.all || document.layers?true:false);
   		// css compatibility mode
   		this.mode = document.compatMode ? document.compatMode : 'BackCompat';
   		// platform
		if(ua.indexOf('win') != -1) {this.isWin=true; this.platform="win"}
		if(this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1)){this.isWin32=true; this.platform = "win32"}
		if(ua.indexOf('mac') != -1){this.isMac=true; this.platform = "mac"}
		if(ua.indexOf('x11') != -1){this.isMac=true; this.platform = "unix"}
		if(ua.indexOf('linux') != -1){this.isMac=true; this.platform = "linux"}
   		// specific browser shortcuts
   		this.isNS6x = (this.isNS && this.versionMajor == 6);
   		this.isNS6up = (this.isNS && this.versionMajor >= 6);
   		this.isNS7x = (this.isNS && this.versionMajor == 7);
   		this.isNS7up = (this.isNS && this.versionMajor >= 7);
   		this.isIE5x = (this.isIE && this.versionMajor == 5);
   		this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   		this.isIE5up = (this.isIE && this.versionMajor >= 5);
   		this.isIE6x = (this.isIE && this.versionMajor == 6);
   		this.isIE6up = (this.isIE && this.versionMajor >= 6);

	};
	
	// Function which removes all tags from string
	function ReplaceTags(xStr){
		var regExp = /<\/?[^>]+>/gi;
        	xStr = xStr.replace(regExp,"");
        	return xStr;
	};		
	
	// This function determines the path to the global CRSC server.
	function get_crsc_server() {
		// Get all script elements in page
		var script_files = document.getElementsByTagName("SCRIPT");
		for(i=0;i<script_files.length;i++){
			//Loop through all script elements
			global_location = script_files[i].src;
			var global_id = global_location.indexOf('/lib_global');
			if(global_id!=-1){
				// Get location for Common Resources
				return global_location.substring(0,global_id);
			}
		}
	};
	
	function getLanguageSwitch(obj) {
		var language_switch = '';
		if(obj){
			if(obj.indexOf("language=")!=-1){
				start_pos = obj.indexOf("language=");
				last_pos = obj.indexOf(",", start_pos);
				if(last_pos==-1){
					// No options left, so take maximum length
					last_pos = obj.length;
				}
				// get language
				language_switch = obj.substr(start_pos+9, last_pos-start_pos-9);
			}				
		}
		return language_switch;	
	}
	
	function replaceAll(streng, soeg, erstat) { 
		var st = streng;
  		if (soeg.length == 0) return st;
  		var idx = st.indexOf(soeg);
  		while (idx >= 0){  st = st.substring(0,idx) + erstat + st.substr(idx+soeg.length);
    		 idx = st.indexOf(soeg);
  		}
	  	return st;
	};

	function trim(s) {
  		// Remove leading spaces and carriage returns
    	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')) {
    		s = s.substring(1,s.length);
		};
	 	// Remove trailing spaces and carriage returns
  		while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')) {
    		s = s.substring(0,s.length-1);
  		}
  		return s;
	};
	
	// This function sorts the leftnavigation menu by id
	_Item_sort = function () {
		_page.sortedArray = new Array();	// Array to sort left menu items
		var length = 0;
		var i = 0;
		for (id in _page.leftNav){
			if (_page.leftNav[id].text) {
				_page.leftNav[id].id = id;
				_page.leftNav[id].ids = id.split("_");
				_page.sortedArray[i] = _page.leftNav[id];
				i++;
			}
		}
		length = i;
		_page.sortedArray.sort(_Item_sort_left_nav);
		_page.leftNav = new Array(length);
		for (i = 0; i < length; i++){
			_page.leftNav[_page.sortedArray[i].id] = _page.sortedArray[i];
		}
	};
		
	_Item_sort_left_nav = function(arg1, arg2){
		var arg1IDs = arg1.ids;
		var arg2IDs = arg2.ids;
		var minLength = (arg1IDs.length <= arg2IDs.length ? arg1IDs.length : arg2IDs.length);
		for (var i = 0; i < minLength; i++){
			if (parseInt(arg1IDs[i]) < parseInt(arg2IDs[i])) return -1;
			if (parseInt(arg1IDs[i]) > parseInt(arg2IDs[i])) return 1;
		}
		if (arg1IDs.length < arg2IDs.length) return -1;
		if (arg1IDs.length > arg2IDs.length) return 1;
		return 0;
	};
	
	// This function sort the locale list
	function SortSelectList(e){
		// Will not work on IE5 on Mac
		if(!(_page.browser.isMac && _page.browser.isIE5x)){
			var n = e.length;
			for (var i=2; i < n; i++){ //Skip first and second item (Choose country/language and Global)
				for (var j=i+1; j < n; j++){
					if (e.options[j].text < e.options[i].text){
						if (_page.browser.isIE){  
							// Swap nodes
							e.options[i].swapNode(e.options[j]);
						}else{
							// Swap values
							sz = e.options[i].text;
							e.options[i].text = e.options[j].text;
							e.options[j].text = sz;
							sz = e.options[i].value;
							e.options[i].value = e.options[j].value;
							e.options[j].value = sz;
						}
				   }
				}
			}
		}
	};
	
	// This functions set the selected locale entry in the localelist
	function setSelectListLocale(locale) {
		// Skip first 2 entries
		for(var i=2;i<document.changelanguage.locale.length;i++) {
			document.changelanguage.locale.options[i].value;
			if(document.changelanguage.locale.options[i].value == locale) document.changelanguage.locale.selectedIndex = i;
		}
	};
	
	// Has element method
	hasElement = function(obj,elem) {
		for(var i=0;i < obj.length;i++)
			if(obj[i]==elem)
				return true;
		return false;
	}
	
	// Function which activates all "disabled" active-x objects within the document due to Microsoft Windows IE patch
	_page.activeXCSS = null;
	function activateActiveX() {
		if(_page.browser.isIE && !_page.browser.isMac) {
			var _nodes = ["embed","object"];
			for (var x = 0; x < _nodes.length; x++) {
				var _tag = _nodes[x];
				var _objects = document.getElementsByTagName(_tag),
				i,j,_object,newObject;
				for (var i = 0; i < _objects.length; i++) {
					_object = _objects[i];
					var _params = '';
					for (var j = 0; j<_object.childNodes.length; j++) {
						var _child = _object.childNodes[j];
						if (_child.tagName == "PARAM") _params += _child.outerHTML;		       
					}
					//The tag with the attributes, the params and it's inner html	
					_object.outerHTML = _object.outerHTML.split(">")[0] + '>' + _params + _object.innerHTML +'</'+_tag.toUpperCase()+'>';
				}
			}	
			_page.activeXCSS.remove() // Show all objects
		}
	}
	
	/* Apply Active-X fix */
	function includeActiveXFix() {
		if(_page.browser.isIE && !_page.browser.isMac) {					// Only IE and not Mac
			_page.activeXCSS = new _page.stylesheet(); 
			_page.activeXCSS.add('object,embed{display:none};') // Hide all objects
			addOnLoadEvent(activateActiveX)
		}
	}
	
	/* Add Stylesheet injection to your site */
	_page.stylesheetArray = [];	// Private array
	// Constructor 
	_page.stylesheet = function(css) {
		this.id = "p-style-injection-"+_page.stylesheetArray.length;
		this.css = css;
		this.index = _page.stylesheetArray.length;
		_page.stylesheetArray[_page.stylesheetArray.length] = this;
	}
	// Methods
	_page.stylesheet.prototype = {
		add:function(css) {
			if(css) this.css = css;
			if(document.createStyleSheet){
				// Create stylesheet if necessary
				if(!this.ref) this.ref = document.createStyleSheet();
				// Update rules in stylesheet
				this.ref.cssText = this.css;
				this.ref.title = this.id;
			} else {					
				// Add new link object to header
				this.ref = document.createElement('link');
				this.ref.id = this.id;
				this.ref.rel = "stylesheet";
				this.ref.type = "text/css";
				this.ref.title = this.id;
				this.ref.href = "data:text/css,"+escape(this.css);
				document.getElementsByTagName("head")[0].appendChild(this.ref);
				this.ref.disabled = false; // Make sure the browser enables the stylesheet
			}
		},
		update:function(css) {
			if(document.createStyleSheet){
				this.remove();
				this.add(css);
			} else {			
				this.ref.id = this.ref.id+"_remove";
				this.add(css);
				// Remove existing link object from header , after 1 second, inorder to prevent flickering css changes
				setTimeout("new function(){_page.stylesheetArray["+this.index+"].remove('"+this.id+"_remove')}",1000);
			}
		},
		remove:function(id) {
			if(document.createStyleSheet){
				// Try to clear the stylesheet
				var intSSRules = this.ref.rules.length;
				while(intSSRules--) 
					this.ref.removeRule(intSSRules);						
			} else {
				// Remove the stylesheet
				var obj = (id?gE(id):this.ref);
				if(obj) obj.parentNode.removeChild(obj);	
			}	
		}
	};
	
	/* ESurvey helper functions */
	_page.eSurvey = {
		include:function() {
			if (document.addEventListener) {
				document.addEventListener("DOMContentLoaded",_page.eSurvey.load, false); // DomContentLoaded used inorder to prevent looping loading requests in the statusbar FF
			} else {
				addOnLoadEvent(_page.eSurvey.load);
			};
		},
		load:function() {
			if(window.location.protocol != "https:" && !isMacIE && _page.loadESurvey == true) {
				var objHead = document.getElementsByTagName('head').item(0);
				var objScript = document.createElement('script');
				objScript.src = "http://invitation.opinionbar.com/popups/p07086_demo/overlay.js";
				objScript.type = 'text/javascript';
				objScript.setAttribute('defer','defer');
				objHead.appendChild(objScript);	
			};
		}
	}
	
	function includeOmniture() {
		if(_page.loadOmniture == true) {
			var protocol = (window.location.protocol=="https:" || window.location.protocol=="http:"?window.location.protocol:"http:"); // only allow http and https
			var omniture = "<scri"+"pt language='JavaScript' type='text/javascript' src='"+protocol+"//www.crsc.philips.com/crsc/scripts/s_code_philipsglobal.js'></scr"+"ipt>";
			document.write(omniture);
		}	
	};
	
	function includeSIFR() {
		/* Available options
		default (no options set) 			// SIFR script and config is loaded only for the locales which are not in the _page.disabledLocalesSIFR array
		_page.loadSIFR = false;			// Doesn't load SIFR script and config files at all
		_page.loadSIFRScript = true; 		// Loads the base SIFR script file for all locales without any respects to the locales
		_page.loadSIFRConfig = false;	// Doesn't load the SIFR config file (for GMM header replacement)
		*/
		var strSIFR = "";
		var strLanguage = _page.locale.split("_")[1];
		var replaceHeader = !hasElement(_page.disabledLocalesSIFR,strLanguage);
		var loadscript = false;
		var loadconfig = false;
		loadscript = (_page.loadSIFR==false?false:replaceHeader);
		if(loadscript || _page.loadSIFRScript) {
			strSIFR += "<scri"+"pt language='JavaScript' type='text/javascript' src='"+_page.crsc_server+"/crsc/scripts/sifr.js'></scr"+"ipt>";
		}
		loadconfig = (loadscript && replaceHeader?true:false);
		if(loadconfig && _page.loadSIFRConfig) {
			strSIFR += "<scri"+"pt language='JavaScript' type='text/javascript' src='"+_page.crsc_server+"/crsc/scripts/sifr-config.js'></scr"+"ipt>";
		}
		document.write(strSIFR);
	};	