  //Global Variable defination for C-level Homepage -
  
  var contLocale;
  var isClevel = false;
  
  //Global Variable defination Ends
  window.name = "main"
    detectFlash();
 window.onunload = leavePage;

 var m_sActiveMenu = '';
        function findPageId(pageName)
	         {
	           var i;
	           var index;
	           var var2;
	           var sValue = '';
			   var tmpPageName = "";
			   var tmpLeftNavLinkName = "";
			   
			   tmpPageName = pageName.toLowerCase();
			
	            for (id in _page.leftNav)
	            {
					tmpLeftNavLinkName = _page.leftNav[id].link.toLowerCase();
					if (tmpPageName == "about/index.page") 
					{
						sValue = "";
						break;
					}	  
					if (tmpLeftNavLinkName.lastIndexOf(tmpPageName)!= -1) 
					{
						sValue = id;
						break;
					}		
				   else if((tmpLeftNavLinkName.substring(0,(tmpLeftNavLinkName.lastIndexOf("/")))).lastIndexOf((tmpPageName.substring(0,(tmpPageName.lastIndexOf("/"))))) != -1)
					{
						sValue = id;
						break;
					}
	            }
	             
	            return sValue;
        }

function printSpecial()
      {
	      if (document.getElementsByName != null)
	      {
			// 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 html = '<HTML>\n<HEAD>\n';
		      html += '\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/global.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/components.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/print.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link media="print" href="http://www.crsc.philips.com/crsc/styles/printbrowser.css" type="text/css" rel="stylesheet" />\n';
	              html += '\n<title>'+document.title+'</title>\n';
		      html += '\n</HEAD>\n<BODY background="\shared\assets\Flash\aWhite.jpg" style="direction:ltr" onload="setTimeout(\'window.print()\', 1000);setTimeout(\'window.close()\', 5000);">\n';
	              html += '<script type="text/javascript">_page.loadSIFR=false;</script>\n';
		      html += '<div class="p-printcontainer">';
		      html += '<br/>';
                      html += '<br/>';
		      html += '<div class="p-print-logo">';
                      html += '<img alt="Philips" src="http://www.crsc.philips.com/crsc/images/mainlogo.gif" />';
                      html += '</div>\n';
                      html += '<div class="p-line"><img alt="" src="'+_page.crsc_server + '/crsc/images/solidline.gif" /></div>\n';
                      html += '<TABLE id="p-columns" cellSpacing="10">\n';
                      html += '<TR>';
                      html += '<TD id="p-center">';
                      printReadyElem = document.getElementsByTagName("div");
		      var i=0;
		      for (i=0; i != printReadyElem.length; i++)
		      {
			if (printReadyElem[i].getAttribute("id") == "p-printarea")
			{	
				// Gets the Code under the DIV tag containg p-printarea class
				var code = printReadyElem[i].innerHTML;
				
				// To remove the additional CSS included in code. 
				var index = code.indexOf("<SCRIPT type=text/javascript>");
				
				/* Code Modification start here
				** Atul Garg, Infosys <HD08-7BSJEY>, 
				** Code modification for print version ticket
				** Old code commented out */

				//var lastIndex = code.lastIndexOf("rel=stylesheet>");
				var lastIndex = code.lastIndexOf("type=text/css rel=stylesheet>");

				// Removing the extra stylesheets
				if( index != -1 && lastIndex != -1){
					// Here 474 refers to the end of additional CSS code.
					//var code = code.substr(474);
					var code = code.substr(lastIndex+29);
				}
				/* Code modification ends here */
				
				html += '<div id="p-grid-c">';
				html += code;
				html += '</div>\n';
			}
		      }

		      html += '<div class="p-line"><img alt="" src="'+_page.crsc_server + '/crsc/images/solidline.gif" /></div>\n';
		      html += '<div class="p-print-footer">\n';
		      html += '  	  ' + privacy_footer +'\n';
		      html += '	</div>\n';
		      html +='</TD>';
		      html +='</TR>';
		      html +='</TABLE>';
		      html += '</div>';
		      html += '\n</BODY>\n</HTML>';

		      var printWin = window.open("","printSpecial",'height=500,width=700,toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=yes,resizable =no,left=290,top=248,screenX=290,screenY=248');
		      printWin.document.open();
		      printWin.document.write(html);
		      printWin.document.close();
   	}
   }

