
setTimeout("search.init()",100)
var search={
	type:['金幣','點卡','代練','遊戲','新聞'],	/*,'産品'*/
	game:["","仙境傳說","DNF","未來啟示錄","武林群俠傳","風色幻想","赤壁","econline","信長之野望","永恆之塔","楓之谷","德州撲克","希望","誅仙2","玄武豪俠轉","守護之星","魔神傳","新俠義道","獸血沸騰","黑色陰謀","希望戀曲","熱血江湖","暗黑","夢幻古龍","反鬥西遊","萬王之王3","光明戰記","王者世界","彩虹氣泡","霸世王朝","風色英雄傳","完美世界","艾爾之光","大航海時代","AIKA","閣影新世紀","夢之樂章","吞食天地2","天上人間","神鬼奇兵","征途","嗜血DNA","瑪奇","女神","墨湘","魔物獵人","劍狐傳奇","明朝時代","夢之歷險","巨商","幻月之歌","奇妙之旅","夢夢","中華英雄","ROHAN-洛汗","夢幻誅仙","龍之谷","龍online","成吉思汗","夢之希望","幻武","天龍八部","劍俠世界","KAROS","天堂II","魔獸世界","AION永恆","德克薩斯撲克","RF","天子傳奇","瞳光IRIS","皮歐Q"],
	key:[],
	init:function(){
		if(typeof $$!="function"){setTimeout("search.init()",100);return;}
		o=$$("search_type")
		if(!o){setTimeout("search.init()",100);return;}
		o.onmouseover=function(){this.className="Com_input_over sinput_over";}
		o.onmouseout=function(){this.className="Com_input_out sinput_out";}
		o.onfocus=function(){this.className="Com_input_over sinput_over";}
		o.onblur=function(){this.className="Com_input_out sinput_out";}
		o.onclick=function(){run('dropbox.open',this.id,search.type,function(){})}
		if(request.t!=null)o.value=request.t	;
		
		o=$$("search_gamelist")
		if(o){
		o.onmouseover=function(){this.className="Com_input_over sinput_over";}
		o.onmouseout=function(){this.className="Com_input_out sinput_out";}
		o.onfocus=function(){this.className="Com_input_over sinput_over";}
		o.onblur=function(){this.className="Com_input_out sinput_out";}
		o.onclick=function(){
			run('dropbox.open',this.id,search.game,function(){})}
		if(request.g!=null)o.value=request.g;
		}
		
		o=$$("search_wordkey")
		o.onmouseover=Com_input_over
		o.onmouseout=Com_input_out
		o.onfocus=Com_input_over
		o.onblur=Com_input_out
		if(request.k!=null)o.value=request.k;

		o=$$("search_word_key")
		if(o){
			v=o.value
			v=v.replace(/，/g,",")
			a=v.split(",")
			search.key=a
			
			o=$$("search_wordkey")
			o.onclick=function(){run('dropbox.open',this.id,search.key,function(){})}
			o.onkeyup=function(e){
				v=$$("search_wordkey").value
				if(v.length==0)return;
				a=new Array();
				for(var i=0;i<search.key.length;i++){
					if(search.key[i].indexOf(v)>-1){
						a.push(search.key[i])
						if(a.length>20)break;
					}
				}
				if(a.length==0)return;
				run('dropbox.open',this,a,function(){})
				
			}
		}
		
		
	},
	submitf:function(){
		url="/Search.asp?ram="+Math.random()
		d=search.type
		o=$$("search_type")
		v=o.value
		isok=0;
		for(var i=0;i<d.length;i++){
			if(d[i]==v){
				isok=1	
				break;
			}
		}
		
		if(isok==0){
			o.focus();
			run("box.opentip","查詢錯誤","查詢類型不正確,請重新填寫!")
			return;
		}
		url+="&t="+v
		d=search.game
		o=$$("search_gamelist")
		if(o){
			v=o.value
			if(v.length==0){
				isok=1	
			}else{
				isok=0;
				for(var i=0;i<d.length;i++){
					if(d[i]==v){
						isok=1	
						break;
					}
				}
			}
			url+="&g="+v
		}
		if(isok==0){
			run("box.opentip","查詢錯誤","遊戲不正確,請重新填寫!")
			o.focus();
			return;
		}
		
		o=$$("search_wordkey")
		v=o.value
		url+="&k="+v
		
		location.href=url
	},
	
	end:""
}


