/*** javascript shared in all languages ***/
function ignore(){
	return true;
}
// uncomment the following line to prevent any error display if necessary
//window.onerror = ignore;
function loc_selector_popup(showPopup) {
	var obj = document.getElementById("location_popup_container");
	if (showPopup)
	{
		obj.style.visibility = "visible";
		var ul = document.getElementsByTagName("ul");
		for (var j=0; j<ul.length; j++){
			if (ul[j].className.indexOf("level1")){
				var els = ul[j].getElementsByTagName("select");
				for (var i=0; i<els.length; i++){
					els[i].style.display = "none";
				}
			}
		}
		// inserts iframe to provide a shim between popup and page; hides product finder select fields from showing through popup in ie5.5+
		obj.insertAdjacentHTML("afterEnd", '<iframe name="location_popup_iframe" src="javascript:;" scrolling="no" frameborder="0" style="position:absolute;width:245px;height:550px;top:1px;left:1px;border:none;z-index:1;filter:Alpha(style=0,opacity=0);"></iframe>');
	}
	else
	{
		obj.style.visibility = "hidden";
		var ul = document.getElementsByTagName("ul");
		for (var j=0; j<ul.length; j++){
			if (ul[j].className.indexOf("level1")){
				var els = ul[j].getElementsByTagName("select");
				for (var i=0; i<els.length; i++){
					els[i].style.display = "inline";
				}
			}
		}
		// hide iframe shim above
		var ifrm = document.getElementsByName("location_popup_iframe");
		for (var z=0; z<ifrm.length; z++){
			ifrm[z].style.display = "none";
		}
	}
}

function is_descendent(desc, asc) {
	try {
		while (desc && desc != asc && desc.nodeName.toUpperCase() != 'BODY') {
			desc = desc.parentNode;
		}
	} catch (err) {
		// ignore
	}
	return (desc == asc);
}

/*** login popup ***/
var main_nav_login, is_mouse_in_login_popup, is_login_popup_focused, hiding_login_popup;

function show_login_popup(e) {
	if (!e) {
		e = window.event;
	}

	if (hiding_login_popup) {
		clearTimeout(hiding_login_popup);
		hiding_login_popup = null;
	}

	if (main_nav_login.className.indexOf('show_login_popup') == -1) {
		main_nav_login.className += ' show_login_popup';
	}

	if (e.type == 'mouseover') {
		is_mouse_in_login_popup = true;
	}
	else {
		is_login_popup_focused = true;
	}
}

function login_popup_mouseout(e) {
	var from, to;

	if (!e) {
		e = window.event;
	}

	from = (e.target) ? e.target : e.srcElement;
	to = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	if (is_descendent(from, main_nav_login) && !is_descendent(to, main_nav_login)) {
		is_mouse_in_login_popup = false;
		start_hide_login_popup();
	}
}

function login_popup_blur() {
	is_login_popup_focused = false;
	start_hide_login_popup();
}

function start_hide_login_popup() {
	if (!is_mouse_in_login_popup && !is_login_popup_focused) {
		hiding_login_popup = setTimeout('hide_login_popup()', 1000);
	}
}

function hide_login_popup() {
	main_nav_login.className = main_nav_login.className.replace(' show_login_popup', '');
	hiding_login_popup = null;
}



/*** product popup ***/
var li_with_product_popup, is_mouse_in_product_popup, is_product_popup_focused, hiding_product_popup;

function show_product_popup(e) {
	var this_li = this.parentNode;

	if (!e) {
		e = window.event;
	}

	if (li_with_product_popup) {
		if (hiding_product_popup) {
			clearTimeout(hiding_product_popup);
			hiding_product_popup = null;
		}
		if (li_with_product_popup != this_li) {
			/* opened new popup - close the old one */
			hide_product_popup();
		}
	}

	li_with_product_popup = this_li;
	if (li_with_product_popup.className.indexOf('show_product_popup') == -1) {
		if (li_with_product_popup.className == '') {
			li_with_product_popup.className = 'show_product_popup';
		}
		else {
			li_with_product_popup.className += ' show_product_popup';
		}
	}

	if (e.type == 'mouseover') {
		is_mouse_in_product_popup = true;
	}
	else {
		is_product_popup_focused = true;
	}
}

