var cookTimestamp = "Wed, 29 Dec 2012 23:23:59 GMT";
var NAV_IE=(navigator.appName.search(/microsoft internet explorer/i) > -1)?true:false;
var NAV_IE_VER = 0;
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
	NAV_IE_VER=new Number(RegExp.$1) // capture x.x portion and store as a number
}
	
var sTypeActive = "web";

function tabClick(type) {
	document.getElementById('link_'+sTypeActive).style.textDecoration = "underline";
	document.getElementById('link_'+sTypeActive).style.color = "#0066cc";
	document.getElementById('link_'+sTypeActive).style.fontWeight = "normal";
	
	document.getElementById('link_'+type).style.textDecoration = "none";
	document.getElementById('link_'+type).style.color = "#000";
	document.getElementById('link_'+type).style.fontWeight = "bold";

	sTypeActive = type;

	setFormAction(type);
}
var bMWSToolbarInstalled = false;
try{
	new ActiveXObject('MyWebSearchToolBar.SettingsPlugin');
	bMWSToolbarInstalled=true;
}catch(e){
	bMWSToolbarInstalled=false;
}

function makeHomeLink() {
	var isHPTxt='Set as Homepage';
	var globHtmlFtrSpan='<span id="hp" style="behavior:url(#default#homepage)"></span>';		
	if (NAV_IE) return globHtmlFtrSpan + "| <a href='javascript:setHomeLink();'>"+isHPTxt+"</a> ";
	return "";
}

function setHomeLink(){
	var isHPURL = location.href;
	if (!bMWSToolbarInstalled) {
		if (isHPURL.indexOf("hpset") == -1) {
			if (isHPURL.indexOf("?") != -1) {
				isHPURL += "&hpset=link";
			} else {
				isHPURL += "?hpset=link";
			}
		}
	} else {
		if (isHPURL.indexOf("hpset") == -1) {
			if (isHPURL.indexOf("?") != -1) {
				isHPURL += "&hpset=tb";
			} else {
				isHPURL += "?hpset=tb";
			}
		}				
	}
	hp.setHomePage(isHPURL);
/*
	if(bMWSToolbarInstalled && NAV_IE_VER > 6){
		document.getElementById('SettingsControl').H(isHPURL);	
	} else {
		hp.setHomePage(isHPURL);	
	}
*/		
}	