function onClickPrint()
      {
	     if (document.getElementsByName != null)
	      {
			// 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 html = '<HTML>\n<HEAD>\n';
		      html += '\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/global.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/components.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link href="http://www.crsc.philips.com/crsc/styles/print.css" type="text/css" rel="stylesheet" />\n';
		      html += '\n<link media="print" href="http://www.crsc.philips.com/crsc/styles/printbrowser.css" type="text/css" rel="stylesheet" />\n';
	              html += '\n<title>'+document.title+'</title>\n';
		      html += '\n</HEAD>\n<BODY background="\shared\assets\Flash\aWhite.jpg" style="direction:ltr" onload="setTimeout(\'window.print()\', 1000);setTimeout(\'window.close()\', 5000);">\n';
	              html += '<script type="text/javascript">_page.loadSIFR=false;</script>\n';
		      html += '<div class="p-printcontainer">';
		      html += '<br/>';
                      html += '<br/>';
		      html += '<div class="p-print-logo">';
                      html += '<img alt="Philips" src="http://www.crsc.philips.com/crsc/images/mainlogo.gif" />';
                      html += '</div>\n';
                      html += '<div class="p-line"><img alt="" src="'+_page.crsc_server + '/crsc/images/solidline.gif" /></div>\n';
                      html += '<TABLE id="p-columns" cellSpacing="10">\n';
                      html += '<TR>';
                      html += '<TD id="p-center">';
					  
					  //code for removing left navigation
					  var x= document.getElementsByTagName("table");
					  //alert(x[2].innerHTML);
					  removeChildNodes(x[2]);
					  //html -= '<div id="p-leftnav-container">';
					  
                      printReadyElem = document.getElementsByTagName("div");
		      var i=0;
		      for (i=0; i != printReadyElem.length; i++)
		      {
			if (printReadyElem[i].getAttribute("id") == "p-body")
			{	
				// Gets the Code under the DIV tag containg p-body class

				var code = printReadyElem[i].innerHTML;

				// To remove the additional CSS included in code. 
				//var index = code.indexOf("<SCRIPT type=text/javascript>");
				
				/* Code Modification start here
				** Atul Garg, Infosys <HD08-7BSJEY>, 
				** Code modification for print version ticket
				** Old code commented out */

				//var lastIndex = code.lastIndexOf("rel=stylesheet>");
				//var lastIndex = code.lastIndexOf("type=text/css rel=stylesheet>");

				// Removing the extra stylesheets
				//if( index != -1 && lastIndex != -1){
					// Here 474 refers to the end of additional CSS code.
					//var code = code.substr(474);
					//var code = code.substr(lastIndex+29);
				//}
				/* Code modification ends here */
				
				html += '<div id="p-grid-c">';
				//html -='<div id="p-leftnav">';
				//html -='</div>';
				html += code;
				html += '</div>';
			}
		      }

		      html += '<div class="p-line"><img alt="" src="'+_page.crsc_server + '/crsc/images/solidline.gif" /></div>\n';
		      html += '<div class="p-print-footer">\n';
		      html += '  	  ' + privacy_footer +'\n';
		      html += '	</div>\n';
		      html +='</TD>';
		      html +='</TR>';
		      html +='</TABLE>';
		      html += '</div>';
		      html += '\n</BODY>\n</HTML>';

		      var printWin = window.open("","printSpecial",'height=500,width=1024,toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,copyhistory=yes,resizable =no,left=290,top=248,screenX=290,screenY=248');
		      		      printWin.document.open();
		      		      printWin.document.write(html);
		      printWin.document.close();
			  window.location.reload(true);
			  
   	}
   }
