//GZ58 JavaScript create by G5 desgin http://www.g58.net;
/*Share variant and function area*/
var w3c=(document.getElementById)? true:false;
var agt=navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
var ie5=(w3c && ie)? true : false;
var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
var op8=(navigator.userAgent.toLowerCase().indexOf("opera")==-1)? false:true;

window.onerror=function(){return true};

function getObj(o){
	var o=document.getElementById(o)?document.getElementById(o):o;
	return o;
}
function $(o){
	var o=document.getElementById(o)?document.getElementById(o):o;
	return o;
}

function getTargetElement(evt) {
    var elem;
    if (evt.target) {
        elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target;
    } else {
        elem = evt.srcElement;
    }
    return elem;
}

//截取指定首尾字串之间的字符
String.prototype.substringEx=function(startStr,endStr){
	var tmpstr=this.substring(this.indexOf(startStr)+startStr.length);
	return tmpstr.substring(0,tmpstr.indexOf(endStr));
}

/**/

function addFavorite(title){
	var url = window.location.href;
	if(document.all){
		window.external.addFavorite(url,title);
	}else if (window.sidebar){
		window.sidebar.addPanel(title, url, "");
	}
}



function showFlash(flashUrl,width,height){
      document.write('<object id="flashplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
      document.write('<param name="movie" value="'+flashUrl+'" />');
      document.write('<param name="quality" value="high" />');
      document.write('<param name="wmode" value="opaque" />');
	  document.write('<param name="menu" value="false" />');
 	  document.write('<param name="allowFullScreen" value="true" />');
     document.write('<embed src="'+flashUrl+'" quality="high" wmode="opaque" menu="false" allowFullScreen="true" allowScriptAccess="true"  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>');
      document.write('</object>');
}
//显示flash播放器
function showPlayer(path,width,height){
	var s;
    s='<object id="flashplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id="player" width="'+width+'" height="'+height+'">';
    s+='<param name="movie" value="'+path+'" />';
    s+='<param name="quality" value="high" />';
	s+='<param name="wmode" value="opaque" />';
    s+='<param name="allowScriptAccess" value="always" />';
 	s+='<param name="allowFullScreen" value="true" />';
	s+='<param name="menu" value="false" />';
    s+='<embed src="'+path+'" quality="high" wmode="opaque" menu="false" allowFullScreen="true" allowScriptAccess="true"  pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
    s+='</object>';
	return s;
}

function picFlashObject2(files,links,texts,configs,focus_width,focus_height){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ focus_height +'">');
	document.write('<param name="movie" value="/images/focus2.swf"><param name="quality" value="high">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&menu=false&bcastr_config='+configs+'">');
	document.write('<embed src="/images/focus2.swf" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&menu=false&bcastr_config='+configs+'" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>'); 
}

//取对象绝对top值，兼容IE、FF(有细微差别)
function getOffsetTop(obj) {
	var n = obj.offsetTop;
	while (obj = obj.offsetParent) n+= obj.offsetTop;
	return n;
}
//取对象绝对left值，兼容IE、FF
function getOffsetLeft(obj) {
	var n = obj.offsetLeft;
	while (obj = obj.offsetParent) n+= obj.offsetLeft;
	return n;
}

//超宽图片自动缩小
function ResizeImage(obj,resWidth){
	if (!obj)
		return;
	var imgs=obj.getElementsByTagName("IMG");
	for(i=0; i<imgs.length; i++){
		//if (imgs[i].className=="MyEventImage"){
			if (ie){
				imgs[i].attachEvent("ondblclick",ImageDblClick);
			}else{
				imgs[i].addEventListener("dblclick",ImageDblClick,false);
			}
			if (imgs[i].width>resWidth){
				imgs[i].width=resWidth;
				imgs[i].height=(imgs[i].height/imgs[i].width)*resWidth;
				imgs[i].alt="双击放大图片";
			}
		//}
	}
}

//双击事件处理函数
function ImageDblClick(evt){
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    if (evt) {
        var elem = getTargetElement(evt);		//get target element object
        if (elem) {
            window.open(elem.src,"","");
        }
    }
}


