//-- start code to include tce survey js file
document.write('<script src="http://welcome.hp-ww.com/cma/metrics/survey/ap_hho.js"><\/script>');
//-- end code to include TCE survey js file


//Start added by Alan Sim 12 Aug 2003 for Sg promotion
function printerfriendly(){
	document.write ("<img src=\"http://welcome.hp-ww.com/img/hpweb_1-2_prnt_icn.gif\" width=\"19\" height=\"13\" alt=\"\" border=\"0\"><a href=\"http://www.hp.com/cgi-bin/pf-new.cgi?IN=" + location.href + "\" class=\"udrlinebold\">Printable version</a>");
}
//End added by Alan Sim 12 Aug 2003 for Sg promotion


function popup(url,width,height){
	win = open (url, 'popup', 'height='+height+',width='+width+',scrollbars=yes,toolbars=no,left=0,top=0');
	win.focus();
}



function openWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}


//-- Start code for dynamic tagging
function stripTitle() {
	var strToStrip = "HP Thailand Home & Home Office - ";
	var title = document.title;
	
	var stripped = title.substring(strToStrip.length);
	
	if (stripped.indexOf("#")!=-1) {
		var temp = stripped.split("#");
		stripped = temp[0];
	}
	
	return stripped;
}


function retrieveLang() {
	if (document.getElementsByTagName){
		return window.document.documentElement.lang;
	}
}


function retrieveCty() {
	if (document.getElementsByTagName) {
		var metaTags=document.getElementsByTagName("META");
		var meta;

		for (var i=0; i<metaTags.length; i++) {
			if (metaTags[i].tagName == "META") {	
				meta = metaTags[i];
				if (meta.name == "target_country") {
					return meta.content.toLowerCase();
					}
			}
		}
	}
}


function mapFolderNumToName(folderNum) {
	var folderName = "";
	var url = document.URL.split('://');
	var temp = url[1].split('/');
	
	for (x=0; x<temp.length; ++x){
		if(x==parseInt(folderNum)) {
			folderName = returnfoldervalue(temp[x]);
		}
	}
	
	if(!(folderName.length>0)) {
		folderName = "*";
	}
	
	return folderName;
}


function returnfoldervalue(valfolder){
	var pos_val=valfolder.indexOf('.');
	
	if(pos_val>0) {
		return(valfolder.substring(0, pos_val));
	} 
	else {
		return(valfolder);
	}
}
//-- End code for dynamic tagging


function jump() 
{
//	var index = document.dropdown.language.selectedIndex;
//	url = eval("document.dropdown.language.options[" + index + "].value");
//	window.location.href=(url);

//	var index = document.dropdown.language.selectedIndex;
//	var path = location.pathname;
//	var url = "";

//	if (path.search(/th/) == -1)
//		url = path.replace(/en/,"th");
//	else
//		url = path.replace(/th/,"en");
				
//	window.location.href=(url);

	var index = document.dropdown.language.selectedIndex;
	var val = document.dropdown.language.options[index].value;
				
	window.location.href=(val);
}