document.write("<TABLE border=0 cellpadding=5 cellspacing=8>");
document.write("<TR><TD width='190' align='center'><a STYLE='text-decoration:none' href='http://www.bigdevil.com/index.html'><IMG SRC='http://www.bigdevil.com/images/indexImages/bd_logo.gif' WIDTH='165' HEIGHT='51' BORDER='0' ALT=''></a></TD>");
document.write("<TD><Form name='sf' id='sf' method='post' style='margin: 0px;' action='/web' target='_top' onsubmit='return searchBoxValidator()'>");
document.write("<div class='live_tab'><div class='box_txt'>");
document.write("<A HREF='#' class='txt_blue' id='web' onclick='setSearchForm(this.id);return false;'>Web</A> | ");
document.write("<A HREF='#' class='txt_orng' id='videos' onclick='setSearchForm(this.id);return false;'>Video</A> | ");
document.write("<A HREF='#' class='txt_orng' id='images' onclick='setSearchForm(this.id);return false;'>Images</A> | "); 
//document.write("<A HREF='http://bigdevil.pgpartner.com/search_attrib.php/form_keyword=ipod' class='txt_orng'>Shopping</A> | "); 
document.write("<A HREF='#' class='txt_orng' id='news' onclick='setSearchForm(this.id);return false;'>News</A>");


//document.write("<a id='nav' class='list'>");
/*
document.write("<span class='span'>More<ul>");
document.write("<li><a href='/mapsSearch'>Maps/Directions</a></li>");
document.write("<li><a href='/yellowPagesSearch'>Yellow Pages</a></li>");
document.write("<li><a href='/weatherSearch'>Weather</a></li>");
document.write("<li><a href='/onlineGames?games='>Games</a></li>");
document.write("<li><a href='/us_lottery?lucky number'>Lottery</a></li>");
document.write("<li><a href='/horoscope?astrology'>Horoscope</a></li>");
document.write("<li><a href='/flightSearch'>Flight Tracker</a></li>");
document.write("</ul></span></a>");
*/
//document.write("</a>");
document.write("</div><div><input TYPE='text' id='q' name='q' value='' size='38' style='font: 18px arial;'>");
document.write(" <INPUT class='live_bttn' name='searchButton' type='submit' value='Web Search' style='cursor:hand;cursor:pointer;width:120px;height:27px;'>");
document.write("</div></div></form></TD></TR></TABLE>");


//var searchTabs=new Array("web","videos" ,"images" , "shopping", "news");
var searchTabs=new Array("web","videos" ,"images" , "news");

function onload(){
	var p;
	url=document.URL;
	if(url.indexOf("?t=")>0){
		x=url.substr(url.indexOf("?t="),url.length);
		p=url.substr(url.lastIndexOf("=")+1);
	}else{p="web";}
	setSearchForm(p, "onload");
}

/*
startList = function() { 
	//alert("hi");
	if (document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="SPAN") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
*/


function setSearchForm(d,k){
	//alert("hello");
		var action="";
		var buttonText="";
		setActiveSearchTab(d);
		if(d=="web"){
			action="/web";			
			buttonText="Web Search";
		}else if(d=="videos"){
			action="/videos?clips";
			buttonText="Video Search";
		}else if(d=="images"){
			action="/web?action=image";
			buttonText="Image Search";
		}else if(d=="news"){
			action="/newssearch?onlinenews=";
			buttonText="News Search"
		}
		document.sf.action=action;
		if(document.sf.q.value != "" || d=="news"){
			if(k != "onload"){
				document.sf.submit();
			}
		}
		document.sf.searchButton.value=buttonText;
		document.sf.q.focus();
	}


	function setActiveSearchTab(id){
		for(i=0;i<searchTabs.length;i++){
			var obj= document.getElementById(searchTabs[i]);
			if(obj!=undefined){obj.setAttribute("class", "txt_orng");obj.setAttribute("className", "txt_orng");}
		}
		var obj= document.getElementById(id);
		if(obj!=undefined){obj.setAttribute("class", "txt_blue");obj.setAttribute("className", "txt_blue");}

	}
	//window.onload=startList();

	function setCookie(c_name,value,expireMin)
	{	
		var exdate=new Date();
		exdate.setMinutes(exdate.getMinutes()+expireMin);
		document.cookie=c_name+ "=" +escape(value)+
		((expireMin==null) ? "" : ";expires="+exdate.toGMTString());
	}