var map_szzlg ={"建築":"jianzhu","明清宮廷":"mqgt","宮俗文化":"gswh","宮廷事件":"gtsj","宮廷典制":"gtdz","宮廷人物":"gtrw","古籍":"guji","武英殿刻本":"wydkb","陶瓷":"taoci","繪畫":"huihua","法書":"fashu","銘刻":"minke","青銅器":"qingtongqi",
		"璽引":"xiyin","織繡":"zhiziu","文房用品":"wenfangyongpin","傢具":"jiaju","鐘錶儀器":"zhongbiaoyiqi",
		"琺瑯":"falabng","漆器":"qiqi","雕塑":"diaosu","金銀錫器":"jinyinxiqi","玉石器 ":"yushiqi",
		"玻璃器":"boliqi","竹木牙角匏":"zhumuyajiaopao","宮廷宗教":"gongtingzongjiao","首飾":"shoshi","錢幣":"qianbi",
		"武備":"weibu","儀仗":"yizhang","音樂戲曲":"yinyuexiqu","生活器具":"shenghuoqiju","外國文物":"waiguowenwu","文物保護":"wenwubaohu","科研成果":"keyanchengguo","傳統工藝":"chuantonggongyi","修復記錄":"xiufujilu"};
function showThesisList(div_id,parentChanelName,chanelName)
{
	var pName,cName;		
	for(var key in map_mqgt)
	{
		if(key == parentChanelName){
			pName = map_mqgt[key];
			break;
		}
	}
	for(var key in map_mqgt)
	{
		if(key == chanelName){
			cName = map_mqgt[key];
			break;
		}
	}
	var guanCang = document.getElementById("guanCang");
	if(div_id == "lunTan"){
		if(document.getElementById(div_id).innerHTML.indexOf("<tr>") !=-1){
			document.getElementById(div_id).style.display="block";
			document.getElementById("tuiJian").style.display="none";			
			if(typeof(guanCang)!="undefined")
				guanCang.style.display="none";
		}
		else{
			if(parentChanelName=="")
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+cName+"/thesis.html");
			else
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+pName+"/"+cName+"/thesis.html");
		}
	}
	else if(div_id == "tuiJian"){
		if(document.getElementById(div_id).innerHTML.indexOf("<tr>") !=-1){
			document.getElementById(div_id).style.display="block";
			document.getElementById("lunTan").style.display="none";
			if(typeof(guanCang)!="undefined")
				guanCang.style.display="none";		}
		else{
			if(parentChanelName=="")
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+cName+"/bookTJ.html");
			else
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+pName+"/"+cName+"/bookTJ.html");

		}
	}
	else{
		if(document.getElementById(div_id).innerHTML.indexOf("<tr>") !=-1){
			document.getElementById(div_id).style.display="block";
			document.getElementById("lunTan").style.display="none";
			if(typeof(guanCang)!="undefined")
				guanCang.style.display="none";		}
		else{
			if(parentChanelName=="")
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+cName+"/bookGC.html");
			else
				window.open("http://big5.dpm.org.cn:82/gate/big5/"+window.location.host+"/search/"+pName+"/"+cName+"/bookTJ.html");
		}
	}
	
}
function showLunTanOrBook(thesisOrBook,chanelName)
{
	/*var path;	
	for(var key in map_szzlg)
	{
		if(key == chanelName){
			path = map_szzlg[key];
			break;
		}
	}
	//  www.dpm.org.cn/shtml/115/@/9036.html
	var chanelUrl = dpmLg.getUrlOfCache();
	var issmaple = dpmLg.isSimple();
	var host;
	if(issmaple)
		host = "http://big5.dpm.org.cn:82/gate/big5/"+window.location.host;
	else
		host="http://big5.dpm.org.cn:82/gate/big5/"+chanelUrl.split("/")[0];
	if(parentChanelName!=""){
		if(parentChanelName=="cangpin")
			window.open(encodeURI("/search/shuziziliaoguan/"+parentChanelName+"/common/"+thesisOrBook+".html?type="+chanelName+""));
		else
			window.open("/search/shuziziliaoguan/"+parentChanelName+"/"+path+"/"+thesisOrBook+".html");
	}
	else
		window.open("/search/shuziziliaoguan/"+path+"/"+thesisOrBook+".html");*/
	
	window.open(encodeURI("/search/shuziziliaoguan/common/book.html?"+thesisOrBook+"="+chanelName));
	
	
}

function openSearch(isNew){
				var generateEra = document.getElementById("era").value;
			var subtype = document.getElementById("sort").value;
			var title = document.getElementById("docName").value;
			var map_ = {};
			if(generateEra!="時代"){
				map_["generateEra"] = generateEra;			
			}
			if(subtype!="分類"){
				map_["subtype"] = subtype;			
			}
			if(title!=""){
				map_["title"] = title;			
			}
			var filterStr="";
			for(var key in map_){
			 filterStr += "A."+key+" like '%"+map_[key]+"%' and ";
			}
			var t = filterStr.lastIndexOf("and");
			filterStr = filterStr.substr(0,t);
			if(isNew == "new")	
				window.open(encodeURI("http://big5.dpm.org.cn:82/gate/big5/"+location.hostname+"/search/shuziziliaoguan/mqgt/common/search.html?"+filterStr),"_blank");
			else{
				window.open(encodeURI("http://big5.dpm.org.cn:82/gate/big5/"+location.hostname+"/search/shuziziliaoguan/mqgt/common/search.html?"+filterStr));
			}
			
			return false;
}
function openGUJISearch()
{
		alert("d");
			var classa = document.getElementById("sName").value;
			var filter ={};
			var objName = document.getElementById("relicName").value;
			var author = document.getElementById("author").value;
			var generateEra = document.getElementById("eraVersion").value;			
			var map_ = {};
			if(classa!="分類"){
				map_["classa"] = classa;			
			}
			if(objName!=""){
				map_["objName"] = objName;			
			}
			if(author!=""){
				map_["author"] = author;			
			}
			
			if(generateEra!=""){
				map_["generateEra"] = generateEra;			
			}
			var filterStr="";
			for(var key in map_){
				filterStr += key+" like'%"+map_[key]+"%' and ";
			}
			var t = filterStr.lastIndexOf("and");
			filterStr = filterStr.substr(0,t);
			

			
				window.open(encodeURI("http://big5.dpm.org.cn:82/gate/big5/"+location.hostname+"/search/mqgt/common/search.html?"+filterStr),"_blank");
			
			
			return false;
}


function openDoc(docUrl)
{
	return;
}
