// JavaScript Document

function killErrors(){
	return true;
}

function SA(){
	var tmp=document.form.listid;
	if(!tmp.length)tmp=[tmp];
	for (var i=0;i<tmp.length;i++){
		tmp[i].checked=!tmp[i].checked;
	}
} 

function CheckBox(inNum)
{
var tmp=inNum;
if(!tmp.length)tmp=[tmp];
for (var i=0;i<tmp.length;i++)
{
tmp[i].checked=!tmp[i].checked;
}
}
function ChkSelected(Obj,ChkObj)
{
	if (Obj)
	{
		for (var i=0;i<Obj.length;i++){
			Obj.options[i].selected=true;
		}
	}
}
function sele(o){ 
    var oobj=document.getElementById("select") 
    if (oobj.style.display=="none"){ 
        oobj.style.display="" 
        var obj=oobj.getElementsByTagName("a"),j=obj.length 
        for (var i=0;i<j;i++){ 
            obj[i].onclick=function(){ 
                o.value=this.innerHTML; 
                oobj.style.display="none" 
            } 
        } 
    } 
    else oobj.style.display="none" 
} 
function sele1(o){ 
    var oobj=document.getElementById("select1") 
    if (oobj.style.display=="none"){ 
        oobj.style.display="" 
        var obj=oobj.getElementsByTagName("a"),j=obj.length 
        for (var i=0;i<j;i++){ 
            obj[i].onclick=function(){ 
                o.value=this.innerHTML; 
                oobj.style.display="none" 
            } 
        } 
    } 
    else oobj.style.display="none" 
} 

function UnCheckBox(inNum)
{
var tmp=inNum;
if(!tmp.length)tmp=[tmp];
for (var i=0;i<tmp.length;i++)
{
tmp[i].checked=!tmp[i];
}
}

function display(ID){
	if (document.getElementById(ID).style.display == "none"){
		document.getElementById(ID).style.display = "";
	}else{
		document.getElementById(ID).style.display = "none";
	}
}



function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\" title='第 1 页'><FONT face=Webdings>9</FONT></a> ");
	document.write("<a href=\"" + sUrl + i + "\" title='上一页(第 " + i + " 页)'><FONT face=Webdings>7</FONT></a> ");
	for(i=Math.max(1,iPage-5);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+5);i++){
		document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+5) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\" title='下一页(第 " + i + " 页)'><FONT face=Webdings>8</FONT></a> ");
	document.write("<a href=\"" + sUrl + iCount + "\" title='最后一页(第 " + iCount + " 页)'><FONT face=Webdings>:</FONT></a> ");
}

function AddUrl(cnt){
	if (cnt!=null&&cnt!="" ){
		for (var i =0; i< cnt;i++){
			var thisurl='地址名称('+(document.myform.URL.length+1)+')|';
			var urll=thisurl + document.getElementById('aaa').value+(document.myform.URL.length+1).toString() + document.getElementById('bbb').value;
			if(urll!=null&&urll!=''){
				document.myform.URL.options[document.myform.URL.length]=new Option(urll,urll);
			}
		}
	}else{
		alert("请输入次数");
	}
}

function AddUrl2(){
	var thisurl='地址名称('+(document.myform.URL.length+1)+')|http://';
	var url=prompt('请输入地址名称和链接，中间用“|”隔开：',thisurl);
	if(url!=null&&url!=''){document.myform.URL.options[document.myform.URL.length]=new Option(url,url);}
}

function ModifyUrl(){
	if(document.myform.URL.length==0) return false;
	var thisurl=document.myform.URL.value;
	if (thisurl=='') {alert('请先选择一个地址，再点修改按钮！');return false;}
	var url=prompt('请输入地址名称和链接，中间用“|”隔开：',thisurl);
	if(url!=thisurl&&url!=null&&url!=''){document.myform.URL.options[document.myform.URL.selectedIndex]=new Option(url,url);}
}

function DelUrl(){
	if(document.myform.URL.length==0) return false;
	var thisurl=document.myform.URL.value;
	if (thisurl=='') {alert('请先选择一个地址，再点删除按钮！');return false;}
	if(document.myform.URL.selectedIndex==0){alert('不能删除第一个地址！');return false;}
	document.myform.URL.options[document.myform.URL.selectedIndex]=null;
}

function AddItem(strFileName){
	document.myform.IncludePic.checked=true;
	document.myform.IndexPicUrl.value=strFileName;
	document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);
	document.myform.DefaultPicList.selectedIndex+=1;
}

function ShowMenu(){
	var barCTT=document.getElementById("dNavBar");
	var liArr=barCTT.getElementsByTagName("a");
	var links=new Array();
	for (i=0;i<liArr.length;i++){
		liArr[i].onclick=function(){
			selectThis(this,liArr,links)
		}
	}
}

function selectThis(indexObj,allLi,infoArr){
	var index=0;
	for (i=0;i<allLi.length;i++){
		allLi[i].className="NoActive";
		if (indexObj==allLi[i]){
			index=i;
		}
	}
	indexObj.className="Active";
}
window.onerror=killErrors;