function removeChildNodes(x)
        {  
   
        while (x.childNodes[0])  {    x.removeChild(x.childNodes[0]);  }
        
        }


function lineheight() {
if(document.getElementById('p-grid-c'))
{

var left=document.getElementById('p-grid-c');
right = left.offsetParent;
if(right.offsetParent)
{
right = right.offsetParent;
var iheight = right.style.height ;
left.style.height = iheight;
}
}
}


function consumerproducts(theHyperLinkPath,theImages)
{
	var current_item = 0;
	var anItem = 0;

	var start_second_item = Math.round((nr_items-1)/2, 0) + 1;


	document.write('<tr>');
	document.write('<td class="p-rightspace">');
	document.write('<ul class="p-link-list">');
	for(anItem in theHyperLinkPath)
	{		

	if(anItem!=0)
	{

	// Skip first item
	if(current_item==start_second_item)
	{	
	document.write('</ul>');
	document.write('</td>');
	document.write('<td valign="top">');
	document.write('<ul class="p-link-list">');
	}

	document.write('<li>');
	document.write('<a href="'+theHyperLinkPath[anItem]+'">'+theImages[anItem]+'</a>');
	document.write('</li>');

	}
	current_item += 1; 
	}

	document.write('</ul>');
	document.write('</td>');
	document.write('</tr>');
}


function validateFlashVersion(version)
{
	if (version >= 5)
	return true;
	else
	return false;
}


//Function to pass appropriate SWF to Homepage component depending upon country locale.    Author saket arora date: 29-11-2007
//var return_array = new Array (2); // array to be returned to component.     
function validateFlashResolution()
{
	var return_array = new Array (2); // array to be returned to component.     
	
		var country_locale;
		if(_page.locale =="global"){
			
			
			country_locale="global";
			
		}
		else{
			var arr = _page.locale.split("_");
			
			country_locale=arr[1];
			
			
		}
	
		
		
					
					if(country_locale=="zh" || country_locale=="ko" || country_locale=="ja" || country_locale=="cs" || country_locale=="sk" || country_locale=="pl" || country_locale=="ro" || country_locale=="ru" || country_locale=="bg" || country_locale=="el" || country_locale=="th" || country_locale=="tr" || country_locale=="hu" || country_locale=="gr")
					{
						
							if (screen.height>1024)
							{
								
								
								return_array [0]="highResolution";
								return_array [1]="Homepage_highResolution_other_font_v3.2.swf";
								return return_array 
				
							}
							else
							{
								 
								 
								  return_array [0]="lowResolution";
								  return_array [1]="Homepage_lowResolution_other_font_v3.2.swf";
								 return (return_array );
							}
					
					}
					
					else if(country_locale=="he")
					{
						
						
							if (screen.height>1024)
							{
						 		
						 		
						 		
								 return_array [0]="highResolution";
								 return_array [1]="Homepage_highResolution_right_align_v3.2.swf";
						   		 return (return_array );
						 		
						 		
						
							}
							else
							{
								 
								
								 return_array [0]="lowResolution";
								 return_array [1]="Homepage_lowResolution_right_align_v3.2.swf";
								 return (return_array );
						 		
							}
					
					
					}
					
					else
					{
						
						
			
						if (screen.height>1024)
						{
					 		
					 		
							return_array [0]="highResolution";
							return_array [1]="Homepage_highResolution_v3.2.swf";
							return (return_array );
					
						}
						else
						{
							 
							 
							   return_array [0]="lowResolution";
							   return_array [1]="Homepage_lowResolution_v3.2.swf";
						 	   return (return_array);
						}
			
					}

					alert(return_array);
					
}


//Function to be called on closing of Navigation Tab of Homepage.  Author saket arora date: 29-11-2007
_page.topNavOnBodyClose = function() 
{	
	sendSignalToFlash("false");
}



//Function to be called on Opening of Navigation Tab of Homepage. Author saket arora date: 29-11-2007
_page.topNavOnBeforeBodyOpen = function() 
{
	
	
	sendSignalToFlash("true");
}