function reenter_product_popup(e) {
	if (!e) {
		e = window.event;
	}

	if (!li_with_product_popup || !is_descendent(this, li_with_product_popup)) {
		return;
	}

	if (hiding_product_popup) {
		clearTimeout(hiding_product_popup);
		hiding_product_popup = null;
	}

	if (e.type == 'mouseover') {
		is_mouse_in_product_popup = true;
	}
	else {
		is_product_popup_focused = true;
	}
}

function product_popup_mouseout(e) {
	var from, to;

	if (!e) {
		e = window.event;
	}

	if (li_with_product_popup) {
		from = (e.target) ? e.target : e.srcElement;
		to = (e.relatedTarget) ? e.relatedTarget : e.toElement;
		if (is_descendent(from, li_with_product_popup) && !is_descendent(to, li_with_product_popup)) {
			is_mouse_in_product_popup = false;
			start_hide_product_popup();
		}
	}
}

function product_popup_blur() {
	if (!li_with_product_popup || !is_descendent(this, li_with_product_popup)) {
		return;
	}

	is_product_popup_focused = false;
	start_hide_product_popup();
}

function start_hide_product_popup() {
	if (!is_mouse_in_product_popup && !is_product_popup_focused) {
		hiding_product_popup = setTimeout('hide_product_popup()', 1000);
	}
}

function hide_product_popup() {
	if (li_with_product_popup) {
		if (li_with_product_popup.className == 'show_product_popup') {
			li_with_product_popup.className = '';
		}
		else {
			li_with_product_popup.className = li_with_product_popup.className.replace('show_product_popup', '');
		}
		li_with_product_popup = hiding_product_popup = null;
	}
}

function skip_iframe() {
	if (this.nextItem && this.nextItem.focus) {
		this.nextItem.focus();
	}
}

