function ViewPage(iPageIndex)
{
	var pages=document.getElementById("page");
	pages.value = iPageIndex;
	document.pagenext.submit();
}

function SelZhiYe(iValue,PosType)
{
	var GWStr = eval('document.all.GWStr[0]');
	var PosType = eval('document.all.PosType[0]');
	GWStr.value = '';
	PosType.value = '';
	if (iValue)
	{
		var iValueAry = iValue.split("-->")
		for (var i=0;i<iValueAry.length;i++)
		{
			var ValueAry = iValueAry[i].split(">");
			PosType.value += ValueAry[0]+(ValueAry[0]!=''?',':'');
			GWStr.value += ValueAry[1].replace('全部','')+(ValueAry[1]!=''?',':'');
		}
	}
	if (GWStr.value!='')
	{
		PosType.value = PosType.value.substring(0,PosType.value.length-1);
		GWStr.value = GWStr.value.substring(0,GWStr.value.length-1)
	}
	document.all.PosType[1].value = PosType.value
	document.all.GWStr[1].value = GWStr.value
}
function winOpen(Url,iPosType,iGWStr,wHs)
{
	var PassStr = "";
	PosType = eval('document.all.'+iPosType+'[0].value');
	GWStr = eval('document.all.'+iGWStr+'[0].value')
	var aPosType = PosType.split(',');
	var aGWStr = GWStr.split(',');
	for (var i=0;i<(aPosType.length<aGWStr.length?aPosType.length:aGWStr.length);i++)
	{
		PassStr += aPosType[i] + ">" + aGWStr[i] + "-->" ;
	}
	if (PassStr!="")
	PassStr = PassStr.substring(0,PassStr.length-3)
	Url = Url + '?PassStr=' + PassStr
	window.open(Url,'',wHs)
}

var runajax;
function ajaxreq(url,getid,mook){
var xmlhttp2;
try
{xmlhttp2=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){try{xmlhttp2=new XMLHttpRequest();}
catch (e){}
}
}
if (mook==0){
xmlhttp2.open("get","/"+url+"?t=" + new Date().getTime());
} else if (mook==1){
xmlhttp2.open("get","/"+url+"&t=" + new Date().getTime());
}
xmlhttp2.onreadystatechange=function()
{if(4==xmlhttp2.readyState){
if(200==xmlhttp2.status){msg=xmlhttp2.responseText;}
else{msg="网络链接失败！";}
}else{msg="数据读取中，请稍后…";
}
document.getElementById(getid).innerHTML=msg;

}
xmlhttp2.send(null);
}


function ListDateWeek()
{
	var now = new Date();
	var y = now.getYear();
	var m = now.getMonth()+1;
	if (m < 10) 
		m = "0" + m;
	var d = now.getDate();
	if (d < 10) 
		d = "0"+d;
	var h = now.getHours();
	if (h < 10)
		h = "0"+h;
	var mi = now.getMinutes();
	if (mi < 10)
		mi = "0"+mi;
	var week = now.getDay();
	var weekday;
	if (week == 0) weekday = "日";
	if (week == 1) weekday = "一";
	if (week == 2) weekday = "二";
	if (week == 3) weekday = "三";
	if (week == 4) weekday = "四";
	if (week == 5) weekday = "五";
	if (week == 6) weekday = "六";
	document.write("今天："+y+"-"+m+"-"+d+"  "+h+":"+mi+"　　星期"+weekday);
}


function CheckLogForm(obj)
{
	if (obj.UserName.value == "")
	{
		alert("请填写用户名！");
		obj.UserName.focus();
		return false;
	}
	if (obj.PWD.value == "")
	{
		alert("请填写用户名！");
		obj.PWD.focus();
		return false;
	}
	return true;
}

function save_cookie(name,value)
{
var Days = 1; //定义过期时间 单位：天
var exp  = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/;";
}
function Setmode(cookiesvalue)
{
	save_cookie("setmode",cookiesvalue);
	window.location.reload(true);
}
function CheckAll2()
  {
  for (var i=0;i<document.theForm.elements.length;i++)
    {
    var e = document.theForm.elements[i];
    if (e.name != 'chkall2')
       e.checked = document.theForm.chkall2.checked;	   
    }
  }
function CheckAll3()
  {
  if (document.theForm.chkall2.checked==true){
  document.theForm.chkall2.checked=false;
  } else {
  document.theForm.chkall2.checked=true;
  }
  for (var i=0;i<document.theForm.elements.length;i++)
    {
    var e = document.theForm.elements[i];
    if (e.name != 'chkall2')
       e.checked = document.theForm.chkall2.checked;	   
    }
  } 
function showoperatealert(id)
{		
	if (id==1){
		document.theForm.target='_self';
		document.theForm.action="/fav.asp";
		document.theForm.submit();
	}
	if (id==2){
		document.theForm.target='_self';
		document.theForm.action="/applyok.asp";
		document.theForm.submit();
	}
}
  
