﻿<!--
function $(_id){
	return document.getElementById(_id);
}
function chkConfirm(_msg){
	if(confirm(_msg)){
		event.returnValue=true;
	}else{
		event.returnValue=false;
	}
}
function countDown(objSecs,objName){
	$(objName).innerHTML=objSecs;
	if(--objSecs>0)setTimeout('countDown('+objSecs+',"'+objName+'")',1000);
	if(objSecs==0)history.go(-1);
}
//CheckBox Status For Form
function fwholeAll(formID){
   for(var i=0; i<document.forms[formID].length; i++){
      if (document.forms[formID][i].tagName=="INPUT"){
         if (document.forms[formID][i].type=="checkbox"){
             document.forms[formID][i].checked=true;
         }
      }
   }
}
function freverseAll(formID){
  for(var i=0; i<document.forms[formID].length; i++){
  	if (document.forms[formID][i].tagName=="INPUT"){
	 	if (document.forms[formID][i].type=="checkbox"){
		 	if(document.forms[formID][i].checked==false){
				document.forms[formID][i].checked=true;
			}else{
				document.forms[formID][i].checked=false;
			}
		 }
  	}
  }
}
function fcancelAll(formID) {
  for(var i=0; i<document.forms[formID].length; i++){
      if (document.forms[formID][i].tagName=="INPUT"){
         if (document.forms[formID][i].type=="checkbox"){
             document.forms[formID][i].checked=false;
         }
      }
  }
}
function chkFormExec(_sltID,_btnID){
	var sltObj=$(_sltID)
	var btnObj=$(_btnID);
	if(sltObj.selectedIndex!=0){
		btnObj.value='执行['+sltObj.options[sltObj.selectedIndex].innerHTML+']操作';
	}else{
		btnObj.value='执行操作';
	}
	if(sltObj.value!='0'){
		btnObj.disabled=false;
	}else{
		btnObj.disabled=true;
	}
}
function tableUpMove(_id){
	var curTr=getSelectTr(_id);
	if((curTr.rowIndex-1)<0){
		return false;
	}else{
		var up_rowIndex=curTr.rowIndex-1;
	}
	var upTr=$(_id).rows[up_rowIndex];
	upTr.swapNode(curTr);
	curTr.cells[0].firstChild.checked=true;
}
function tableDownMove(_id){
	var curTr=getSelectTr(_id);
	if((curTr.rowIndex+1)==$(_id).rows.length){
		return false;
	}else{
		var down_rowIndex=curTr.rowIndex+1;
	}
	var downTr=$(_id).rows[down_rowIndex];
	downTr.swapNode(curTr);
	curTr.cells[0].firstChild.checked=true;
}
function getSelectTr(_id){
	for (var i=0;i<$(_id).rows.length;i++){
		var checkRadio=$(_id).rows[i].cells[0].firstChild;
		if(checkRadio.checked==true){
			return checkRadio.parentNode.parentNode;
			break;
		}
	}
}
//加入收藏代码
function bookmark(){
	var title=document.title
	var url=document.location.href
	if (window.sidebar) window.sidebar.addPanel(title, url,"");
	else if( window.opera && window.print ){
	var mbm = document.createElement('a');
	mbm.setAttribute('rel','sidebar');
	mbm.setAttribute('href',url);
	mbm.setAttribute('title',title);
	mbm.click();}
	else if( document.all ) window.external.AddFavorite( url, title);
}

//复制地址标题发送给朋友
function copyLink()
{
window.clipboardData.setData('text',document.location.href+'\n'+document.title);
window.alert("拷贝成功！\n您只需要打开与朋友的即时通讯（如QQ、MSN等）对话框粘贴即可！");
}
//Confim Infomation
function chkConfirm(msgCont){
	if(confirm(msgCont)){
		event.returnValue=true;
	}else{
		event.returnValue=false;
	}
}
//获取验证码
function getCode(cID,cImgName,cFileName,cExplainName,cAlt){
	var codeImg=$(cID+cImgName);
	var codeFile=$(cID+cFileName);
	var codeExplain=$(cID+cExplainName);
	var codePath=codeFile.value+"?"+Math.random();
	codeImg.innerHTML="<img src=\""+codePath+"\" alt=\""+cAlt+"\" onclick=\"this.src='"+codePath+"';\" class=\"hand\" />";
	codeExplain.style.display="inline";
}
//-->