/*
	toggle upload instruction for check warranty - upload
	by Mitch dot Leung at Ion Global dot com
*/
function toggleDiv(id, mode){
	var e = document.getElementById(id);
	if (e){
		var v = "hidden";
		var d = "none";
		if ((e.style.display != "block" || e.style.display != "inline" || e.style.display == "none") && mode==1){
			v = "visible";
			d = "block";
		}
		e.style.visibility = v;
		e.style.display = d;
	}
}
/*
	product toggle timeout
*/
var productlistTimer;
var productlistClearId = null;
function productInfo(id, mode){
	if (mode==0){
		productlistTimer = setTimeout("toggleDiv(\""+id+"\", "+mode+")", 2000);
		productlistClearId= id;
	}else{
		clearTimeout(productlistTimer);
		if (productlistClearId!=null){
			toggleDiv(productlistClearId, 0);
			productlistClearId = null;
		}
		toggleDiv(id, mode);
	}
}
/*
	toggle nested ul,ol
	by Mitch dot Leung at Ion Global dot com
*/
function toggleBullet(ul_id, mode, li_id, switch_id){
	var state = (mode == 1) ? "expanded" : "";
	if (li_id!=''){
		var e = document.getElementById(li_id);
		if (e.className == "expanded"){
			state = "";
		}else{
			state = "expanded";
		}
		e.className = state;
	}else if (ul_id!=''){
		var ul = document.getElementById(ul_id);
		var lis = ul.getElementsByTagName("li");
		for(var i=0; i<lis.length; i++){
			var e = lis[i];
			e.className = state;
		}
		if (switch_id!=''){
			var s = document.getElementById(switch_id);
			var spans = s.getElementsByTagName("span");
			for (var i=0;i<spans.length;i++){
				if (spans[i].className == "on"){
					spans[i].className = "off";
				}else if (spans[i].className == "off"){
					spans[i].className = "on";
				}
			}
		}
	}
}
/*
	toggle all checkbox of id start with 'prefix'
	by Mitch dot Leung at Ion Global dot com
*/
function checkall(prefix){
	var el = document.getElementsByTagName("input");
	for (i=0; i<el.length; i++){
		var e = el[i];
		if (e.type == "checkbox" && e.id.indexOf(prefix)==0){
			e.checked = true;
		}
	}
}
/*
	enable 1 & only 1 DIV out of a group of DIVs
	by Mitch dot Leung at Ion Global dot com
*/
function toggleGroupDiv(containerId, myId){
	var c = document.getElementById(containerId);
	if (c){
		var divs = c.getElementsByTagName("div");
		for (i=0; i<divs.length; i++){
			var e = divs[i];
			if (e.className.indexOf("dynamic_content")!=-1 && e.id==myId){
				toggleDiv(e.id,1);
			}else if (e.className.indexOf("dynamic_content")!=-1 && e.id!=myId){
				toggleDiv(e.id,0);
			}
		}
	}
	return false;
}
/*
	toggle popup location map region 1 out of 4
	by Mitch dot Leung at Ion Global dot com
*/
function clickFirstAhref(id, classname){
	var el = document.getElementById(id);
	if (el){
		var divs = el.getElementsByTagName("div");
		for (var i=0; i<divs.length; i++){
			if (divs[i].className == classname){
				var ahrefs = divs[i].getElementsByTagName("a");
				if (ahrefs.length>0){
					if (typeof(ahrefs[0].onclick)=="function"){
						var func = ahrefs[0].getAttribute("onclick");
						if (typeof(func)=="function"){
							func();
						}else{
							eval(func.substr(0, func.indexOf(';')));
						}
						break;
					}
				}
			}
		}
	}
}
function toggleLocation(prefix, refId){
	//var regionArr = [prefix+'apac',prefix+'emea',prefix+'na',prefix+'la'];
	var regionArr = ['apac','emea','na','la'];
	for (var i=0; i<regionArr.length; i++){
		var e = document.getElementById(prefix + regionArr[i]);
		if (e){
			var myClass = (regionArr[i] == refId) ? prefix+'current' : prefix.substr(0, prefix.length-1);
			e.className = myClass;
			if (regionArr[i] == refId){
				var divId = (prefix=="location_popup_") ? "location_map" : "location_spp";
				hiliteLocation(regionArr[i], 2, divId);
			}
		}
	}
	if (prefix=="language_select_"){
		toggleDiv("step1",1);
		toggleDiv("step2",1);
		toggleDiv("step3",1);
		clickFirstAhref("step1","language_select_current");
	}
}
function toggleCountry(id)
{
	var region = id.substr(id.indexOf("_")+1, id.length-1);
	var lang = id.substr(0,id.indexOf("_")+1);
	var e = document.getElementById("language_select_"+region);
	if (e){
		var ahrefs = e.getElementsByTagName("a");
		for (var i=0; i<ahrefs.length; i++){
			if (ahrefs[i].getAttribute("onclick").toString().indexOf(lang)!=-1){
				// found
				ahrefs[i].className = "hiliteMe";
			}else{
				ahrefs[i].className = "";
			}
		}
	}
	toggleDiv("step2",1);
	var e = document.getElementById("step2");
	var divs = document.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++){
		if (divs[i].className.indexOf("content_map_country")!=-1){
			var myClass = "content_map_country";
			if (divs[i].id == id){
				myClass = "content_map_country_current";
			}
			divs[i].className = myClass;
		}
	}
	clickFirstAhref("step2","content_map_country_current");
	toggleDiv("step3",1);
	var e = document.getElementById("step3");
	var lang = id.substr(0,2);
	var divs = e.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++){
		if (divs[i].id.indexOf("step3")!=-1){
			if (divs[i].id == "step3"+lang){
				toggleDiv(divs[i].id,1);
			}else{
				toggleDiv(divs[i].id,0);
			}
		}
	}
}
function toggleLangLink(id){
	var el = document.getElementById(id);
	var e = document.getElementById("step2");
	var divs = e.getElementsByTagName("div");
	for (var i=0; i<divs.length; i++){
		if (divs[i].className.indexOf("content_map_country_current")!=-1){
			var ahrefs = divs[i].getElementsByTagName("a");
			for (var j=0; j<ahrefs.length; j++){
				if (ahrefs[j].id == id){
					ahrefs[j].className = "hiliteMe";
				}else{
					ahrefs[j].className = "";
				}
			}
			break;
		}
	}
}
/*
	rollover for location popup
*/
var __gPopupLocation = [];
function hiliteLocation(where, mode, div){
	if (!div){
		div = "location_map";
	}
	var d = document.getElementById(div);
	if (d){
		var imgs = d.getElementsByTagName("img");
		var currLoc = imgs[0].getAttribute("src");
		if (imgs[0]){
			if (__gPopupLocation[div]==null){
				__gPopupLocation[div] = imgs[0].getAttribute("src");
			}
			var newSrc = "";
			if (mode>=1){
				newSrc = __gPopupLocation[div].replace(/map_short[\-a-z]*\.gif/g,"map_short-"+where+".gif");
				if (mode>1){
					__gPopupLocation[div] = newSrc;
				}
			}else{
				newSrc = __gPopupLocation[div];
			}
			imgs[0].setAttribute("src", newSrc);
		}
	}
}
/*
	toggle left capacity selector
	by Mitch dot Leung at Ion Global dot com
*/
function toggleCapacitySelector(tab){
	var bg = document.getElementById("left_inner_capacity_selector_backdrop");
	var f = document.getElementById("tabProductFinder");
	var l = document.getElementById("tabProductList");
	if (!f || !l || !bg) return;
	if (tab=="finder" && f.className.indexOf(" on")==-1){
		bg.className = "left_inner_capacity_selector";
		toggleDiv('capactity_product_finder',1);
		toggleDiv('capactity_product_list',0);
		f.className += " on";
		l.className = l.className.substr(0,l.className.indexOf(" on"));
	}else if (tab=="list" && l.className.indexOf(" on")==-1){
		bg.className = "left_inner_capacity_selector product_list";
		toggleDiv('capactity_product_finder',0);
		toggleDiv('capactity_product_list',1);
		l.className += " on";
		f.className = f.className.substr(0,f.className.indexOf(" on"));
	}
}


