function GetSearch(o){
	// find inputs and send away
	// webtrends
	
	var form = o.form;
	var q = form.elements["q"];
	var qs = o.getAttribute("qs");
	
	var s =  "?";
	var g = o.getAttribute("guid");
	var v;
	var len = form.elements.length;
	for (var i =0; i< len; i++){
		if ((form.elements[i].type == "hidden" || form.elements[i].type == "text") && form.elements[i].getAttribute("guid") == g){
		 // clean value
			v = String(form.elements[i].value).replace("<","").replace(">","").replace(/(^\s*)|(\s*$)/g, '');
			s += form.elements[i].name +"="+ v +"&";
		}
		
	}
	s = qs + encodeURI(s);
	// webtrends
	trackLSB(q.value,qs);
	window.location.href = s;
}

function doFocus(o){
	// get default text
	var t = o.getAttribute("defaultText");
	if (o.value == t){
		o.value = "";
		o.style.fontStyle = "normal";
		o.style.color = "#333";
	}
}
function doBlur(o){
	var t= o.getAttribute("defaultText");
	if (o.value == "" || o.value == t){
		o.value = t;
		o.style.fontStyle = "italic";
		o.style.color = "#ccc";
	}
}
function doKeypress(o,e){
	if (window.event) e = window.event;
	var keyCode = e.which || e.keyCode;
	if (keyCode == 13){
		if (!window.event){
			e.preventDefault();
		}
		GetSearch(o);
	}
	
}

// to be considered
function trackLSB(qu,url) 
{ 
		
	if (typeof dcsMultiTrack == "function") 
	{ 
		// get url (http://search.microsoft.com/results.aspx, http://www.bing.com/search
		var u = String(url);
		var dcssip = u.split("http://")[1].split("/")[0];
		
		var dcsuri = u.substring(u.indexOf("/",8));
		
		var ti; 
		if (u.indexOf("bing") > -1) 
		{ 
			ti = "SearchButton: Web"; 
		} 
		else 
		{ 
			ti = "SearchButton: OnSite"; 
		} 
		dcsMultiTrack("DCS.dcsuri", dcsuri, "DCS.dcssip", dcssip, "WT.ti", ti, "WT.dl", "2", "WT.z_srch_t", qu, "DCS.dcsqry", "", "WT.ad", "", "WT.mc_id", ""); 
		DCS.dcsuri=DCS.dcssip=DCS.dcsqry=WT.ti=WT.z_srch_t="";
	} 
}
