gbl_telcode=",86,886,852,,,"; // Big China
gbl_telcode+="93,355,213,,33628,244,43,,1809,54,374,297,61,43,994,1809,973,880,1,,32,,229,1809,975,592,";
gbl_telcode+="387,267,,55,,,,359,,257,855,237,1,,1809,236,235,56,86,6724,,57,269,242,682,506,,53,357,42,";
gbl_telcode+="45,253,1,1,,593,20,503,240,291,372,251,,298,679,358,33,,689,,241,220,,49,233,350,30,";
gbl_telcode+="299,1809,590,671,,224,,592,509,,504,852,36,354,91,62,,964,353,972,39,225,1809,81,962,,254,686,82,850,965,";
gbl_telcode+="7,,371,961,266,231,,41,370,352,853,,261,265,60,960,223,356,93,596,222,230,389,52,691,373,3303,976,1809,";
gbl_telcode+="212,258,95,264,674,977,31,599,,64,505,505,234,683,672,670,47,968,92,680,507,675,595,51,63,,48,351,1809,974,";
gbl_telcode+="262,40,,250,,,1809,,685,39549,239,966,221,248,,65,,386,252,27,34,94,290,508,249,597,,268,46,41,,886,7,55,66,228,";
gbl_telcode+="690,676,1809,216,90,7,1,688,,256,7,971,44,1,598,,7,,58,84,,,,969,,243,260,263,";

gbl_countryArray = new Array(300);
gbl_countryArray = gbl_telcode.split(",")

cn_prov_str="<?echo cl(&$PROV_CN_B5,&$PROV_CN_B5,&$PROV_CN_GB);?>";
tw_prov_str="<?echo cl(&$PROV_TW_B5,&$PROV_TW_B5,&$PROV_TW_GB);?>";
cn_prov_list=cn_prov_str.split(",");
tw_prov_list=tw_prov_str.split(",");

function gbl_telgo(form) 
{      
	form.user_tel_cc.value=gbl_countryArray[form.user_country.selectedIndex];   
	var showProv=(form.user_country.value=="cn" || form.user_country.value=="tw");
	document.all.user_province.style.display=showProv?"":"none";

	if (form.user_tel_cc.value=="86"){
		form.user_province.selectedIndex=1;
	}else if (form.user_tel_cc.value=="886"){
		form.user_province.selectedIndex=33;
	}
}

function dwl_chkLength(field, msg, minLength)
{
	if(!minLength) minLength =1;
	if (field.value.length < minLength) {
		if(typeof(my_chkShowErrors) != "undefined") {
			my_chkShowErrors(msg);
		} else {
			alert(msg);
		}
		field.focus();
		return(false);
	}	
	return(true);
}

function dwl_chkAnyCheck(checkBoxObj, msg)
{
	ch_len = checkBoxObj.length;
	haveChecked=false;
	for(i=0; i<ch_len;i++)
	{
		if(checkBoxObj[i].checked) {
			haveChecked=true;
			break;
		}
	}

	if (!haveChecked) {
		if(typeof(my_chkShowErrors) != "undefined") {
			my_chkShowErrors(msg);
		} else {
			alert(msg);
		}
		return(false);
	}	
	return(true);
}

function dwl_chkPattern(field, msg, pattern)
{
	//return(true);
	re = new RegExp(pattern);  //Create regular expression object.
	if (field.value.match(re)!=field.value) {
		if(typeof(my_chkShowErrors) != "undefined") {
			my_chkShowErrors(msg);
		} else {
			alert(msg);
		}
		field.focus();
		return(false);
	}	
	return(true);
}