// Cart Image Roll Over Script
function cart_rollover()
{
 if(document.getElementById('shopping_cart')) {
	document.getElementById('shopping_cart').onmouseover=function(){document.getElementById('shopping_cart').src='/images/ecom/catalog/shop_icon_on.gif'};
	document.getElementById('shopping_cart').onmouseout=function(){document.getElementById('shopping_cart').src='/images/ecom/catalog/shop_icon.gif'};
  }
}


/*** onload ***/
function load() {
	var children, child, as, a, inputs, input, els, el, i, j;

	el = document.getElementById('login_popup_container_stub');
	if (el) {
		main_nav_login = el.parentNode;

		children = main_nav_login.childNodes;
		for (i = children.length - 1; i >= 0; i--) {
			child = children[i];
			if (child.nodeType == 1) {
				child.onmouseover = show_login_popup;
				child.onmouseout = login_popup_mouseout;
			}
		}

		as = main_nav_login.getElementsByTagName('a');
		for (i = as.length - 1; i >= 0; i--) {
			a = as[i];
			a.onfocus = show_login_popup;
			a.onblur = login_popup_blur;
		}

		inputs = main_nav_login.getElementsByTagName('input');
		for (i = inputs.length - 1; i >= 0; i--) {
			input = inputs[i];
			input.onfocus = show_login_popup;
			input.onblur = login_popup_blur;
		}
	}

	el = document.getElementById('product_popups');
	if (el) {
		els = el.getElementsByTagName('li');
		for (i = els.length - 1; i >= 0; i--) {
			el = els[i];
			var divs = el.getElementsByTagName("div");
			var applyFlag = false;
			for (var a=0; a<divs.length; a++){
				if (divs[a].className=="left_subsection_item_popup"){
					applyFlag = true;
					break;
				}
			}
			if (applyFlag){
				el.onmouseout = product_popup_mouseout;

				children = el.childNodes;
				for (j = children.length - 1; j >= 0; j--) {
					child = children[j];
					if (child.nodeType == 1) {
						if (child.nodeName == 'A') {
							child.onmouseover = child.onfocus = show_product_popup;
						}
						else if (child.nodeName == 'DIV') {
							child.onmouseover = reenter_product_popup;
						}
					}
				}

				as = el.getElementsByTagName('a');
				for (j = as.length - 1; j >= 0; j--) {
					a = as[j];
					if (!a.onfocus) {
						a.onfocus = reenter_product_popup;
					}
					a.onblur = product_popup_blur;
				}

				inputs = el.getElementsByTagName('input');
				for (j = inputs.length - 1; j >= 0; j--) {
					input = inputs[j];
					input.onfocus = reenter_product_popup;
					input.onblur = product_popup_blur;
				}

				j = el.getElementsByTagName('iframe')[0];
				if (j && i < els.length - 1) {
					j.nextItem = els[i + 1].getElementsByTagName('a')[0];
					j.onfocus = skip_iframe;
				}
			}
		}
	}
	var mapId = "location_spp";
	var mapDiv = document.getElementById(mapId);
	if (mapDiv){
		toggleLocation('language_select_','na');
		//toggleCountry('en_na');
		//toggleDiv('step3',1);
	}
	cart_rollover();
}
function stdpop(url){
	var x = 0;
	var y = 0;
	var w = 780;
	var h = 600;
	if (window.screen) {
		x = Math.floor((screen.availWidth-w)/2);
		y = Math.floor((screen.availHeight-h)/2);
	}
	var params = "width="+w+",height="+h+",menubar=no,scrollbars=no,toolbar=no,location=no,status=yes,resizable=yes";
	params += ",left="+x+",top="+y;
	pop(url, "seagatewin", params);
}
function pop(url, winId, params){
	var popwin = window.open(url, winId, params);
	popwin.opener = this;
	if (typeof(popwin.focus)=="function") popwin.focus();
}
function unload() {
	var children, child, as, a, inputs, input, els, el, i, j;

	el = document.getElementById('login_popup_container_stub');
	if (el) {
		main_nav_login = el.parentNode;

		children = main_nav_login.childNodes;
		for (i = children.length - 1; i >= 0; i--) {
			child = children[i];
			if (child.nodeType == 1) {
				child.onmouseover = child.onmouseout = null;
			}
		}

		as = main_nav_login.getElementsByTagName('a');
		for (i = as.length - 1; i >= 0; i--) {
			a = as[i];
			a.onfocus = a.onblur = null;
		}

		inputs = main_nav_login.getElementsByTagName('input');
		for (i = inputs.length - 1; i >= 0; i--) {
			input = inputs[i];
			input.onfocus = input.onblur = null;
		}
	}

	el = document.getElementById('product_popups');
	if (el) {
		els = el.getElementsByTagName('li');
		for (i = els.length - 1; i >= 0; i--) {
			el = els[i];
			var divs = el.getElementsByTagName("div");
			var applyFlag = false;
			for (var a=0; a<divs.length; a++){
				if (divs[a].className=="left_subsection_item_popup"){
					applyFlag = true;
					break;
				}
			}
			if (applyFlag){
				el.onmouseout = product_popup_mouseout;

				children = el.childNodes;
				for (j = children.length - 1; j >= 0; j--) {
					child = children[j];
					if (child.onmouseover) {
						child.onmouseover = null;
					}
				}

				as = el.getElementsByTagName('a');
				for (j = as.length - 1; j >= 0; j--) {
					a = as[j];
					a.onfocus = a.onblur = null;
				}

				inputs = el.getElementsByTagName('input');
				for (j = inputs.length - 1; j >= 0; j--) {
					input = inputs[j];
					input.onfocus = input.onblur = null;
				}

				j = el.getElementsByTagName('iframe')[0];
				if (j) {
					j.onfocus = null;
				}
			}
		}
	}
}