//Function to Detect Browser to initate browser specfic flash calling of Homepage.  Author saket arora date: 29-11-2007
function getFlashMovie(movieName) 
{
       var isIE = navigator.appName.indexOf("Microsoft") != -1;
       return (isIE) ? window[movieName] : document[movieName];
}

//Function to send signal to flash SWF of Homepage. Author saket arora date: 29-11-2007
function sendSignalToFlash(isPlay) 
{
	//getFlashMovie("sendmovie").sendTextToFlash(isPlay);
	if(document.getElementById("sendmovie") && typeof document.getElementById("sendmovie").sendTextToFlash =='function'){
	
		document.getElementById("sendmovie").sendTextToFlash(isPlay);
	}
	
}

/*******************************************************************************
1. Function Name        : append
2. Purpose      	: This function is called by the Appearance XSL of the Home Page and Landing Page components
			  to append ominature tracking code data to the hyperlinks
3. Parameters       	: hyper - hyper link valve,position - component location on page,country - country name,locale - locale name,
			  campaign - value enter by user in campaign field of component,creative - value enter by user in creative field of component.
4. Return Value(s)  	: complete link with tracking code.
*******************************************************************************/
function append(hyper,position,country,locale,campaign,creative)
{
	
	//Declaration of variables
	var query, tracking, length=hyper.length; 
	
	//Check for link internal or external by storing last character
	var last_char = hyper.charAt(length-1);
	
	/* Code Modification start here
	** Atul Garg, Infosys <HD08-7DQK8B>, 
	** Code Modification for German home page problem */
	
	var mid_char = hyper.indexOf("?");
	var tracking;

	//Check for link internal or external
	if(last_char!="?" && mid_char == -1)
	{
		//if external append paramater with "?"
		query="?Int_origin=";
	}
	else if(last_char!="?" && mid_char > 0)
	{
		//if external append paramater with "&"
		query="&Int_origin=";
	}
	else
	{
		//if internal append parameter
		query="Int_origin=";
	}
	
	/* Code modification ends here */
	
	//Check for creative field
	if(creative!="")
	{	
		//if creative field not blank then append creative parameter
                tracking=hyper+query+position+"_"+country+"_"+locale+"_"+campaign+"_"+creative;
 	}
	else
	{	
		//if creative field blank then leave creative parameter
		tracking=hyper+query+position+"_"+country+"_"+locale+"_"+campaign;
	}
return tracking;

}


function redirect_item_country(url){

	if(!document.changelanguage) return;
	




	if(document.changelanguage.locale.value!=""){

		if(document.changelanguage.remember.checked){

			// Remember locale setting
			setCountryLocale(url);
		} else{
			// Redirect directly to site
			window.open(_page.locales[document.changelanguage.locale.value], "_self");
		}
	} else{
		return;
	}
}


function setCountryLocale(locale) {

	// Set cookie with user locale
	host_name = escape(window.location.hostname);



	// remove www. from the begining of host name.
	host_name = host_name.substring(host_name.indexOf(".")+1);



	if( host_name.indexOf("philips.be") != -1 || host_name.indexOf("philips.ca") != -1 || host_name.indexOf("philips.ch") != -1 || host_name.indexOf("philips.com.hk") != -1 ) {

		// Set cookie
		var expires = new Date();
		expires.setFullYear(expires.getFullYear()+1);
		new_str = "Philips=userlocale=" + locale + ";expires="+expires.toGMTString()+";path=/;domain="+host_name;
		


		document.cookie = new_str;
		newLink = getLocaleURL(locale);



		// Redirect to site using the switchHandler function
		_page.switchHandler(newLink, "");
	}
}

function validateHomepageFlashVersion(version)
{
	if (version >= 8)
	{
		return true;
	}
	else
	{
		return false;
	}
}

		
//Function to call flash file of homepage depending uopn resolution.  Author saket arora date: 20-5-2008			
           