function winOpen(urls,winName,width,height) {
	var newwin=window.open(urls,winName,"toolbar=no,menubar=no,scrollbars=no,left=0,top=0,resizable=no,width="+width+",height="+height+",status=no,location=no");
	return newwin;
}




//菜单选择
//自动判断并选择当前页面所在菜单，并修正显示背景
function focusCurrentMenu(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=0;
	urlPre="http://"+location.host+"/";
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.indexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面URL是否与菜单项URL完全相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				menuPath=liObjs[i].getElementsByTagName("A")[0].href;
				if(location.href==menuPath)
					isHereNum=i; 
				else
					liObjs[i].className="";
			}
			if(isHereNum==0){
				//判断当前页面目录是否与菜单项目录相同，相同则选择
				for (var i=0;i<liObjs.length ;i++ ){
					menuPath=liObjs[i].getElementsByTagName("A")[0].href;
					if (menuPath.indexOf(urlPre)==-1) continue;
					menuPathPre=menuPath.substr(urlPre.length);
					menuPathPre=menuPathPre.substring(0,menuPathPre.indexOf("/"));
					if(menuPathPre==pagePathPre)
						isHereNum=i;
					else
						liObjs[i].className="";
				}
			}
			liObjs[isHereNum].className="isHere";
			window.__CurrentMenuItem=liObjs[isHereNum].childNodes[0];	//记录当前选中菜单项
			window.__HoverMenuItem=null;
			//if(liObjs[isHereNum-1]) liObjs[isHereNum-1].className="isHereNext";
		}	
	}
}
function focusCurrentMenu2(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=-1;
	urlPre="http://"+location.host+"/";
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.indexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面URL是否与菜单项URL完全相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				menuPath=liObjs[i].getElementsByTagName("A")[0].href;
				if(location.href==menuPath)
					isHereNum=i; 
				else
					liObjs[i].className="";
			}
			if(isHereNum>=0)liObjs[isHereNum].className="isHere";
		}	
	}
}
function focusCurrentMenu3(tagid){
	var isHereNum,urlPre,pagePath,menuPath,pagePathPre,menuPathPre;
	var obj=document.getElementById(tagid);
	isHereNum=-1;
	urlPre="http://"+location.host+"/";
	if (location.href.indexOf(urlPre)!=-1){
		pagePathPre=location.href.substr(urlPre.length);
		pagePathPre=pagePathPre.substring(0,pagePathPre.lastIndexOf("/"));	//取第一个目录名
		if(obj){
			var liObjs=obj.getElementsByTagName("LI");
			//判断当前页面目录是否与菜单项目录相同，相同则选择
			for (var i=0;i<liObjs.length ;i++ ){
				menuPath=liObjs[i].getElementsByTagName("A")[0].href;
				if (menuPath.indexOf(urlPre)==-1) continue;
				menuPathPre=menuPath.substr(urlPre.length);
				menuPathPre=menuPathPre.substring(0,menuPathPre.lastIndexOf("/"));
				if(menuPathPre==pagePathPre)
					isHereNum=i;
				else
					liObjs[i].className="";
			}
			if(isHereNum>=0)liObjs[isHereNum].className="isHere";
		}	
	}
}

//切换tab标签
function switchMenuTab(obj,subObjPre){
	if(!obj)return;
	obj.blur();
	var tabTleObjs=obj.parentNode.parentNode.getElementsByTagName("LI");
	if(obj!=__CurrentMenuItem){
		if(__HoverMenuItem==null)
			__CurrentMenuItem.parentNode.className="";
		else
			__HoverMenuItem.parentNode.className="";
		obj.parentNode.className="isHere";
		window.__HoverMenuItem=obj;
	}else if(__HoverMenuItem!=null && __HoverMenuItem!=__CurrentMenuItem){
		__HoverMenuItem.parentNode.className="";
		__HoverMenuItem=null;
		__CurrentMenuItem.parentNode.className="isHere";
	}
	for (var i=0;i<tabTleObjs.length;i++) {
		if(tabTleObjs[i]==obj.parentNode){
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="block";
		}else{
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="none";
		}
	}
}

