﻿/// Easybizchina Inc. Generic Utilities Set
/// Easybizchina Inc. Copyright @ 2007 - 2008

/// Start at 2007-12-18
/// Ver 1.0.1 by Kris.Nie (kris.nie@easybizchina.com)

/// --------------------------------------------------------------------------------------
/// 说明:判断是否含有中文字符
/// 返回:返回bool值, 指示是否含有.
/// 参数:str_clientID,客户端控件ID
function $(str_id){
    return document.getElementById(str_id);
}
/// --------------------------------------------------------------------------------------

/// --------------------------------------------------------------------------------------
/// 说明:判断是否含有中文字符
/// 返回:返回bool值, 指示是否含有.
/// 参数:参数str_clientID,客户端控件ID
function HasChineseWords(str_clientID){
    var i = 0;
    var result = false;
    
    // Chinese words begin at 13312
    // Chinese words begin at 64106
    
    var str_Chinese = document.getElementById(str_clientID).value;    
    
    for ( i = 0 ; i < str_Chinese.length ; i++){
            
        if(str_Chinese.toString().charCodeAt(i) >= 13312 && str_Chinese.toString().charCodeAt(i) <= 64106){            
            result = true;
        }        
    }
    
    return result;
}
/// --------------------------------------------------------------------------------------

/// --------------------------------------------------------------------------------------
/// 说明:替换中文字符为指定的内容
/// 返回:返回替换后的字符串
/// 参数:str_clientID,客户端控件ID; 
/// 参数:str_ReplaceContent,要替换的内容; 
function ReplaceChineseWords(str_clientID , str_ReplaceContent){
    
}
/// --------------------------------------------------------------------------------------

/// --------------------------------------------------------------------------------------
/// 说明:获取公司联系的地址.
/// 返回:返回联系地址;
/// 参数:tag_Client, 客户端html控件
/// Change by Colin at 08-08-28
function GenMail(tag_Client){
    var str_MailName = "cs";
    var str_MailOpt = "@";
    var str_MailServer = "easybizchina.com";
    
    var str_EmailAddr = str_MailName + str_MailOpt + str_MailServer;
    
    $(tag_Client).href = "mailto:" + str_EmailAddr;
    $(tag_Client).innerText = str_EmailAddr;
    $(tag_Client).value = str_EmailAddr;
}
/// --------------------------------------------------------------------------------------

/// --------------------------------------------------------------------------------------
/// 说明:检查是否含有数字
/// 返回:1含有数字,0不含有数字
function ContectNum(str){
   var n= str.replace(/\D/g,"");
   if(n>0)
   {
   return 1;
   }
   else
   {
   return 0;
   }
   
}
/// --------------------------------------------------------------------------------------