function fnShowFlash(res, name, bandwidth)
{           
	     if(isClevel)
	     {
	     	var country = contLocale;
	     }
	     else
	     {
	     	var country = _page.locale;
	     }

	     if(res == "highResolution")
	    {
		path = "/shared/assets/homepage/homepage_flash/" + name ;
		var so = new SWFObject(path, "sendmovie", "960", "540", "8", "#ffffff");
		so.addVariable("country", country);
		so.addVariable("bandwidth", bandwidth);                
		so.addParam("quality", "high");
		so.addParam("wmode", "transparent");
		so.write("flash");
	    }           
	    else
	    {
		path = "/shared/assets/homepage/homepage_flash/" + name ;
		var so = new SWFObject(path, "sendmovie", "960", "496", "8", "#ffffff");
		so.addVariable("country", country);
		so.addVariable("bandwidth", bandwidth);
		so.addParam("quality", "high");
		so.addParam("wmode", "transparent");
		so.write("flash");
	    }
	 
	    
}

//Function to check if to show image or flash based on bandwidth.  Author saket arora date: 20-5-2008		
function bandwidthDetect(bandwidth,isCookie)
{
	
	if(bandwidth ==0){
		
		if(isClevel)
	     {
		swf =  validateFlashResolutionCLevel(contLocale);
	     }
	     else
	     {
		swf =  validateFlashResolution();
	     }
	
		
		var res = swf[0];
		var name = swf[1];
		fnShowFlash(res, name, bandwidth);
	}
	
	else if (bandwidth < 250)
		{
	     /***************************************** Omniture CR Changes **********************************************
	     * Description - The lines of code written below are used to extract the country name from the page path and 
	     *               store it in the variable cmnitureCountry. This variable cmnitureCountry is then prepended to 
	     *		     the value of s.prop23 to make its value of the form <country> + ":" + <label>.
	     * Author - Meghna Tyagi	
	     * Date - 22-Aug-2008
	     ************************************************************************************************************/
				
				var cmnitureCountry;
				if(isClevel)
				{
					var arr = contLocale.split("_");
					cmnitureCountry=arr[0];
				}
				else
				{
				     	if(_page.locale=="global")
				     	{
				     		cmnitureCountry=_page.locale;
				     	}
				     	else
				     	{
						var arr = _page.locale.split("_");
						cmnitureCountry=arr[0];
					}
		     		}
		     		
	     /************************************ Omniture CR Changes Ends Here *****************************************/
		
			
			if(typeof s != "undefined" && typeof s.tl != "undefined") 
			{
				
				 //Send Omniture request immediately
				s.linkTrackVars = "prop23";
				s.linkTrackEvents = "None";
				s.prop23 = cmnitureCountry + ":html_low";
				s.tl (true, "o", "CO:main:homepage");
		
			} 
			else 
			{
				
				// Set S attributes for header request
				p_initMetricsProps = function() {
					s.prop23 = cmnitureCountry + ":html_low";
				}
			}
			
			document.getElementById("flash").innerHTML=NonFlashImage;
			
		}
	else
	{
		if(isClevel)
		{
			swf =  validateFlashResolutionCLevel(contLocale);
		}
		else
		{
			swf =  validateFlashResolution();
		}
	
		var res = swf[0];
		var name = swf[1];
		fnShowFlash(res, name, bandwidth);
	 }
		 
		 if(isCookie){
		 
				 
		 	 setCookie('bandwidth', bandwidth, 120);	
		 }

}      



function getCookie(NameOfCookie)
{
    if (document.cookie.length > 0)
    {
    	begin = document.cookie.indexOf(NameOfCookie+"=");
    	if (begin != -1)
    	{
      		begin += NameOfCookie.length+1;
      		end = document.cookie.indexOf(";", begin);
      		if (end == -1)
      		end = document.cookie.length;
        	return unescape(document.cookie.substring(begin, end));
    	}
  }
  return null;
}