window.onload = load;
window.onunload = unload;

// SellPoint JavaScript PopUp Code
function SynOpenWin(link)
{
   window.open('http://syndicate.sellpoint.net/Syndicate/SynMaster?Tentoe=' + link + '&ParentUrl=' +
escape(window.location.href),'_blank','width=536,height=525,scrollbars=no,toolbar=no,personalbar=no,statusbar=no,directories=no,location=no,resizable=no,menubar=no,locationbar=no');
   return false;
}
// Below added 2006/06/26 kwai lam to support flash video popup from swfobject.js
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

// Below added 2006/06/26 kwai lam to support flash video popup fromcrm_video_util.js
/*
*	CRM Video Templates
*	Version 1.0.1
*	11-01-2007 
*/

if (typeof crm == "undefined") { var crm = {}; }
if (typeof crm.util == "undefined") { crm.util = {}; }
if (typeof crm.util.VidUtil == "undefined") {
	crm.util.VidUtil = {
		openPlayer: function(src, caption, w, h, a) {
			//	prevent Safari pre-3
			if (typeof navigator.vendor != "undefined" && navigator.vendor.indexOf("Apple") > -1) {
				var strVersion = navigator.appVersion;
				var strVersion = strVersion.match(/AppleWebKit\/([0-9]{3}(\.[0-9]{1,2})*)/gi);
				var numVersion = parseInt(strVersion[0].substr(12, 3), 10);
				if (typeof numVersion == "number" && numVersion < 500) {
					alert("We're sorry but Safari 3 or higher is required to view this content.");
					return;
				}
			}
			//	create crm_flv_layer if !exist
			if (!document.getElementById("crm_flv_layer")) {
				//	add iframe hack to cover form elements -- IE 6
				/*@cc_on @*/
				/*@if (@_jscript_version < 5.7)
					flv_modal_hide_select = document.body.appendChild(document.createElement("iframe"));
					flv_modal_hide_select.id = "flv_modal_hide_select";
				/*@end @*/
				//	set flash player to correct size (based on video size)
				var playerBgW = w + 40;
				var playerBgH = h + 90;
				//	get browser dimensions for IE 6 hack
				var browserDim = {};
				/*@cc_on @*/
				/*@if (@_jscript_version < 5.7)
					browserDim = this.getBrowserDim();
				/*@end @*/
				//	add wrapper
				var crm_flv_layer = document.body.appendChild(document.createElement("div"));
				crm_flv_layer.id = "crm_flv_layer";
				var script_elem = document.body.appendChild(document.createElement("script"));
				script_elem.type = "text/javascript";
				script_elem.id = "script_elem";
				//	set bg alpha
				var playerBgAlpha = a;
				// CHANGE THIS TO CORRECT URL ON SEAGATE SITE
				script_elem.text = 'var so = new SWFObject("/images/flash/video_player/video_template.swf", "crm_video_player", "100%", "100%", "8"); so.addParam("wmode", "transparent"); so.addVariable("lang", "en-US"); so.addVariable("flv_src", "' + src + '"); so.addVariable("caption", "' + caption + '"); so.addVariable("ie6StageWidth", "' + browserDim.width + '"); so.addVariable("ie6StageHeight", "' + browserDim.height + '"); so.addVariable("flv_width", "' + w + '"); so.addVariable("flv_height", "' + h + '"); so.addVariable("player_width", "' + playerBgW + '"); so.addVariable("player_height", "' + playerBgH + '"); so.addVariable("bg_alpha", "' + playerBgAlpha + '"); so.write("crm_flv_layer")';
				document.getElementById("crm_video_player").focus();
			}
		},
		getBrowserDim: function() {
			var w = 0, h = 0;
			if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
				//IE 6+ in 'standards compliant mode'
				w = document.documentElement.clientWidth;
				h = document.documentElement.clientHeight;
			} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				//IE 4 compatible
				w = document.body.clientWidth;
				h = document.body.clientHeight;
			}
			return { width:w, height:h };
		},
		closePlayer: function() {
			document.getElementById("crm_flv_layer").style.display = "none";
			setTimeout(function() {
				document.body.removeChild(document.getElementById("crm_flv_layer"));
				document.body.removeChild(document.getElementById("script_elem"));
				/*@cc_on @*/
				/*@if (@_jscript_version < 5.7)
					document.body.removeChild(document.getElementById("flv_modal_hide_select"));
				/*@end @*/
			}, 100);
		}
	};
}

