function CheckAll(form){
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked = form.chkall.checked;
	}
}
function ShowDialog(url, width, height) {
	window.showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
	//showModalDialog创建一个显示指定 HTML 文档的模式对话框。
}
function winpop(url,width,height){
window.open(url,"winpop", 'width='+ width + ',height=' + height +', left=300, top=200, resizable=0, status=no,scrollbars=no,toolbar=no,menubar=no,location=no')
}
function HTMLEncode(text)//HTML过滤函数
{
	text = text.replace(/&/g, "&amp;") ;
	text = text.replace(/"/g, "&quot;") ;
	text = text.replace(/</g, "&lt;") ;
	text = text.replace(/>/g, "&gt;") ;
	text = text.replace(/'/g, "&#146;") ;
	return text ;
}
function ShowInfo(d){
	var objDiv=document.getElementById(d);
	document.write(objDiv.innerHTML);
}
function tabline(w,h,c){
	document.write("<table  bgcolor=\"" + c + "\" width=\""+ w + "\" height=\"" + h + "\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr><td></td></tr></table>");
	}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;}
//made in gamvan
function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  var gv; //made in gamvan
  for (i=0; i<(args.length-2); i+=3) 
  if ((obj=MM_findObj(args[i]))!=null) {
	v=args[i+2];
    if (obj.style) { obj=obj.style; 
		if (v=='show'){v='visible';} //made in gamvan
		if (v=='hide'){	v ='hidden';} //made in gamvan
	}
    obj.visibility=v; 
	}
}

//***********默认设置定义.*********************
tPopWait=30;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;
//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;
document.write("<style type='text/css'>");
document.write(".cPopText {background-color:#FFFFcc; color:#000000; border: 1px #000000 solid;font-color:#000000; font-size: 9pt; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute; z-index:1000;''></div>");
function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}
function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}
function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;
//made in gamvan
function prtie(txt){
parent.frames.window.status=txt;
parent.frames.document.title=txt;
}
function prtie2(txt2){
window.status=txt2;
document.title=txt2;
}
//提交表单
var ie
ie = (document.all)? true:false
if (ie){
function keyForms(eventobject){
	if(event.ctrlKey && window.event.keyCode==13){
		this.document.Gforms.submit();
		}
	}
}
function postMsg(){
	var o = event.srcElement;
	o.gvSubmit.value="正在提交...";
	o.gvSubmit.disabled=true;			
}
//
var DHTML = (document.getElementById || document.all || document.layers);    
var preImages = new Array(); 
var yourImages = new Array("imgs/loading1.gif", "imgs/loadlist2.gif");
var imgLen = yourImages.length;  

function loadImages() {  
	for (i = 0; i < imgLen; i++) {  
		preImages[i] = new Image();  
		preImages[i].src = yourImages[i]; 
		//alert(yourImages[i]); 
	}  
}  
function gv_getObj(name) {    
	if (document.getElementById) {    
		return document.getElementById(name).style;    
	} else if (document.all) {   
		return document.all[name].style;    
	} else if (document.layers) {    
		return document.layers[name];    
	}    
}    
function gv_showWait(div,flag) {    
	if (!DHTML) return;    
		var x = gv_getObj(div);    
		x.visibility = (flag) ? 'visible':'hidden'    
		if(! document.getElementById) {  
			if(document.layers) {  
				x.left=280/2;  
			}  
		}  
	loadImages();  
	return true;    
}  
// made in GamVan
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// made in GamVan
function listMenus(DivId){
if(document.all[DivId].style.display=='none')
   {
   document.all[DivId].style.display="";
    }
  else
  {
    document.all[DivId].style.display='none';
	}
  return 0;
}
function test()
{
var re = /^[\d,]+$/;
var s = document.form1.sms_num.value;
if(s!="")
{
for(var i=0;i<s.length;i++)
{
if(!re.test(s.charAt(i)))
{
alert("出错!多个号码请用逗号(,)隔开，号码之间不要有空格。或者您输入的手机或小灵通号码有误,请检查！")
document.form1.sms_num.focus()
return false;
break;
}
}
}
}

function form1_onsubmit() {
if(document.form1.sms_num.value=="")
	{
	  alert("接收号码不能为空!")
	  document.form1.sms_num.focus()
	  return false
	 }
else if(document.form1.sms_num.value.split("\r\n").length-1 > 10000) 
	{
	  alert("您输入的号码过多，每次最多可以输入一万个号码！")
	  document.form1.sms_content.focus()
	  return false
	 } 
else if(document.form1.sms_content.value=="")
	{
	  alert("信息内容不能为空！")
	  document.form1.sms_content.focus()
	  return false
	 }
else
    {
	gv_showWait('waitDiv', 1);
	return true
	}
}
function gbcount(message,total,used,remain)
{
  var max;
  max = total.value;
  if(message.value.length > max){
    message.value = message.value.substring(0,max);
    used.value = max;
    remain.value = 0;
    alert('短信字数超过限制!');
  }
  else{
    used.value = message.value.length;
    remain.value = max - used.value;
  }
}