function setCookie(NameOfCookie, value, expireMins)
{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expireMins * 60 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) +((expireMins == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}





function delCookie (NameOfCookie)
{
  if (getCookie(NameOfCookie))
  {
    document.cookie = NameOfCookie + "=" +"; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


function DoTheCookieStuff()
{
	/*
	** CL@20090305-01: Check to see if bandwidth variable is already set by Akamai
	** ESI script (EdgeScape throughput field).
	*/
	if ( typeof(bandwidth) == "undefined" )
	{
		bandwidth=getCookie('bandwidth');
	}
	else
	{
		setCookie('bandwidth', bandwidth, 525600);
	}
	// End CL@20090305-01.

     	if (bandwidth == null)
	{
		bwFlashPath = "/shared/assets/homepage/homepage_flash/DetectBandwidth_v1.swf" ;
		var bw = new SWFObject(bwFlashPath, "mymovie", "960", "496", "8", "#ffffff");
		bw.addParam("quality", "high");
		bw.addParam("wmode", "opaque");
		bw.write("flash");
		
	}
	else
	{
		
		bandwidthDetect(bandwidth,false);
		
	}
}


function validateFlashResolutionCLevel(locale)
{
	var return_array = new Array (2); // array to be returned to component.     
	
		var country_locale;
		var arr = locale.split("_");
		country_locale=arr[0];
		
		if(country_locale=="by" || country_locale=="hr" ||  country_locale=="vn" || country_locale=="kz" || country_locale=="lv" || country_locale=="lt" || country_locale=="si" || country_locale=="yu" || country_locale=="uz")
		{
			if (screen.height>1024)
			{
				return_array [0]="highResolution";
				return_array [1]="Homepage_highResolution_other_font_v3.2.swf";
				return return_array 
			}
			else
			{
				return_array [0]="lowResolution";
				return_array [1]="Homepage_lowResolution_other_font_v3.2.swf";
				return (return_array );
			}
					
		}
		else if(country_locale=="il")
		{

			if (screen.height>1024)
			{
				 return_array [0]="highResolution";
				 return_array [1]="Homepage_highResolution_right_align_v3.2.swf";
				 return (return_array );
			}
			else
			{
				 return_array [0]="lowResolution";
				 return_array [1]="Homepage_lowResolution_right_align_v3.2.swf";
				 return (return_array );

			}
							
							
		}
		else
		{
			if (screen.height>1024)
			{
				return_array [0]="highResolution";
				return_array [1]="Homepage_highResolution_v3.2.swf";
				return (return_array );	
			}
			else
			{
				return_array [0]="lowResolution";
				return_array [1]="Homepage_lowResolution_v3.2.swf";
				return (return_array);
			}
			
		}
					
}


/*
 * CL@20090316-01: Code to implement reverse proxy passing of external elements for
 * host headers for which this has been configured in Apache and which are listed
 * in the below extElemsHostsArr.
 *
 * CL@20090329-01: As for all host headers that use this library the proxy configuration
 * and rewrite rules are set in Apache, we can override the _page.externalUrlPrefix variables
 * for all hosts.
 */

_page.externalUrlPrefix.stockQuotes = "http://www.philips.com/ext_elems/stockquotes";
_page.externalUrlPrefix.metrixLab = "http://www.philips.com/ext_elems/opinionbar";

var hostMatch = document.URL.match("^http://([^/]+)/.*$");

if ( hostMatch[1] == "www.philips.com.cn"  || hostMatch[1] == "origin.philips.com.cn" )
{
	_page.externalUrlPrefix.stockQuotes = "http://www.philips.com.cn/ext_elems/stockquotes";
	_page.externalUrlPrefix.metrixLab = "http://www.philips.com.cn/ext_elems/opinionbar";
}

// _page.externalUrlPrefix.stockQuotes = "http://" + hostMatch[1] + "/ext_elems/stockquotes";
// _page.externalUrlPrefix.metrixLab = "http://" + hostMatch[1] + "/ext_elems/opinionbar";

// End CL@20090316-01.