//切换tab标签
function switchTab(obj,subObjPre){
	if(!obj)return;
	obj.blur();
	var tabTleObjs=obj.parentNode.parentNode.getElementsByTagName("LI");
	for (var i=0;i<tabTleObjs.length;i++) {
		if(tabTleObjs[i]==obj.parentNode){
			tabTleObjs[i].className="isHere";
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="block";
		}else{
			tabTleObjs[i].className="";
			if(document.getElementById(subObjPre+"_"+i)) document.getElementById(subObjPre+"_"+i).style.display="none";
		}
	}
}
//切换tab标签2
function switchTabShow(obj){
	if(!obj)return;
	obj.blur();
	var tobjs=obj.parentNode.parentNode.parentNode.getElementsByTagName("LI");
	for (var i=0;i<tobjs.length;i++) {
		if(tobjs[i]==obj.parentNode.parentNode){
			tobjs[i].className="isHere";
		}else{
			tobjs[i].className="";
		}
	}
}

//阻此当事件对象向上冒泡
function stopBubble(e){
	var e=e?e:window.event;
	if(window.event){
		e.cancelBubble=true;
	}else{
		e.stopPropagation();
	}
}

//**
function checkSearchForm() {	
	var keyObj=document.getElementById("keyword");
	if(keyObj.value.replace(/\s/g,"")==""){
		alert("搜索关键字不能为空!");
		keyObj.focus();
		return false;
	}
	return true;
}



//Cookie操作函数
//获得Cookie解码后的值
function GetCookieVal(offset)
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
//设定Cookie值
function SetCookie(name, value)
{
	var expdate = new Date();
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
	document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
	+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
	+((secure == true) ? "; secure" : "");
}
//获得Cookie的原始值
function GetCookie(name)
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen)
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return GetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}
//end


//Form 操作函数
function inputFocus(obj){
	if(obj)
		obj.parentNode.parentNode.style.backgroundColor='#F5F7FF';
}
function inputBlur(obj){
	if(obj)
		obj.parentNode.parentNode.style.backgroundColor='white';
}



///*选择checkbox函数*/
//objs - checkbox类型的input集合
//flag - 动作标志 1为全选 -1为反选
function selectAll(objs,flag){
	if (objs){
		if (objs.length){
			for (var i=0;i<objs.length ;i++ ){
				if (flag==1)
					objs[i].checked=true;
				if (flag==-1)
					objs[i].checked=!objs[i].checked;
			}
		}else{
			if (flag==1)
				objs.checked=true;
			if (flag==-1)
				objs.checked=!objs.checked;
		}
	}
}

function SelectInputAll(thisObj,parentObj,checkInputName)
{
	if(thisObj && parentObj)
	{
		var chkObjs=parentObj.getElementsByTagName("INPUT");
		for (var i=0;i<chkObjs.length;i++)
		{
			if (chkObjs[i].name == checkInputName)
				chkObjs[i].checked = thisObj.checked;
		}
	}
}

function isInputSelected(obj,checkInputName){
	if(!obj) return false;
	var chkObjs=obj.getElementsByTagName("INPUT");
	for (var i=0;i<chkObjs.length;i++){
		if(chkObjs[i].name==checkInputName && chkObjs[i].checked) return true;
	}
	return false;
}

//end





//改变字体大小
function ChangeFontSize(objId,size)
{
	var obj=document.getElementById(objId);
	if (obj){
		obj.style.fontSize=size+"px";
	}
	var objs=obj.getElementsByTagName("DIV");
	for (var i=0;i<objs.length ;i++ )
	{
		objs[i].style.fontSize=size+"px";
	}
	var objs=obj.getElementsByTagName("P");
	for (var i=0;i<objs.length ;i++ )
	{
		objs[i].style.fontSize=size+"px";
	}
}

//DOM兼容的showModalDialog对话框
function __ShowModalDialog(url,win,width,height){
	if (url=="" || url=="#") return false;
	if (document.all){	//IE
		window.showModalDialog(url,win,"dialogWidth="+width+"px;dialogHeight="+height+"px;scroll=yes;unadorned=no;dialogHide=yes;resizable=no;status=no;help=no;");
	}else{
		var modalWin=window.open(url,win,"width="+width+",height="+height+",menubar=no,resizable=no,toolbar=no,location=no,scrollbars=no,status=no,modal=yes");
		modalWin.moveTo((document.body.clientWidth-width)/2,(document.body.clientHeight-height)/2+100);
	}
}




