

var colors=new Array();
colors[0] = 0
colors[1] = "#FF3300"
colors[2] = "#FF6633"
colors[3] = "#0000ff"
colors[4] = "#FFCC99"
colors[5] = "#00ff00"
colors[6] = "#FFCCFF"
colors[7] = "#FF99CC"

function ColorChange() {
if (++colors[0]==colors.length) colors[0]=1;
document.all.ColorChange.style.color = colors[colors[0]];
document.all.ColorChange1.style.color = colors[colors[0]];
window.tm=setTimeout('ColorChange()',100)
}



function OpenWin(url, w, h){
  return showModalDialog(url, "---", "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:0;help:no")
}

function swap(oImg,oDiv){
	if (oDiv.style.display=='none'){
		oDiv.style.display='block';
		oImg.src="/image/minus.gif";
	}
	else{
		oDiv.style.display="none";
		oImg.src="/image/plus.gif";
	}
}
function chkDate8(s){
  if(s.length>0){
    if(s.length != 8)
       return false;
  }
  return true;
}
function extractFileExt(s){
	var i=s.lastIndexOf(".");
	if(i>=0)
		return s.substring(i+1);
	else
		return "";
}
document.onkeydown=function(){
	var oSrc = event.srcElement;
	var sType='';
/*	if(event.keyCode==117||event.keyCode==116||event.keyCode==114){// F6、F5、F3 禁止
		event.keyCode=0;
		event.returnValue=false;
	}
*/
/*	if (oSrc.tagName == 'INPUT' && event.keyCode == 13){
		if (oSrc.type) 
			sType = oSrc.type.toUpperCase();	
		else
			sType = oSrc.Type.toUpperCase();
		if (sType == 'TEXT' || sType == 'PASSWORD') event.keyCode = 9;
	}*/
}
/*
document.onselectstart=function(){
	var sTagName=event.srcElement.tagName;
	if(sTagName!='INPUT'&&sTagName!='TEXTAREA'){
		event.keyCode=0;
		event.returnValue=false;
	}
}*/
function trim(s){
	while(s.charAt(0)=="　"){
		s=s.substr(1);
	}
	while(s.charAt(s.length-1)==" "){
		s=s.substr(0,0);
	}
	return s;
}
function submitchks(frm,act) {
if(!isCheck(frm.chks)){
	alert("没有选择要操作的内容，选择请勾选标题前面的复选框");
  }
else
  {
  if(!confirm("！！！\n确定要执行此操作吗？请谨慎\n！！！！")) {return false;}
  frm.hdnaction.value=act;
  frm.submit();
  }
}
function chkDate(s){
	if(s.length!=19||!ChkStr(s,"0123456789-: ")) return false;
	if(s.charAt(4)!="-"||s.charAt(7)!="-"||s.charAt(10)!=" "||s.charAt(13)!=":"||s.charAt(16)!=":")	return false;
	return true;
}
function datediff(dt1,dt2){
	execScript('n = datediff("d", "'+dt1+'", "'+dt2+'")','vbscript');
	return -n;
}
function setstatus(s){
	window.status=s;
}
function rpt(link){
	try{
		var tmpwin=window.open(link,"", "toolbar=1,resizable=1,scrollbars=1,menubar=1,dependent");
		tmpwin.focus();
	}
	catch(e){}
}