// Code for login popup jquery functionality bw 10/2/08
var LoginBox = {
  loginLink: null,
  loginBox: null,
  closeLink: null,
  passwordCleared: false,
  usernamePrompt: 'User Id',
  usernameField: null,
  passwordField: null,
  init: function() {
    var LB = this;
    LB.loginLink = jQuery('#ToolbarOld a.login');
    LB.loginBox = jQuery('#Login');
    LB.usernameField = jQuery('input:eq(0)', LB.loginBox);
    LB.usernamePrompt = LB.usernameField.val();
    LB.passwordField = jQuery('input:eq(1)', LB.loginBox);
    LB.closeLink = jQuery('a.close', LB.loginBox).click( LB.close );
    LB.loginLink.click( LB.open );
    LB.usernameField.focus(
      function(e) {
        var $$ = jQuery(this);
        if ($$.val() == LB.usernamePrompt)
          $$.val("");
      }
    ).blur(
      function(e) {
        var $$ = jQuery(this);
        if ($$.val() == "")
          $$.val(LB.usernamePrompt);
      }
    );
    LB.passwordField.focus(
      function(e) {
        if (! LB.passwordCleared)
        {
          LB.passwordField.val("");
          LB.passwordCleared = true;
        }
      }
    );
  },
  close: function(e) {
    var LB = LoginBox;
    LB.loginBox.slideUp();
    LB.loginLink.removeClass('hover');
    e.preventDefault();
  },
  open: function(e) {
    var LB = LoginBox;
    // Act like a toggle
    if (LB.loginBox.is(':visible'))
      return LB.close(e);

    LB.loginBox.slideDown();
    LB.loginLink.addClass('hover');
    e.preventDefault();
  }
};
jQuery(function() { LoginBox.init(); });

