//******************************************************
// 包含文件 用法： $import('../include/mian.js', 'js');
//               $import('../style/style.css', 'css');
//******************************************************
function $import(path, type){
 var i, 
      base, 
      src = "common.js", 
      scripts = document.getElementsByTagName("script");  
 for (i = 0; i < scripts.length; i++) {
      if (scripts[i].src.match(src)) {
          base = scripts[i].src.replace(src, "");
          break;
      }
  }
  if (type == "css") {
      document.write("<" + "link href=\"" + base + path + "\" rel=\"stylesheet\" type=\"text/css\"></" + "link>");
  } else {
      document.write("<" + "script language=\"JavaScript\" type=\"text/javascript\" src=\"" + base + path + "\"></" + "script>");
  }
}

$import('/js/jquery.js', 'js');
$import('/js/js.js', 'js');



/*
* jQuery CascadingSelect AddOption
*
* Author: qinfei
*
* Licensed like jQuery, see http://docs.jquery.com/License
*
* 作者：qinfei
*/

function $G(id){
 return document.getElementById(id);
}
function $F(id){
 return $G(id).value;
}

//========================================
// [Function] isDigit
// [Description] check digit valid
// [Params] theDigit - input digit
// [Return] digit valid
//========================================
function isDigit(theDigit) 
{ 
	var digitArray = new Array('0','1','2','3','4','5','6','7','8','9'),j; 

	for (j = 0; j < digitArray.length; j++) 
	{if (theDigit == digitArray[j]) 
		return true 
	} 
	return false
} 

//========================================
// [Function] isPositiveInteger
// [Description] check string is integer
// [Params] theString - input string
// [Return] string valid
//========================================
function isPositiveInteger(theString) 
{ 
	var theData = new String(theString) 

	if (!isDigit(theData.charAt(0)))		
		if (!(theData.charAt(0)== '+')) 
			return false 

	for (var i = 1; i < theData.length; i++) 
		if (!isDigit(theData.charAt(i))) 
			return false 
	
	return true 
} 


/*
用途：检查输入字符串是否是带小数的数字格式,可以是负数
输入：
s：字符串
返回：
如果通过验证返回true,否则返回false
*/
