var site_url = window.location.protocol +'//'+
((typeof window.all != 'undefined' && typeof window.opera == 'undefined') ?
window.location.hostname : window.location.host) +
window.location.port + real_pathname;

// Replace the SIFR H1
var sifrheader = {
	src: 'swf/GillSansStd.swf'
	,ratios: [6,1.41,9,1.35,15,1.29,21,1.25,22,1.22,27,1.24,29,1.21,32,1.21,34,1.22,41,1.21,45,1.2,46,1.21,59,1.2,61,1.19,68,1.19,69,1.2,96,1.19,97,1.18,102,1.19,103,1.18,107,1.19,108,1.18,112,1.19,114,1.18,116,1.19,120,1.18,121,1.19,1.18]
};
var navigationLinks = {
	src: 'swf/GillSansStdBold.swf'
	,ratios: [6,1.41,9,1.35,15,1.29,21,1.25,22,1.22,27,1.24,29,1.21,32,1.21,34,1.22,41,1.21,45,1.2,46,1.21,59,1.2,61,1.19,68,1.19,69,1.2,96,1.19,97,1.18,102,1.19,103,1.18,107,1.19,108,1.18,112,1.19,114,1.18,116,1.19,120,1.18,121,1.19,1.18]
};

//popup txt for info icon
function toggleDivUp (div){
	document.getElementById(div).style.visibility='visible'; 
}
function toggleDivDown (div){
	document.getElementById(div).style.visibility='hidden';
}

function toggleDisplayDivUp (div){
	document.getElementById(div).style.display='block'; 
}
function toggleDisplayDivDown (div){
	document.getElementById(div).style.display='none';
}
function goFlavorHome (){
	document.location = "home.html?showintro=0";
}

 

// alert(navigationLinks.src);	
sIFR.activate(sifrheader);

function URLEncode (clearString) {
	  var output = '';
	  var x = 0;
	  clearString = clearString.toString();
	  var regex = /(^[a-zA-Z0-9_.]*)/;
	  while (x < clearString.length) {
	    var match = regex.exec(clearString.substr(x));
	    if (match != null && match.length > 1 && match[1] != '') {
	    	output += match[1];
	      x += match[1].length;
	    } else {
	      if (clearString[x] == ' ')
	        output += '+';
	      else {
	        var charCode = clearString.charCodeAt(x);
	        var hexVal = charCode.toString(16);
	        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
	      }
	      x++;
	    }
	  }
	  return output;
	}

function sIFRreplaceH1()	{
	sIFR.replace(sifrheader, {
    selector: 'h1'
		,css: '.sIFR-root {background-color:#FFFFFF;color:#cd8fbd;}'
		,wmode: 'transparent'
		, tuneHeight:'+1', forceWidth: true, fitExactly: true, forceSingleLine: true,preventWrap: true
  });
}

function sIFRreplaceH2()	{
  sIFR.replace(sifrheader, {
    selector: 'h2'
		,css: 
		[
		'.sIFR-root {background-color:#FFFFFF;color:#992c96;}',
		'a { text-decoration:none; color: #005aff }',
		'a:link { text-decoration:none; color: #005aff }',
		'a:hover { text-decoration:none; color: #005aff }'
		]
		,wmode: 'transparent'
		, tuneHeight:'+1', forceWidth: true, fitExactly: true, forceSingleLine: true,preventWrap: true
  });
}
function sIFRreplaceSelected()	{
  sIFR.replace(navigationLinks, {
    selector: '#top_main_menu div.selected'
		,css: 
		[
		'.sIFR-root {background-color:#FFFFFF;color: #000000;font-size:15px;cursor:pointer;}',
		'a { cursor:pointer;text-decoration:none;color: #000000; }',
		'a:link { cursor:pointer;color: #000000; }',
		'a:hover { cursor:pointer;color: #000000; }'
		]
		,wmode: 'transparent'
		, tuneHeight:'+1', forceWidth: true, fitExactly: true, forceSingleLine: true,preventWrap: true
  });
}
function sIFRreplaceUnSelected()	{
  sIFR.replace(navigationLinks, {
    selector: '#top_main_menu div.unselected'
		,css: 
		[
		'.sIFR-root {background-color:#FFFFFF;color: #005aff;cursor:pointer;font-size:15px; }',
		'a { cursor:pointer;text-decoration:none;color: #005aff; }',
		'a:link { cursor:pointer;color: #005aff; }',
		'a:hover { cursor:pointer;color: #005aff; }'
		]
		,wmode: 'transparent'
		, tuneHeight:'+1', forceWidth: true, fitExactly: true, forceSingleLine: true,preventWrap: true
  });
}	
$(document).ready(function(){
	$("#philips_logo").click(function(){
		window.location = "./";
	});
	sIFRreplaceH1();
	sIFRreplaceH2();
	sIFRreplaceSelected();
	sIFRreplaceUnSelected();
	headerLS = new _page.LS('1');
	$("#p-localeselect").html(headerLS.html);
	var privacy_footer = _page.text["footer"];
	privacy_footer = privacy_footer.replace("{BR}", "");
	privacy_footer = privacy_footer.replace("{COPYRIGHT}", _page.text["copyright"]);
	privacy_footer = privacy_footer.replace("{PRIVACY} |", "");
	privacy_footer = privacy_footer.replace("{OWNER} |", "");
	privacy_footer = privacy_footer.replace("{TERMS} |", "");
	privacy_footer = privacy_footer.replace("{SITEMAP}", "");
	privacy_footer = privacy_footer.replace("{CAREERS} |","");
	$("#footer_copyright").html(privacy_footer);
	
	if ($.browser.msie && $.browser.version == 6.0) {
		$(document).pngFix();
	}
});


//temp eBay popup homepage
$(function eBayBannerSetup() {
	setTimeout('eBayBannerShow()',1600);
});
function eBayBannerShow() {
	$('.eBayBanner').hCenter().fadeIn(500);
};
function eBayBannerHide() {
	$('.eBayBanner').fadeTo(500,'0').hide(500);
};
//end temp eBay popup homepage