//hbx.js

function _hbPageView(p,m){}

//disable spp modal
jQuery(document).ready(function() {
	jQuery("#bgDiv").css("display","none");
	jQuery("#PopupPanel").css("display","none");
});

//this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( get_cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function set_cookie(name,value,expires){
	
    /*var exp = new Date();
	var domain=".seagate.com";
	var path="/";
	var expTag = "";
	if (expires==0) {
		exp.setTime(exp.getTime() + 60*24*60*60*1000);	
		document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString()+";domain="+domain+";path="+path;
	} else {
		// let clear the cookie.
		Delete_Cookie(name, path, domain);
		exp.setTime(exp.getTime() + 24*60*60*1000);
		//alert(exp.toGMTString());
		document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString()+";domain="+domain+";path="+path;
		
	}*/
    createCookie(name,value,expires);
    
}

function createCookie(name,value,expires) {
	var date = new Date();
	var domain=".seagate.com";
    var path ="/";
	if (expires==0) {
		date.setTime(date.getTime()+(60*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
        date.setTime(date.getTime()-1);
        var expires = "";
	}	
    
    //var expires = "; expires="+date.toGMTString();    
	document.cookie = name+"="+value+expires+";domain="+domain+";path="+path;
}
	
function changeLocale(url,locale){
	
	if($("#rememberSelection").attr("checked")){
		set_cookie("userPreferredLocaleCookie",locale,0);
	} else {
		set_cookie("userPreferredLocaleCookie",locale,1);
	}
	
	//$("#localeSelectorForm").attr("action",url);
	//$("#localeSelectorForm").attr("method","post");
	//$("#localeSelectorForm").submit();
	window.location.href=url;
}				