﻿// JScript 文件

var strEnMsgAr=new Array();
var strCnMsgAr=new Array();
var intSelectedCount,strSearchType,strIsInit;
var strPubShowTipControl;
var strPubLoginPath;
var strMyPageUrl,strMainWebPath;
var strPubIsTipSetValue,strPubTipSetValue;
var strPubAdId="";
strPubIsTipSetValue="N";
strPubTipSetValue="";
strMyPageUrl="";
strPubLoginPath="/XcAdmin/login.html";
strMainWebPath="http://www.xcabc.com";
strPubShowTipControl="";
intSelectedCount=0;
strEnMsgAr[0]="ERRORWITHPARAMETER";
strEnMsgAr[1]="ERRORWITHPARAMETERUNVALID";
strEnMsgAr[2]="UNVALIDSQLTAG";
strEnMsgAr[3]="UPDATEWITHERROR";
strEnMsgAr[4]="READPAGEERROR";
strEnMsgAr[5]="ERRORWITHRETURN";
strEnMsgAr[6]="ERRORWITHPASS";
strEnMsgAr[7]="ERRORWITHUNPASS";
strEnMsgAr[8]="ERRORWITHDELDATA";
strEnMsgAr[9]="ADDWITHERROR";
strEnMsgAr[10]="READWHEREWITHERROR";
strEnMsgAr[11]="ERRORWITHREAD";
strEnMsgAr[12]="ERRORWITHEDITUPDATE";
strEnMsgAr[13]="ERRORWITHADD";
strEnMsgAr[14]="REMOVETEMPIMGWITHERROR";
strEnMsgAr[15]="UNVALIDDETAILMODELID";
strEnMsgAr[16]="UNVALIDDETAILNOTEID";
strEnMsgAr[17]="ERRORWITHUSEREXIT";
strEnMsgAr[18]="ERRORWITHUSEREXIT";
strEnMsgAr[19]="NONECODE";
strEnMsgAr[20]="ERRORWITHCHECKCODE";
strEnMsgAr[21]="NONEUSER";
strEnMsgAr[22]="GETUSERSCORELISTERROR";
strEnMsgAr[23]="UNVALID_READMEMBERMENU";
strEnMsgAr[24]="ERRORWITHMEMBERCONTROL";
strEnMsgAr[25]="READERRORWITHUSERFRIEND";
strEnMsgAr[26]="FINDCARDATAERROR";
strEnMsgAr[27]="NONETEMPDIRECTORY";
strEnMsgAr[28]="图片已经被用";
strEnMsgAr[29]="Please Login,thanks";
strEnMsgAr[30]="ECADMINERROR";


strCnMsgAr[0]="参数分析错误";
strCnMsgAr[1]="传递操作类型参数无效";
strCnMsgAr[2]="无效SQL标识";
strCnMsgAr[3]="修改更新错误";
strCnMsgAr[4]="执行分页读取时出错";
strCnMsgAr[5]="退回资料时出错";
strCnMsgAr[6]="审核资料时出错";
strCnMsgAr[7]="取消审核资料时出错";
strCnMsgAr[8]="删除数据时错误";
strCnMsgAr[9]="增加数据时错误";
strCnMsgAr[10]="读取需要修改的资料时错误";
strCnMsgAr[11]="读取资料时出错误";
strCnMsgAr[12]="保存修改资料时错误";
strCnMsgAr[13]="增加保存数据时错误";
strCnMsgAr[14]="在上传图库临时表中找不到图片";
strCnMsgAr[15]="指定的明细页面模板无效。";
strCnMsgAr[16]="找不到指定的模块页面的内容，不能生成明细页面";
strCnMsgAr[17]="输入的注册帐号已存在,请重新输入";
strCnMsgAr[18]="注册时发生错误,请稍后再试";
strCnMsgAr[19]="验证码无效";
strCnMsgAr[20]="验证码输入错误";
strCnMsgAr[21]="帐号或密码错误,请重新输入";
strCnMsgAr[22]="获取用户积分时错误";
strCnMsgAr[23]="读取会员后台时错误，请确保已经登陆";
strCnMsgAr[24]="处理会员后台操作时错误";
strCnMsgAr[25]="读取会员车友资料时错误";
strCnMsgAr[26]="查找汽车资料时错误";
strCnMsgAr[27]="图文件临时目录不存在";
strCnMsgAr[28]="图片已经被用";
strCnMsgAr[29]="请先登陆，谢谢";
strCnMsgAr[30]="系统管理员操作失败";