//滚动函数类
function StandardScroll(root,child,cloneChild,direction,speed){
	var rootObj;
	var upT,downT,leftT,rightT;

	rootObj=document.getElementById(root);
	run=function(){
		if (direction=="up"){
			if(rootObj.parentNode.scrollTop<rootObj.offsetHeight/2)
				rootObj.parentNode.scrollTop++;
			else
				rootObj.parentNode.scrollTop=0;
		}
		if (direction=="down"){
			if(rootObj.parentNode.scrollTop>rootObj.offsetHeight/2)
				rootObj.parentNode.scrollTop--;
			else
				rootObj.parentNode.scrollTop=rootObj.offsetHeight;
		}
		if (direction=="left"){
			if(rootObj.parentNode.scrollLeft<rootObj.offsetWidth/2)
				rootObj.parentNode.scrollLeft++;
			else
				rootObj.parentNode.scrollLeft=0;
		}
		if (direction=="right"){
			if(rootObj.parentNode.scrollLeft>rootObj.offsetWidth/2)
				rootObj.parentNode.scrollLeft--;
			else
				rootObj.parentNode.scrollLeft=rootObj.offsetWidth;
		}
	}
	stop=function(){
		clearInterval(t);
	}

	start=function(){
		t=setInterval(run,speed);
	}
	
	this.init=function(){
		if (rootObj){
			document.getElementById(cloneChild).innerHTML=document.getElementById(child).innerHTML;
			start();
			if (document.all){
				rootObj.attachEvent("onmouseover",stop);
				rootObj.attachEvent("onmouseout",start);
			}else{
				rootObj.addEventListener("mouseover",stop,false);
				rootObj.addEventListener("mouseout",start,false);
			}
		}
	}
}



//JS版修正xmlhttp返回乱码，For IE
function gb2utf8(data){
	var glbEncode = [];
	gb2utf8_data = data;
	execScript("gb2utf8_data = MidB(gb2utf8_data, 1)", "VBScript");
	var t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");
	t=t.split("@");
	var i=0,j=t.length,k;
	while(++i<j) {
		k=t[i].substring(0,4);
		if(!glbEncode[k]) {
			gb2utf8_char = eval("0x"+k);
			execScript("gb2utf8_char = Chr(gb2utf8_char)", "VBScript");
			glbEncode[k]=escape(gb2utf8_char).substring(1,6);
		}
		t[i]=glbEncode[k]+t[i].substring(4);
	}
	gb2utf8_data = gb2utf8_char = null;
	return unescape(t.join("%"));
}




function CheckLoginForm()
{
	if(document.loginForm.username.value=="")
	{
		alert("请输入用户名！");
		document.loginForm.username.focus();
		return false;
	}
	if(document.loginForm.password.value == "")
	{
		alert("请输入密码！");
		document.loginForm.password.focus();
		return false;
	}
	if(document.loginForm.checkCode.value == "")
	{
		alert("请输入验证码！");
		document.loginForm.checkCode.focus();
		return false;
	}
	return true;
}

