//主函数
function InitLoad(){
	submenu.innerHTML = GetMenuContentByMenuName("");
	document.all.frm_flashpic.src="/pk_flashpic.asp";
	MiniWeather.Weather.show(0,"Weather");	//读取天气
	//MiniWeather.Weather.print(0,"Weather","")
	//xtd_InitWeather("Weather");
	//document.all.frm_scrollpic.src="/js_NewsPicRoll.asp?lm=0&picw=130&pich=100&picx=10&n=15&pictitlesize=9";
}
function InitLoadListAndView(){
	MiniWeather.Weather.show(0,"Weather");
	//MiniWeather.Weather.print(0,"Weather","")
}
function MenuTab(menuname){
	submenu.innerHTML = GetMenuContentByMenuName(menuname);
}
//检查搜索输入框是否为空
function checkfrmSearch(theForm){if (theForm.word.value==""){alert("请输入查询关键字");theForm.word.focus();return false;}}
function LoginMail(theForm){if (theForm.username.value=="" || theForm.pass.value==""){alert("请输入用户名及密码");theForm.username.focus();return false;}else{theForm.user.value=theForm.username.value+"@pkgt.gov.cn";theForm.submit();return false;}}
//下拉列表方式的友情链接
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if (restore) selObj.selectedIndex=0;}
//选项卡切换 by LHB
function TabsChange(thisObj,Num,z,TabName,StyleName){
	if(thisObj.className == (StyleName + "1"))return;
	for(i=1; i <z+1; i++)
	{
		if (i == Num)
		{
			thisObj.className = (StyleName + "1"); 
			eval(TabName+"_Content_"+i).style.display = "block"; 
		}else{
			eval(TabName+"_Tab_"+i).className = (StyleName + "2"); 
			eval(TabName+"_Content_"+i).style.display = "none"; 
		}
	} 
}

//初始化ajax
function InitAjax(){var ajax=false;try{ajax=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{ajax=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){ajax=false;}}if(!ajax && typeof XMLHttpRequest!='undefined'){ajax=new XMLHttpRequest();}return ajax;};
function gid(id){return document.getElementById?document.getElementById(id):null;}
//上传文件//xtd_UpFile('Web2OA','frm','pic_1','doc,txt,jpg')
function xtd_UpFile(filepath,thisform,thisinput,fileext){
	var bOpen = 1;
	var strUrl = "/Include/upfile.asp?FilePath="+filepath+"&FormName="+thisform+"&InputName="+thisinput+"&FileType="+fileext;
	if (document.getElementById(thisinput).value!=""){if (!confirm("文件已上传，是否重新上传？"))bOpen=0;};
	if (bOpen==1){newWindow = window.open (strUrl,"UpFile","dependent,width=400,height=130,left=250,top=150");newWindow.focus();};
};
//Cookies操作
function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	};
	return null;
};
function createCookie(name,value,days){
	var expires = "";
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		expires = "; expires="+date.toGMTString();
	};
	document.cookie = name+"="+value+expires+"; path=/";
};
//立等可取查询
function InitRequest(){var C_req = null;try{C_req = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{C_req = new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){C_req = null;}}if (!C_req && typeof XMLHttpRequest != "undefined"){try{C_req = new XMLHttpRequest();}catch(fa){alert("对不起!您的浏览器不支持该功能,请使用Internet Explorer 6.0或FireFox浏览器!");C_req = null;}}return C_req;}
function _get(a){return document.getElementById?document.getElementById(a):null}
function search(){_get(dispid).innerHTML="<img src='image/loading.gif'>Searching...";creatrequest("pk_LDKQ.asp?name="+escape(_get(inputid).value)+"&all=0");}
function creatrequest(url){request.open("GET", url, false);request.onreadystatechange = function(){if (request.readyState == 4) {_get(dispid).innerHTML=request.responseText;}};request.send(null);}
//----------------------------------------------
function xtd_OpenNewWin(fileUrl,w,h,l,t){
	var newWindow;
	newWindow = window.open (fileUrl,"","dependent,width="+w+",height="+h+",left="+l+",top="+t);
	newWindow.focus();
};
function pk_SetFontSize(layName,fontSize){
	gid(layName).style.fontSize=fontSize+'px';
};