var agt=navigator.userAgent.toLowerCase();

var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));

if(typeof ClsWindow!="undefined")
{
var objWindow=new ClsWindow();
}

var drag;


function getPageSize()
{   
    var xScroll, yScroll;   
    if (window.innerHeight && window.scrollMaxY) {   
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
    
    var windowWidth, windowHeight;
    if (self.innerHeight) {    // all except Explorer
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }   
   
    // for small pages with total height less then height of the viewport
    if(yScroll < windowHeight){
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }

    // for small pages with total width less then width of the viewport
    if(xScroll < windowWidth){   
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }

    arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
    return arrayPageSize;
}
 
 
function getViewportInfo()
{
    var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;
    var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;
    return {w:w,h:h};
}

function IeTrueBody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function GetScrollTop()
{
 return ie ? IeTrueBody().scrollTop : window.pageYOffset;
}

function ProCheckResutl(strText)
{
    
   
    var strReg=/\D图片已经被用\D/;
    for(i=0;i<strEnMsgAr.length;i++)
    {
        if(strText==strEnMsgAr[i])
        {
            alert(strCnMsgAr[i]);
            return false;
        }
        if(strReg.exec(strText))
        {
         alert(strText);
         return false;
        }  
          
    }
}
 function ProSaveComplete(strText)
{    
 
    if( ProCheckResutl(strText)==false)
        return false;       
     alert("保存完毕");
     if (strMyPageUrl!=undefined) 
     {
       if ((strMyPageUrl!=null) && (strMyPageUrl!=""))
       {
       window.open(strMyPageUrl,"_self");
     }
     
     }
     //ProRefresh();
}


function errorFunction(strError)
{
    alert(strError.code+strError.message);
}

function ProDelComplete(strText)
{
   if( ProCheckResutl(strText)==false)
        return false;  
     alert("删除完毕");
   
    ProRefresh();
}
function ProDelCompleteRefresh(strText)
{
   if( ProCheckResutl(strText)==false)
        return false;  
     alert("删除完毕");
   ProReadGridData(); 
}

function ProPassComplete(strText)
{
 if( ProCheckResutl(strText)==false)
	return false;
         alert("审核完毕");
         ProRefresh();
}
function ProUnPassComplete(strText)
{
 if( ProCheckResutl(strText)==false)
	return false;
         alert("取消审核完毕");
         ProRefresh();
}
function ProReturnComplete(strText)
{
 if( ProCheckResutl(strText)==false)
	return false;
         alert("退回完毕");
         ProRefresh();
}

function ProChAll(obj,strName)
{
    var checkboxs = document.getElementsByName(strName);
    
    for(var i=0;i<checkboxs.length;i++)
      {
        checkboxs[i].checked = obj.checked;
      }
}

function ProGetSelectId(strTbodyId,strTag)
{
        var tBodyObj=document.getElementById(strTbodyId);//获取存放数据行的位置
		var strDelId;
		strDelId="";
		intSelectedCount=0;
		for( j=0;j<tBodyObj.childNodes.length;j++)
		{
			var tempObj=tBodyObj.childNodes[j]; //每行

			for(i=0;i<tempObj.childNodes.length;i++)
			{
				var tempObj2=tempObj.childNodes[i]; //每列
				for(k=0;k<tempObj2.childNodes.length;k++)
				{
					var tempObj3=tempObj2.childNodes[k];
					var strId=tempObj3.id;
					if(strId==null)
						continue;
					if(	strId.substring(0,strTag.length)==strTag)
					{
						var tempCheck=document.getElementById(strId);
						if(tempCheck.checked==true)
						{
							strDelId=strDelId+strId.substring(strTag.length)+",";
                            intSelectedCount++;
						}
					}
				}
			}
		}
	 
		strDelId=strDelId.replace(/(^\s*)|(\s*$)/g, "");
		if(strDelId.length>0)
		{	
		    strDelId=strDelId.substring(0,strDelId.length-1);
		    return strDelId;		
		} 
		else
		{
		    return null;
		}
}
function ProClose()
{
    ProShowPopup("HIDE","divPopWindowEdit",10,10,100,100); //HIDE
    ProRefresh();    
}

function ProShowPopup(strShowHide,strId,intLeft,intTop,intWidth,intHeight)
{
    var obj;
    obj=document.getElementById(strId);
    if(obj==null)
    {
        alert("弹出窗口ID无效。");
        return false;
    }     
    if(strShowHide=="HIDE")
    {
        obj.style.display="none";        
        return true;
    }
    obj.style.top=intTop+"px";
    obj.style.left=intLeft+"px";
    obj.style.width=intWidth+"px";
    obj.style.height=intHeight+"px";       
    obj.style.display="";    
}

function ProShowEditCheck(strId)
{
  if(strId==null)
      {
          strId=ProGetSelectId("tblist","FIRSTCHK");
      }
    if(strId==null)
    {
       alert("请选择资料再修改");
        return null;
    }
    if (intSelectedCount>1)
    {
        alert("一次只能选择一笔资料修改,请重新选择!");
        return null;
    }  
    return strId;
}
function ProSelectBuildId(strId)
{
  if(strId==null)
      {
          strId=ProGetSelectId("tblist","FIRSTCHK");
      }
    if(strId==null)
    {
       alert("请选择资料再生成");
        return null;
    }

    return strId;
}


function ProBuildPara(strPower,strRequestType,strRequestSqlTypeCk,strType,strRequestTag)
{
   var nows=new Date(); 
   var strTmpPara;
   strPower=escape(strPower); //Y
   strRequestType=escape(strRequestType); //AUTO
   strRequestSqlTypeCk=escape(strRequestSqlTypeCk);//Y
   strType=escape(strType); //READ
   strRequestTag=escape(strRequestTag);   //Read_Tb_WebBase
    strTmpPara="timeid="+escape(Math.random())+"&RequestPower="+strPower+"&RequestType="+strRequestType;
    strTmpPara=strTmpPara+"&RequestSqlTypeCk="+strRequestSqlTypeCk+"&ReqeustControl="+strType+"&requesTags="+strRequestTag;
   return strTmpPara;
}

function ProBuildId()
{
    var now=new Date();
    var id;
    id=String(now.getFullYear())+String(now.getMonth())+String(now.getDay())+String(now.getHours())+String(now.getMinutes())+String(now.getSeconds())+String(now.getMilliseconds());
    id=id+String(Math.random());
    return id;
}

function ProNewGuid()
{
    var guid = "";
    for (var i = 1; i <= 32; i++)
    {
      var n = Math.floor(Math.random()*16.0).toString(16);
      guid +=   n;
      if((i==8)||(i==12)||(i==16)||(i==20))
        guid += "-";
    }
    return guid;   
}


function ProShowPopUpWindow(strTitle,strContents,intWidth,intHeight,intLeft,intTop,divMsg)
{
  
    objWindow.windowHeight=intHeight;
    objWindow.windowWidth=intWidth;
    objWindow.strTitle=strTitle; 
    if(intLeft==null)
    {
        objWindow.windowTop="10%";
        objWindow.windowLeft="30%";    
     }
     else
     {
       objWindow.windowTop=intTop;
        objWindow.windowLeft=intLeft;
     }
    
    objWindow.strDivBg="divBg";
   
    if(divMsg!=undefined)
    {
    objWindow.strDivMsg="divMsg1";
    }
    else 
    {
      objWindow.strDivMsg="divMsg";
    }
    objWindow.strDivTitle="divTitle";
    objWindow.zIndexMsg=111120;
    objWindow.zIndexBg=111110;
    objWindow.strDivContentId="divPopWindowEdit";
    objWindow.zIndexContent=111130;
    var divMessage=document.getElementById("divMessage");
    if((divMessage!=null)||(divMessage!=undefined))
    {
     //alert("不为空");
    objWindow.windowParement=divMessage;
    }
    else
    {
     // alert("为空");
    objWindow.windowParement=document.body;

    }

    
    objWindow.strDivContentList=strContents;
    
    
    objWindow.ProShowWindow();      
    var d=document.getElementById(objWindow.strDivMsg);
    var d2=document.getElementById("divTitle");
     d.onmousedown = function(e)
    {
      var targ;
        if (!e)
             var e = window.event;
        if (e.target)
         targ = e.target;
        else if (e.srcElement)
             targ = e.srcElement;
        if (targ.nodeType == 3) // defeat Safari bug
            targ = targ.parentNode;
        var tname;
        tname=targ.id;
        
        if(tname!="divTitle")
            return;                    
        drag = true;d.style.position = "absolute";
        var e = e||window.event;
        _x = ( e.x || e.clientX) - this.offsetLeft;
        _y = ( e.y || e.clientY ) - this.offsetTop;
    }
    document.onmousemove = function(e)
    {
      
         
        var e = e||window.event;
         
        if(!drag) return;
        d.style.left =( e.x || e.clientX)-_x+ "px";
        d.style.top =( e.y || e.clientY )-_y+ "px";
    }
    document.onmouseup = new Function("drag=false");    
}
function ProShowPopUpWindow2(strTitle,strContents,intWidth,intHeight,intLeft,intTop,divMsg)
{
  
    objWindow.windowHeight=intHeight;
    objWindow.windowWidth=intWidth;
    objWindow.strTitle=strTitle; 
    if(intLeft==null)
    {
        objWindow.windowTop="50%";
        objWindow.windowLeft="30%";    
     }
     else
     {
       objWindow.windowTop=intTop;
        objWindow.windowLeft=intLeft;
     }
    
    objWindow.strDivBg="divBg";
   
    if(divMsg!=undefined)
    {
    objWindow.strDivMsg="divMsg1";
    }
    else 
    {
      objWindow.strDivMsg="divMsg";
    }
    objWindow.strDivTitle="divTitle";
    objWindow.zIndexMsg=111120;
    objWindow.zIndexBg=111110;
    objWindow.strDivContentId="divPopWindowEdit";
    objWindow.zIndexContent=111130;
    var divMessage=document.getElementById("divMessage");
    if((divMessage!=null)||(divMessage!=undefined))
    {
     //alert("不为空");
    objWindow.windowParement=divMessage;
    }
    else
    {
     // alert("为空");
    objWindow.windowParement=document.body;

    }

    
    objWindow.strDivContentList=strContents;
    
    
    objWindow.ProShowWindow();      
    var d=document.getElementById(objWindow.strDivMsg);
    var d2=document.getElementById("divTitle");
     d.onmousedown = function(e)
    {
      var targ;
        if (!e)
             var e = window.event;
        if (e.target)
         targ = e.target;
        else if (e.srcElement)
             targ = e.srcElement;
        if (targ.nodeType == 3) // defeat Safari bug
            targ = targ.parentNode;
        var tname;
        tname=targ.id;
        
        if(tname!="divTitle")
            return;                    
        drag = true;d.style.position = "absolute";
        var e = e||window.event;
        _x = ( e.x || e.clientX) - this.offsetLeft;
        _y = ( e.y || e.clientY ) - this.offsetTop;
    }
    document.onmousemove = function(e)
    {
      
         
        var e = e||window.event;
         
        if(!drag) return;
        d.style.left =( e.x || e.clientX)-_x+ "px";
        d.style.top =( e.y || e.clientY )-_y+ "px";
    }
    document.onmouseup = new Function("drag=false");    
}
function ProCloseWindow()
{
    if(objWindow!=null)
    {
        var IsRefresh=objWindow.ProCloseWindow(); 
      if(IsRefresh==true)
      { 
        ProRefresh();
        }
    }
}
//获取通过js调用打开的页面的参数

function   getUrlParam(name)
{  
          var   reg   =   new   RegExp("(^|&)"+   name   +"=([^&]*)(&|$)");  
          var   r   =   window.location.search.substr(1).match(reg);  
          if   (r!=null)   return   unescape(r[2]);   return   null;  
 }   
 
 //去除前后空格
 function ProTrim(strValue)
 {
    return strValue.replace(/(^\s*)|(\s*$)/g, ""); 
 }

//显示等图片
function ProShowWatiImg()
{
    var myAr=getPageSize();
    var myAr2=getViewportInfo();
    var vLeft,vTop,divWidth,divHeight;
    
    divWidth=200;
    divHeight=50;
    vLeft=(document.body.clientWidth-divWidth)/2;
    vLeft=vLeft+document.body.scrollLeft;    
    vTop=(myAr[3]-divHeight)/2;
    vTop=vTop+GetScrollTop();
    
    var obj,strHtml;
    strHtml="<table align='center'><tr><td><image src='/images/loading.gif'></td></tr></table>";
    obj=document.createElement("DIV");
    obj.id="divImgWait";
    obj.innerHTML=strHtml;   
    
    obj.style.position="absolute"; 
    document.body.appendChild(obj);    
    
    obj.style.background="#99ccff";
    obj.style.height=divHeight+"px";
    obj.style.width=divWidth+"px";
     obj.style.top=vTop+"px";
    obj.style.left=vLeft+"px";
    obj.style.zIndex=9999999;
    obj.style.display="";
    
}
//关闭等待图片
function ProCloseWaitImg()
{
    var obj;
    obj=document.getElementById("divImgWait");
    if((obj!=null) && (obj!=undefined))
    {
        document.body.removeChild(obj);
    }
}
///获取指定的radio的值
function ProGetRadioValue(strName)
{
    var obj;
    obj=document.getElementsByName(strName);
    if((obj==null) || (obj==undefined))
        return "";
    for(var i=0;i<obj.length;i++)
    {
        if(obj[i].checked)
        {
            return obj[i].value;
        }
    }
}
///返回指定字符串有几个标识
function ProCheckStrCount(strImgList)
{
    if(strImgList==null)
        return 0;
    var i,tmpCount;
    tmpCount=0;
    for(i=0;i<=strImgList.length;i++)
    {
        if(strImgList.substr(i,1)==",")
        {
            tmpCount++;
        }
    }
    return tmpCount;
}



//公用访问页面记录
 
function ProRecordAccess()
{
     var obj,strUrl,strPara;
    strUrl=WebUrl;
    strPara=ProBuildPara("Y","AUTO","Y","ACCESSWEBRECORD","");
    strPara=strPara+" & Keys = ";
    strPara=strPara+" & Keys2 = ";
    strPara=strPara+" & url = "+this.location.href;
    strPara=strPara+" & url1 = "+document.referrer;
    strPara=strPara+" & width = "+screen.width;
    strPara=strPara+" & height = "+screen.height;
    strPara=strPara+" & userag = "+navigator.userAgent;
    
 
    
    var mAjaxer = new Ajaxer(strUrl,ProRecordComplete,errorFunction,"POST",strPara) ;
    mAjaxer.send(); 
}
function ProRecordComplete(strText)
{
}

//检查是否登陆并将前台页面显示出相应的状况  有没有
function ProCheckLogin()
{
/*
    var obj,strUrl,strPara;
    strUrl=WebUrl;
    strPara=ProBuildPara("N","AUTO","Y","USERINFO","");
    strPara=strPara+" & Keys = ";
    strPara=strPara+" & Keys2 = ";
    strPara=strPara+" & keys3 = ";
    
    
    var mAjaxer = new Ajaxer(strUrl,ProCheckComplete,errorFunction,"POST",strPara) ;
    mAjaxer.send(); 
    */
}
function ProCheckComplete(strText)
{
    

  if( ProCheckResutl(strText)==false)
        return false;    
   strText=strText.split("{$COL$}");
        
  var obj,strHtml;
  //strText=strText.split("{COL}");      
  obj=document.getElementById("ulStatus");

  if(strText=="")
  {
    return false;
  }
  strHtml="<a href ='javascript:void(0);' onclick ='ProExit();'>"+strText[1]+"｜退出</a>";
  obj.innerHTML=strHtml;
  obj=document.getElementById("divUserId");
  obj.innerHTML=strText[0];
}
function ProExit()
{
    var obj,strUrl,strPara;
    strUrl=WebUrl;
    strPara=ProBuildPara("N","AUTO","Y","LOGINOUT","");
    strPara=strPara+" & Keys = ";
    strPara=strPara+" & Keys2 = ";
    strPara=strPara+" & keys3 = ";
    
    
    var mAjaxer = new Ajaxer(strUrl,ProExitComplete,errorFunction,"POST",strPara) ;
    mAjaxer.send(); 

}
function ProExitComplete(strText)
{
   if( ProCheckResutl(strText)==false)
        return false;  
   window.location.href=  ProGetWebPath()+"/";    
}
function ProSearch()
{
    alert("asd");
    var obj,strUrl;
    obj=document.getElementById("txtSearchKeyWord");
    obj=ProTrim(obj.value);
    if(obj.length<=0)
    {
        alert("输入查找的内容不能空白，请输入");
        return false;
    }
    strUrl=obj;
    obj=document.getElementById("txtSearchType");
    strUrl="/result-"+obj.value+"-"+strUrl+"-1.html";
    window.open(strUrl);
}

function ProSelectSearchType(objType,strIndex)
{
    var obj,obj2;
    
    obj=document.getElementById("divMenu");
    obj=obj.getElementsByTagName("a");
    for(var i=0;i<obj.length;i++)
    {
        obj[i].className="nav2";
    }
    
    if(objType!=undefined)
    {
        objType.className="nav1";
    }
    strSearchType=strIndex;
    
}


function ProSearchMenu(objType,oldClass,newClass,isIndex)
{
 var divType,objTypeList,i,j,obj;
 strSearchType="";
 divType=document.getElementById("divType");
 if(isIndex==true)
 {
 objTypeList=divType.getElementsByTagName("a");
 }
 else
 {
  objTypeList=divType.getElementsByTagName("li");
 }
 for(i=0;i<objTypeList.length;i++)
 {
  objTypeList[i].className=oldClass;
  if(objTypeList[i]==objType)
   {
     if(isIndex==true)
     {
     
      strSearchType=i+1;
      }
     else
     {
     
      strSearchType=i;
     }
     
   }
  
 }
 if(isIndex==false)
 {
   
  var objDiv=document.getElementById("divMenu");
  
 
 obj=objDiv.getElementsByTagName("a");
 for(i=0;i<obj.length;i++)
 {
   obj[i].className='nav2';
   if(i==strSearchType)
   {
    obj[i].className='nav1';
   }
 }
 
 } 
 objType.className=newClass; 
}



function ProSearch(isIndex)
{
 var strSearch,objSearch;
 strSearch="";

 if(isIndex==undefined)
 {
 objSearch=document.getElementById("txtSearch");
 }
 else
 {
  objSearch=document.getElementsByName("txtSearch");
  objSearch=objSearch[isIndex];
 }
 
 if(objSearch.value!=undefined)
  {
   strSearch=objSearch.value;
  }

 if(strSearchType==undefined)
  {
   strSearchType=1;
  }
  if(isIndex==undefined)
  {
  
  window.open(encodeURI("http://192.168.1.17/search/result-"+strSearchType+"-"+strSearch+"-1.html"));
  }
  else
  {
   window.location.href=encodeURI("http://192.168.1.17/search/result-"+strSearchType+"-"+strSearch+"-1.html");
  }


}
function ProEnter(event,isIndex)
{
 if(event.keyCode==13)
 {
  if(isIndex!=undefined)
  {
   ProSearch(isIndex);
  }
  else
  {
  
   ProSearch();
   
  }
  
 } 


}
function ProMySearch()
{
var obj=document.getElementById('txtSearchType');
 strSearchType=obj.value;
 ProSearch();


}




///获取当前日期
function ProGetNowDate()
{
   var myDate=new Date();
   var strDate;
   var i=myDate.getMonth();
   i=i+1;
   strDate=myDate.getFullYear()+"-"+i+"-"+myDate.getDate();
   return strDate;
}

///////开始增加
 

function ProValidatorEmail(strText)
{
 
  var reg=/[0-9a-zA-Z]{1,}\@[0-9a-zA-Z]{1,}\.[0-9a-zA-Z]{1,}/;
  if(reg.exec(strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }


}
//获取当前长日期格式
function ProGetLognDate()
{
   var myDate=new Date();
   var strDate;
   var i=myDate.getMonth();
   i=i+1;
   strDate=myDate.getFullYear()+"-"+i+"-"+myDate.getDate()+" "+myDate.getHours()+":"+myDate.getMinutes()+":"+myDate.getSeconds();
   return strDate;
}
function ProValidatorIdentity(strText)
{
  var reg=/^[0-9a-zA-Z]{18,18}$/;
  if(reg.exec(strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }

}
function ProValidatorPhone(strText)
{
 var reg=/^[0-9]{11,11}$/;
 if(reg.exec(strText))
 {
   return "true";
 }
 else
 {
   return "false";
 }

}
function ProValidatorTel(strText)
{
  var reg=/(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{3,4}\-[0-9]{7,8}\-[0-9]{1,5}$)/;
  if(reg.exec(strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }
}

function ProValidatorZip(strText)
{
  var reg=/^[0-9]{6,7}$/;

  if(reg.exec(strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }
}

function ProValidatorDate(strText)
{
  var reg=/(^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}[ ][0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}[ ]{0,}$)|(^[0-9]{4,4}-[0-9]{1,2}-[0-9]{1,2}[ ]{0,}$)/;
  if(reg.exec(strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }

}
function ProValidatorNum(strText)
{
  var reg=/(^[0-9]{1,}$)|(^[0-9]{1,}\.[0-9]{1,}$)/;
  if(reg.exec (strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }

}

function ProValidatorNums(strText)
{
  var reg=/^[0-9]{1,}$/;
  if(reg.exec (strText))
  {
    return "true";
  }
  else
  {
    return "false";
  }

}
function ProSelectSecond(strNew,strOld,strObj)
{
  
  var objP,objDiv,strTmp,i,objList,strIndex;
  strTmp=strObj.substring(strObj.length-1,strObj.length);
  
  if(strTmp=="D")
  {
    
    strTmp=strObj.substring(0,strObj.length-1);
    strIndex=1;
    objDiv=document.getElementById("div"+strObj);
    objDiv.style.display="block";
    
    objDiv=document.getElementById("div"+strTmp);
    objDiv.style.display="none";
  }
  else
  {
 
    strIndex=0;
    strTmp=strObj;
    objDiv=document.getElementById("div"+strTmp);
    objDiv.style.display="block";
    objDiv=document.getElementById("div"+strTmp+"D");
    objDiv.style.display="none";
  }
  
 
  objP=document.getElementById("p"+strTmp);
  objList=objP.getElementsByTagName("a");
  for(i=0;i<objList.length;i++)
  {
    objList[i].className=strOld; 
    
  }  
  objList[strIndex].className=strNew;
  
}


function GetRadioValue(RadioName){
    var obj;   
    obj=document.getElementsByName(RadioName);
    if(obj!=null){
        var i;
        for(i=0;i<obj.length;i++){
            if(obj[i].checked){
                return obj[i].value;           
            }
        }
    }
    return null;
}

function ProPubShowTipControl(strText)
{    
    if((strPubShowTipControl==undefined) || (strPubShowTipControl=="") || (strPubShowTipControl.length<=0))
    {
        alert("快速提示控件无效");
        return false;
    }
     if( ProCheckResutl(strText)==false)
       {
        top.location=strPubLoginPath;
        return false;
  }
  var obj,strText2;
    obj=document.getElementById(strPubShowTipControl);
    if((obj==undefined) || (obj==null))
    {
        return false;
    }
    obj.length=0;
    var tdObj;
    strText=strText.split("{ROW}")
    for(var i=0;i<strText.length;i++)
    {
        strText2=strText[i];
        strText2=strText2.split("{COL}");
        tdObj=document.createElement("option");
        tdObj.text=strText2[1];
        tdObj.value=strText2[0];
        obj.options.add(tdObj);
    }     
    if((strPubIsTipSetValue=="Y") && (strPubTipSetValue!="")) 
    {
        obj.value=strPubTipSetValue;
        strPubIsTipSetValue="N";
    }
}

function ProGetWebControlValue(strName,strFieldName)
{
    var obj;
    obj=document.getElementById(strName)
    if(obj==undefined)
        return "";
    if(strFieldName=="")
    {
        return escape(obj.value);
    }
    else
    {        
        return "&"+strFieldName+"="+escape(obj.value);       
    }
}

function ProSetWebControlValue(strName,strValue)
{
    
    var obj;
    if((strName==undefined) || (strName==null) || (strName==""))
        return;
    obj=document.getElementById(strName)
    if(obj==undefined)
        return "";
    if(strValue=="")
    {
        obj.value="";
    }
    else
    {
        obj.value=strValue;
        
    }
}

function ProSetSelectValue(strName,strValue)
{
    var obj;
    obj=document.getElementById(strName);
    
   if(strValue==true)
   {
    strValue=1;
    
   }
   else if (strValue==false)
   {
    strValue=0;
    
   }
   for(var i=0;i<obj.length;i++)
   {    
    if(obj.options[i].value==strValue)
    {
        
        obj.options[i].selected=true;
        
        obj.value=strValue;
        break;
    }
   }
}


 function ProValidatorQQ(strText)
{
 var reg=/^[0-9]{4,10}$/;
 if(reg.exec(strText))
 {
   return "true";
 }
 else
 {
   return "false";
 }

}

function ProGetWebPath()
{
  var strWebPath;
  strWebPath="http://192.168.1.67";
  return strWebPath;

}