//显示浮动菜单
function floatMenu_Show(itemName,itemLink){
	var theEvent = window.event || arguments.callee.caller.arguments[0];
	var eventObj=getTargetElement(theEvent);
	window.floatMenuOverFlag=false;	//是否选择了浮动菜单全局标志
	//window.floatMenuT=null;
	if (document.getElementById("floatMenu")) document.body.removeChild(document.getElementById("floatMenu"));
	//弹出菜单，但未将鼠标覆盖至菜单上即移动到它处时，3秒后自动消失菜单
	if(window.floatMenuT)window.clearTimeout(window.floatMenuT);
	window.floatMenuT=window.setTimeout("if(floatMenuOverFlag==false){floatMenuOverFlag=true;var obj=document.getElementById('floatMenu');if(obj)document.body.removeChild(obj);}",3000);
	//显示菜单
	var floatMenu=document.createElement("DIV");
	floatMenu.id="floatMenu";
	floatMenu.style.position="absolute";
	floatMenu.style.top=getOffsetTop(eventObj)+23+"px";
	floatMenu.style.left=getOffsetLeft(eventObj)+"px";
	floatMenu.onmouseout=floatMenu_Hidden;
	floatMenu.onmouseover=function(){floatMenuOverFlag=true};
	document.body.appendChild(floatMenu);

	var nameArr,linkArr,strs;
	nameArr=itemName.split("|");
	linkArr=itemLink.split("|");
	strs="";
	for (var i=0;i<nameArr.length ;i++ )
		strs+="<li><a href='javascript:;' onclick='document.getElementById(\"selContent\").value=\""+nameArr[i]+"\";document.getElementById(\"contentId\").value=\""+linkArr[i]+"\";document.body.removeChild(document.getElementById(\"floatMenu\"));'>"+nameArr[i]+"</a></li>";
	floatMenu.innerHTML="<ul>"+strs+"</ul>";
}
//移除浮动菜单
function floatMenu_Hidden(theEvent){
	var x,y;
	//var theEvent = window.event || SearchEvent();
	if (!theEvent) theEvent=window.event;
	var floatObj=document.getElementById("floatMenu");
	if (floatObj && floatMenuOverFlag==true)
	{
		x=theEvent.clientX+document.documentElement.scrollLeft;
		y=theEvent.clientY+document.documentElement.scrollTop;
		//+2为修正在IE下的误差
		if (x<getOffsetLeft(floatObj)+2 || x>=getOffsetLeft(floatObj)+floatObj.offsetWidth || y<getOffsetTop(floatObj) || y>=(getOffsetTop(floatObj)+floatObj.offsetHeight))
			document.body.removeChild(floatObj);

		floatMenuOverFlag=false;
	}
}
/**/

