// JavaScript Document
	function switchSearch(val){
	    var SearchInputValue = document.getElementById("textfield").value;
		eform = document.forms['mmosearch'];
		if(eform.hasChildNodes()){
		
			//alert("yes it has");
			while(eform.childNodes.length>=1){
			
				eform.removeChild(eform.firstChild);
			}
		}
		switch(val){
		
			case "all":
				var mmosearchUrl = "http://feature.mmosite.com/templates/2009/search.shtml";
				var mmosearchId = "searchbox_018155614125423015097:j-sj8pfqpye";
				var mmosearchMethod = "get";
				var mmosearchInput = document.createElement("input");
				var mmosearchHidden1 = mmosearchInput.cloneNode(true);
				var mmosearchHidden2 = mmosearchInput.cloneNode(true);
				mmosearchInput.name = "q";
				mmosearchInput.type = "text";
				mmosearchInput.id = "textfield";
				mmosearchInput.value = SearchInputValue;
				mmosearchHidden1.name = "cx";
				mmosearchHidden1.type = "hidden";
				mmosearchHidden1.value = "018155614125423015097:j-sj8pfqpye";
				mmosearchHidden2.name = "cof";
				mmosearchHidden2.type = "hidden";
				mmosearchHidden2.value = "FORID:10";
				eform.appendChild(mmosearchInput);
				eform.appendChild(mmosearchHidden1);
				eform.appendChild(mmosearchHidden2);
				eform.action = mmosearchUrl;
				eform.id = mmosearchId;
				eform.method = mmosearchMethod;		
			break;
			case "game":
				var gamelistUrl = "http://gamelist.mmosite.com/search.shtml";
				var gamelistMethod = "post";
				var gamelistInput = document.createElement("input");
				gamelistInput.name = "q";
				gamelistInput.type = "text";
				gamelistInput.id = "textfield";
				gamelistInput.value = SearchInputValue;
				eform.appendChild(gamelistInput);
				eform.action = gamelistUrl;
				eform.method = gamelistMethod;			
			break;
			case "player":
				var blogUrl = "http://my.mmosite.com/?controller=FriendSearch&action=Index";
				var blogMethod = "post";
				var blogInput = document.createElement("input");
				var blogIsSummit = blogInput.cloneNode(true);
				blogInput.name = "info[nickname]";
				blogInput.type = "text";
				blogInput.id = "textfield";
				blogInput.value = SearchInputValue;
				blogIsSummit.name = "is_submit";
				blogIsSummit.value = 1;
				blogIsSummit.type = "hidden";
				eform.appendChild(blogInput);
				eform.appendChild(blogIsSummit);
				eform.action = blogUrl;
				eform.method = blogMethod;
			break;
			case "client":
				var downloadUrl = "http://download.mmosite.com/down_search.php";
				var downloadMethod = "post";
				var downloadInput = document.createElement("input");
				var downloadHidden = downloadInput.cloneNode(true);
				downloadInput.name = "s_name";
				downloadInput.type = "text";
				downloadInput.id = "textfield";
				downloadInput.value = SearchInputValue;
				downloadHidden.name = "sType";
				downloadHidden.value = 1;
				downloadHidden.type = "hidden";
				eform.appendChild(downloadInput);
				eform.appendChild(downloadHidden);
				eform.action = downloadUrl;
				eform.method = downloadMethod;
			break;
		}
	}
document.write('<form name="mmosearch" action="http://feature.mmosite.com/templates/2009/search.shtml" id="searchbox_018155614125423015097:j-sj8pfqpye" method="get"><input type="hidden" name="cx" value="018155614125423015097:j-sj8pfqpye"><input type="hidden" name="cof" value="FORID:10"><input type="text" name="q" id="textfield" /></form>');
document.write('<select name="" onchange="switchSearch(this.value)">');
	document.write('<option value="all">All</option>');
	document.write('<option value="game">Game</option>');
	document.write('<option value="player">Player</option>');
	document.write('<option value="client">Client</option>');
document.write('</select><span onclick="document.forms[\'mmosearch\'].submit()">search</span>');