
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>");
}


function changeMDA(id) {
	mdaVista = document.getElementById("vista");
	mdaXp = document.getElementById("xp");
	if (id == 3){
		mdaVista.style.display = 'none';
		mdaXp.style.display = 'block';
	}
	else {
		mdaVista.style.display = 'block';
		mdaXp.style.display = 'none';
	}
}


function changeTextVersionLink(uri) {
	textVersionLink = document.getElementById("getTextButton");
	
	if (uri != null)
		textVersionLink.innerHTML = '&raquo;&nbsp;<a href="' + uri + '" class="themelink bold">Text version and related information</a>'
	else
		textVersionLink.innerHTML = '&raquo;&nbsp;<a href="javascript:void(0)" onClick="showContent(\'text-version\')" class="themelink bold">Text version and related information</a>';
}


function sendPageTag(mktFunnel, tag) {
	s_prop1 = mktFunnel;
	
	var index = s_prop2.lastIndexOf("|");
	var campaignRef = s_prop2.substring(0,index+1) + s_hp_apj_campaignRef;
	
	if (s_prop2.toLowerCase() != campaignRef.toLowerCase()) {
		s_prop2 = campaignRef;
	}
	
	s_sendAnalyticsEvent('', tag);
}

//	not in use yet
function sendLinkTag(tag, url){ 
	//s_sendCustomLinkEvent('',linkname);  //use this function instead of s_objectID
	//Set timeout to do your other javascript functions
	//setTimeout("openWindow()",600);
	alert(tag + ' ' + url);
}


function delayLinkTag(linkTag, url) {
	s_sendCustomLinkEvent('', linkTag);
	var t = setTimeout ("document.location='"+url+"'", 500);
}


function sendOmniPageTag(campaignRef, tag) {
	var index = s_prop2.lastIndexOf("|");
	s_prop2 = s_prop2.substring(0,index+1) + campaignRef;
	s_sendAnalyticsEvent('', tag);
}


function showContent(content) {
	adLanding = document.getElementById("ad-landing");
	textVersion = document.getElementById("text-version");
	
	if (content == "text-version") {
		s_sendAnalyticsEvent('', 'ap|en-ap|hho|consumernotebook|home|text version');
		
		removeFlash();
		document.body.className = "colorFFFFFFbg text-version-body";
		adLanding.className = "ad-landing-hidden";
		textVersion.className = "text-version-visible";
		location.hash = "textversion";
	}
	else {
		embedFlash();
		document.body.className = "pageLayoutWide ad-landing-body";
		adLanding.className = "ad-landing-visible";
		textVersion.className = "text-version-hidden";
	}
}


function embedFlash() {
	
	var flashContent = document.getElementById("flashcontent");
	if (!flashContent) {
		var flashContentDiv = document.createElement("div");
		flashContentDiv.setAttribute("id", "flashcontent");
		document.getElementById("flashcontainer").appendChild(flashContentDiv);
	}
	
	var flashvars = {};
	flashvars.xmldatapath = "images_oov/flash/xml/data.xml";
	
	var attributes = {};
	attributes.id = "flashcontent";
	
	var params = {};
	params.allowscriptaccess = "always";
	
	swfobject.embedSWF("images_oov/flash/main.swf", "flashcontent", "974", "600", "9.0.0", "images_oov/flash/expressinstall.swf", flashvars, params, attributes);
}


function removeFlash() {
	swfobject.removeSWF("flashcontent");
}


function init() {
	if (location.hash == "#/textversion") {
		showContent("text-version");
	}
	else {
		showContent();
	}
}