function picFlashObject(pics,links,texts,focus_width,focus_height,text_height){
	if(ie && agt.indexOf("msie 7")==-1) focus_height+=3;
	var swf_height = focus_height+text_height;
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/images/focus.swf"> <param name="quality" value="high"><param name="bgcolor" value="#eeeeee">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed src="/images/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#eeeeee" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}



/***分页导航条，样式为 上一页 |<< << 1 2 3 4 >> >>| 下一页 ***
参数说明：
iPage - 当前页码
iTotal - 记录总数
iPageSize - 每页显示最多记录数
sFileName - 页码所指URL链接模板
sPageNumFlag - URL模板中是页码特征字串，会被替换为实际页数
sPageExt - URL链接扩展名
iPageCount - 每页的导航条最多页码列表数
示例：
*/
function ShowPageNavigation(iPage,iTotal,iPageSize,sFileName,sPageNumFlag,sPageExt,iPageCount){
	var strs,totalPage,totalLayer,currentLayer,firstPage,lastPage,previousLayer,nextLayer,startPage,endPage;
	var strFirst,strLast,strPreviousLayer,strNextLayer,strPrevious,strNext;
	var strLinkFirst,strLinkLast,strLinkPreviousLayer,strLinkNextLayer,strLinkPreviousPage,strLinkNextPage;
	var isEnd,i,firstPageFlag,otherPageFlag;
	
	if (sFileName=="" || iTotal=="" || iTotal==0 || iPageSize=="" || iPageSize==0) return "";
	if (!iPage>0){iPage=1}else{iPage=parseInt(iPage)};
	if (!iPageCount>0) iPageCount=10;

	//otherPageFlag=sPageNumFlag.replace("_","");
	otherPageFlag=sPageNumFlag;
	firstPageFlag=sPageNumFlag;

	if((iTotal%iPageSize)==0){totalPage=parseInt(iTotal/iPageSize)}else{totalPage=parseInt(iTotal/iPageSize)+1};
	if (iPage>totalPage) iPage=totalPage;
	firstPage=1;
	lastPage=totalPage;
	if(iPage==1) firstPage=0;
	if(iPage==totalPage) lastPage=0;
	if((iPage%iPageCount)==0) isEnd=true;			//判断当前页是否为页码列表的最后一个
	totalLayer=parseInt(totalPage/iPageCount)+1;	//所有页码列表层总数，以1开始
	currentLayer=parseInt(iPage/iPageCount)+1;		//当前页码列表层数，以1开始
	if(isEnd) currentLayer=currentLayer-1;			//当 当前页码是本页页码列表的最后一个时，修正当前页码层数

	if(currentLayer==1){ previousLayer=0 }else{ previousLayer=(currentLayer-1)*iPageCount};	//前一层页码：取前一层页码列表最后一页页码数
	if(currentLayer==totalLayer){ nextLayer=0 }else{ nextLayer=currentLayer*iPageCount+1};	//后一层页码：取后一层页码列表最前一页页码数
	//本层具体页码数起始范围
	startPage=previousLayer+1;
	if(currentLayer<totalLayer){ endPage=nextLayer-1} else{ endPage=totalPage};	//取导航列表的最后一个页码值
	//向前向后相关定位字串，图片
	strFirst="<img alt=\"首页\" title=\"首页\" src=\"/images/First.gif\" />";
	strLast="<img alt=\"尾页\" title=\"尾页\" src=\"/images/last.gif\" />";
	strPreviousLayer="<img alt=\"前" + iPageCount + "页\" title=\"前" + iPageCount + "页\" src=\"/images/Previous.gif\" />";
	strNextLayer="<img alt=\"后" + iPageCount + "页\" title=\"后" + iPageCount + "页\" src=\"/images/Next.gif\" />";
	strPrevious="上一页";
	strNext="下一页";

	//向前向后相关链接
	strLinkFirst=sFileName.replace(firstPageFlag,"1")+sPageExt;
	strLinkLast=sFileName.replace(otherPageFlag,lastPage)+sPageExt;
	strLinkPreviousLayer=sFileName.replace(otherPageFlag,previousLayer)+sPageExt;
	strLinkNextLayer=sFileName.replace(otherPageFlag,nextLayer)+sPageExt;
	//if(iPage==2){strLinkPreviousPage=sFileName.replace(firstPageFlag,"")+sPageExt}else{strLinkPreviousPage};
	strLinkPreviousPage=sFileName.replace(firstPageFlag,iPage-1)+sPageExt
	strLinkNextPage=sFileName.replace(otherPageFlag,iPage+1)+sPageExt;

	strs="";
	//首页字串
	if(firstPage==0){
		strs+="&nbsp;"+strFirst;
	}else{
		strs+="<a href=\"" + strLinkPreviousPage + "\" target=\"_self\">" + strPrevious + "</a>";	//上一页
		strs+="&nbsp;<a href=\"" + strLinkFirst + "\" title=\"前往首页\" target=\"_self\">" + strFirst + "</a>"; //首页
	}
	//前一层页码字串
	if(previousLayer<=0)
		strs+="&nbsp;" + strPreviousLayer;
	else
		strs+="&nbsp;<a href=\"" + strLinkPreviousLayer + "\" title=\"前" + iPageCount + "页\" target=\"_self\">" + strPreviousLayer + "</a>";

	for(var i=startPage;i<=endPage;i++){
		if(i==iPage)
			strs+="<span class=\"isHere\">" + i + "</span>";
		else
			strs+="<span><a href=\"" + ((i==1)?sFileName.replace(firstPageFlag,"1"):sFileName.replace(otherPageFlag,i)) + sPageExt + "\" target=\"_self\">" + i + "</a></span>";
	}

	if(nextLayer<=0)
		strs+="&nbsp;" + strNextLayer;
	else
		strs+="&nbsp;<a href=\"" + strLinkNextLayer + "\" title=\"后" + iPageCount + "页\" target=\"_self\">" + strNextLayer + "</a>";
	
	if(lastPage<=0){
		strs+="&nbsp;" + strLast;
	}else{
		strs+="&nbsp;<a href=\"" + strLinkLast + "\" title=\"尾页\" target=\"_self\">" + strLast + "</a>";
		strs+="&nbsp;<a href=\"" + strLinkNextPage + "\" target=\"_self\">" + strNext + "</a>";		//下一页
	}
	strs+="&nbsp;&nbsp;共" + iTotal + "条&nbsp;" + totalPage + "页";
	strs+="&nbsp;" + iPageSize + "条/页";
	if(totalPage<=100){
		strs+="&nbsp;<select size=\"1\" id=\"PageNavigation\" onchange=\"location.href=this.value\" style=\"font-family:verdana;font-size:10px;\">";
		for(var i=1;i<=totalPage;i++){
			strs+="<option value=\"";
			if(i==1)
				strs+=sFileName.replace(firstPageFlag,"");
			else
				strs+=sFileName.replace(otherPageFlag,i);
			strs+=sPageExt + "\"";
			if(i==iPage) strs+=" selected";
			strs+=">" + i + "</option>";
		}
		strs+="</select>";
	}
	strs+="<input type=\"hidden\" name=\"pageUrl\" id=\"pageUrl\" value=\"" + sFileName + sPageExt + "\" />";
	return strs;
}
//跳转页码
function JumpPage(p){
	if(iTotalPages=="undefined" || !iTotalPages>0)return;
	if(sFilePath=="undefined" || sFilePath=="")return;
	location.href=(p==1)?sFilePath.replace('_{{{page}}}',''):sFilePath.replace('{{{page}}}',iTotalPages+1-p);
}

//跳到指定页码
function __JumpPage(n){
	if(/[\D]/.test(n)){
		alert("只能为数字");
		return;
	}
	if(document.getElementById("pageUrl")){
		var pageUrl=document.getElementById("pageUrl").value;
		if(pageUrl!=""){
			if(n==1)	//为第一页时不带页号
				location.href=pageUrl.replace("_{{{page}}}","");
			else	//替换地址模板为相应页号
				location.href=pageUrl.replace("{{{page}}}",n);
		}
	}

}

function focusClassMenu(oName,aName){
	var obj=document.getElementById(oName);
	if(!obj) return;
	if(aName=="undefined" && aName!="") return;
	var aObjs=obj.getElementsByTagName("A");
	for(var i=0;i<aObjs.length;i++){
		if(aObjs[i].name==aName){
			aObjs[i].parentNode.className+=" isHere";
		}else{
			aObjs[i].parentNode.className=aObjs[i].parentNode.className.replace("isHere","");
		}
	}
}



/*菜单树事件处理*/
function menuTree(id){
	var obj=getObj(id);
	var imgs=obj.getElementsByTagName("IMG");
	for (i=0; i<imgs.length; i++){
		if (imgs[i].className=="click"){
			if (ie){
				imgs[i].attachEvent("onclick",menuClick);	//add event for ie
			}else{
				imgs[i].addEventListener("click",menuClick,false);	//add event for w3c
			}
		}
	}
}

function menuClick(evt){
    evt = (evt) ? evt : ((window.event) ? window.event : "");
    if (evt) {
        var elem = getTargetElement(evt);
        if (elem) {
            elem.parentNode.className=elem.parentNode.className=="open"?"close":"open";		//exchange node's class name
        }
    }
}
/**/

//统计点击
function countHits(url){
	this.CallBack=function(strs){
		if(strs.replace(/\s/g,"")!="")eval(strs);
	};
	this.WaitProc=function(){};
	__XmlHttpPool__.GetRemoteData(url,this.CallBack,this.WaitProc);
}

function getRemoteJs(url){
	this.CallBack=function(strs){
		if(strs.replace(/\s/g,"")!="")eval(strs);
	};
	this.WaitProc=function(){};
	__XmlHttpPool__.GetRemoteData(url,this.CallBack,this.WaitProc);
}

//取URL参数值
function getUrlParam(pname){
	var arr=new Array;
	if(location.search=="")return null;
	var params=location.search.substr(1);
	if(location.search.indexOf(pname+"=")==-1)return null;
	var re = new RegExp("(&|^)[^&]*(" + pname + ")\=([^&]*)","ig");
	while(re.exec(params)){
		arr.push(RegExp.$3);
	}
	if(arr.length==0)
		return null;
	else if(arr.length==1)
		return arr[0];
	else if(arr.length>1)
		return arr;
}



