function showstatus()
{
window.status="锦兴会计师事务所欢迎您！希望您在本站有所收获！！"
setTimeout("showstatus()",50)
}
setTimeout("showstatus()",50)
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
//校验登录名：只能输入5-20个以字母开头、可带数字、“_”、“.”的字串
function isRegisterUserName(s)
{
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/;
if (!patrn.exec(s)) return false
return true
}
//  必须输入中文由2到8个字符组成!
function isChinese(s)
{
var patrn=/^[\u4e00-\u9fa5]{2,8}$/;
if (!patrn.exec(s)) return false
return true
}


//校验用户姓名：只能输入1-30个以字母开头的字串
function isTrueName(s)
{
var patrn=/^[a-zA-Z]{1,30}$/;
if (!patrn.exec(s)) return false
return true
}

//校验密码：只能输入6-20个字母、数字、下划线
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!patrn.exec(s)) return false
return true
}
//校验普通电话、传真号码：可以“+”开头，除数字外，可含有“-”
function isTel(s)
{
//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!patrn.exec(s)) return false
return true
}
//校验手机号码：必须以数字开头，除数字外，可含有“-” 
function isMobil(s) 
{ 
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/; 
if (!patrn.exec(s)) return false 
return true 
} 
//校验Email

function isEmail(s)
{
var patrn=/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/;
if (!patrn.exec(s)) return false
return true
}
//校验邮政编码
function isPostalCode(s)
{
//var patrn=/^[a-zA-Z0-9]{3,12}$/;//  国际
var patrn=/^\d{6}$/;//中国
if (!patrn.exec(s)) return false
return true
}
//   移到手机
function checkMobile1(Str){ 
var patrn=/^13[0,4,5,6,7,8,9]\d{8}$/; 
if (!patrn.exec(s)) return false 
return true 
} 

//校验IP
function isIP(s) //by zergling
{
var patrn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
if (!patrn.exec(s)) return false
return true
}

// 校验身份证
function iscart()
{
//var patrn=/^[a-zA-Z0-9]{3,12}$/;
var patrn=/^((d{3,4})|d{3,4}-)?d{7,8}(-d{3})*$/;
if (!patrn.exec(s)) return false
return true
}

//读取Cookies
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

//显示Cookies
function writeCookie(name, value, mins)
{
  var expire = "";
  if(mins != null)
  {
    expire = new Date((new Date()).getTime() + mins * 60000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire;
}

//登录条上搜索输入框
function cler(text){
	if (text.value=="请输入关键字"){
		text.value="";
	}
}



//------------------------------
//自动缩放图片的长宽，规定大小限制，按比缩放
//------------------------------
function ChangeImg(mypic,MaxW,MaxH){
	var xw=160;
	var xl=180;
	
	var width=mypic.width;
	var height=mypic.height;
	var bili=width/height;
	
	if(width>MaxW)
	{
		mypic.width=MaxW;
		mypic.height=MaxW/bili;
	}else if(height>MaxH){
		mypic.width=MaxH*bili;
		mypic.height=MaxH;
	}
} 

//弹出窗口显示图片
function ShowPhoto(obj){
var obj = eval('document.myform.'+obj); 
if (obj.value==""){
   alert("请先上传图片!");
   //return false;  
}
else
 window.open("/ShowPhoto.asp?Src="+obj.value,"newwindow", "height=360, width=380, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") 
}


//  弹出选择时间的方法
function SelectDate(obj) 
{ 
var obj = eval('document.myform.'+obj); 
result = window.showModalDialog('/inc/SelectTime.asp?action=showdate',obj.value,'help:no;status: no;dialogWidth=184px;dialogHeight=220px');
if (result!=null) { obj.value = result; } 
}

//-----------------------------------------------------------------------------------
//鼠标边上显示HTML内容
		///      鼠标边上显示图片  JS 
		//***********以下javascript脚本来自动网BBS页面****
		tPopWait=50;    //停留tWait豪秒后显示提示。
		tPopShow=5000; //显示tShow豪秒后关闭提示
		showPopStep=20;
		popOpacity=99;
		
		//***************内部变量定义*****************
		sPop=null;
		curShow=null;
		tFadeOut=null;
		tFadeIn=null;
		tFadeWaiting=null;
		
		
		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);
				}
		}
var ajax;
function createrequest()
{
try{ajax=new XMLHttpRequest();}
catch(trymicrosoft)
{try{ajax=new ActiveXObject("Msxml2.XMLHTTP");}
 catch(othermicrosoft)
  {try{ajax=new ActiveXObject("Microsoft.XMLHTTP");}
   catch(failed)
    {alert("你的浏览器不支持ajax!");}
   }
 }
}

function getData(url)
{
 createrequest();
 ajax.open("GET",url,false);
 ajax.onReadyStateChange=updatePage;
 ajax.send(null);
}

function updatePage()
{if(ajax.readyState==4)
  {
  if(ajax.status==200){
   document.all.china.innerHTML=ajax.responseText
   }
   else
  {alert("服务器请求失败！");}
 }
}

		
