function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function PopPage(strURL, name, width, height, left, top)
{
    if(width==null) width=730;
    if(height==null) height=500;
    if(left==null) left = ( screen.width - width ) / 2;
    if(top==null) top  = ( screen.height - height ) / 2;
    temp = "width="+width+",height="+height+",left="+left+",top="+top+",scrollbars=1,toolbar=no,location=no,directories=no,status=no,resizable=no";
    w = window.open(strURL,name,temp);
    w.focus();
}
function openThisAbout()
{
    temp = "width=618,height=400,left=0,top=0,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,resizable=no";
    window.open("/home/help/about_taobao.html","",temp);
}
function GetCookie(cookiename)
{
    var thebigcookie = document.cookie;
    var firstchar = thebigcookie.indexOf(cookiename);
    if (firstchar != -1) {
        firstchar += cookiename.length + 1;
        lastchar = thebigcookie.indexOf(";",firstchar);
        if(lastchar == -1) lastchar = thebigcookie.length;
        return unescape(thebigcookie.substring(firstchar, lastchar));
    }
    return "";
}
function setCookie(cookiename,cookievalue,cookieexpdate,domainname)
{
    document.cookie = cookiename + "=" + cookievalue
    + "; domain=" + domainname
    + "; path=" + "/"
    + "; expires=" + cookieexpdate.toGMTString();

}
function unloadpopup(cookiename,popurl,popwidth,popheight,domainname,tr)
{
    //return;
    try {
        if (!tr)
            return;
        if( GetCookie(cookiename) == "" )
        {
            var expdate = new Date();
            expdate.setTime(expdate.getTime() + 1 * (24 * 60 * 60 * 1000)); //+1 day
            setCookie(cookiename,"yes",expdate,domainname);
            if( exitpop )
            {
                w = window.open(popurl,cookiename,"width="+popwidth+",height="+popheight+",scrollbars=1,toolbar=yes,location=yes,menubar=yes,status=yes,resizable=yes");
                w.focus;
            }
        }
    }catch (e) {}
}
function setCheckboxes(theForm, elementName, isChecked)
{
    var chkboxes = document.forms[theForm].elements[elementName];
    var count = chkboxes.length;

    if (count)
    {
        for (var i = 0; i < count; i++)
        {
            chkboxes[i].checked = isChecked;
        }
    }
    else
    {
        chkboxes.checked = isChecked;
    }
    return true;
}

var imageObject;
function ResizeImage(obj, MaxW, MaxH)
{
    if (obj != null) imageObject = obj;
    var state=imageObject.readyState;
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW=oldImage.width; var dH=oldImage.height;
    if(dW>MaxW || dH>MaxH) {
        a=dW/MaxW; b=dH/MaxH;
        if(b>a) a=b;
        dW=dW/a; dH=dH/a;
    }
    if(dW > 0 && dH > 0)
        imageObject.width=dW;imageObject.height=dH;
    if(state!='complete' || imageObject.width>MaxW || imageObject.height>MaxH) {
        setTimeout("ResizeImage(null,"+MaxW+","+MaxH+")",40);
    }
}

/////////////////////////////////////////////////////////////
//                Setup Class Names
/////////////////////////////////////////////////////////////
//default classes for infobox
var infoboxOkClass		= "notetrue";
var infoboxWarningClass	= "notetrue";
var infoboxErrorClass	= "noteawoke";
var infoboxHintClass	= "note";
//default classes for input field
var inputWarningClass	= "note";
var inputErrorClass		= "noteawoke";
var inputOkClass		= "notetrue";
var inputNormalClass	= "note";

/////////////////////////////////////////////////////////////
//                Initialize Form
/////////////////////////////////////////////////////////////
function initForm(){	
	//initialize form UI and add triggers
	var infobox;
	var x = document.getElementById("register");
	if(!x) return;
	
	var y = x.getElementsByTagName("input");
	for (var i=0;i<y.length;i++){
	
		if(y[i].type == 'text' || y[i].type == 'password'){
			initStatus(y[i],true);
			
			setFiledWidth(y[i]);
			y[i].onfocus	= getFocus;
			y[i].onblur		= lostFocus;
			//y[i].onkeyup	= showMyStatus;
		}
				
	}
}
function initStatus(obj,isInput){
	if(isInput){
		if(isRequired(obj)) showStatus(obj,"Warning");
		else showStatus(obj,"Normal");
	}
	
	var infobox = getInfobox(obj);
	var errorCode = getInitStatus(obj);
	if(infobox && infobox.innerHTML == ""){
		if(!errorCode || errorCode == 0){
			infobox.className	= infoboxHintClass;
			infobox.innerHTML	= getErrorMsg(obj,0);
		}
		if(errorCode >0){
			infobox.className	= infoboxErrorClass;
			infobox.innerHTML	= getErrorMsg(obj,errorCode);
		}
	}	
}
/////////////////////////////////////////////////////////////
//                Base Functions
/////////////////////////////////////////////////////////////
function isIE() {
	if(document.all) return true;
	return false;
}
function setFiledWidth(obj){
	obj.style.width=(19/3)*obj.size+11;
}
function formEle(required,datatype,parameter,infobox,errormsg,combine,status){
	this.r	= required;	
	this.d	= datatype;
	this.p	= parameter;
	this.i	= infobox;
	this.e	= errormsg;
	this.c = combine;
	this.s = status;
	
} 
function isRequired(obj){
//    alert(obj.r);
	if(obj.id){
		if(eval(obj.id).r) return eval(obj.id).r;
	}
	return false;
}
function isCombine(obj){
	if(obj.id){
		if(eval(obj.id).c) return eval(obj.id).c;
	}
	return false;
}
function getDatatype(obj){
	if(obj.id){
		if(eval(obj.id).d) return eval(obj.id).d;
	}
	return false;
}
function getInfobox(obj){
	if(obj.id){
		if(eval(obj.id).i && document.getElementById(eval(obj.id).i)) return document.getElementById(eval(obj.id).i);
	}
	return;
}
function getErrorMsg(obj,errorCode){

	if(obj.id){
		if(eval(obj.id).e[errorCode]) return eval(obj.id).e[errorCode];
	}
	return;
}
function getHintMsg(obj){
	if(obj.id){
		if(eval(obj.id).e[0]) return eval(obj.id).e[0];
	}
	return;
}
function getInitStatus(obj){
	if(obj.id){
		if(eval(obj.id).s || eval(obj.id).s==0 ) return eval(obj.id).s;
	}
	return;
}
function getAttrName(str){
	var s=str.split("=");
	return s[0];
}
function getAttrValue(str){
	var s=str.split("=");
	return s[1];
}
function getAttrValueByName(obj,str){
	var para;
	if(obj.id){
		if(eval(obj.id).p) para=eval(obj.id).p;
		else return;
	}else{
		return;
	}
	var s = para.split(",");
	for(var i=0;i<s.length;i++){
		if(getAttrName(s[i]) == str){
			if(getAttrValue(s[i]))
				return getAttrValue(s[i]);
			else
				return;
		}
	}
	return;
}
function getMailServer(str){
	//be sure str is a correct email address
	str = str.trim();
	return str.substr(str.indexOf("@")+1);
}
String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

/////////////////////////////////////////////////////////////
//                UI Functions
/////////////////////////////////////////////////////////////
function getFocus(evnt)
{
	var obj;
	if (isIE()) {
		obj = event.srcElement;
	}else {
		obj = evnt.target;
	}
	
	showInfo(obj,0);
}
function lostFocus(evnt)
{
	var obj;
	if (isIE()) {
		obj = event.srcElement;
	}else {
		obj = evnt.target;
	}
	showInfo(obj,-1);
	
	
	if(obj.value == ''){
	if(obj.id && eval(obj.id).c && document.getElementById(eval(obj.id).c)){
	if(document.getElementById(eval(obj.id).c).innerHTML.indexOf("img") > 0 ){
	var start =  document.getElementById(eval(obj.id).c).innerHTML.indexOf('>');
	var end = document.getElementById(eval(obj.id).c).innerHTML.length;
	document.getElementById(eval(obj.id).c).innerHTML = document.getElementById(eval(obj.id).c).innerHTML.substring(start +1,end);
	}}
	
	return;
	}
	
	errorCode = validateValue(obj);
	//alert(errorCode);
	
	if(errorCode == 0){
		//showStatus(obj,"Ok");
	
	//check loginid	
	if(obj.id == 'loginid'){
	    checkNick();
	    return;
	}
	
	//check email
	if(obj.id == 'email'){
	    checkEmail()
	    return;
	}
	//check company
	if (obj.id == 'company'){
	    checkCompany()
	    return;
	}
	
		
	if(obj.id){
	
	if(eval(obj.id).c && document.getElementById(eval(obj.id).c))
	if(document.getElementById(eval(obj.id).c).innerHTML.indexOf("images") < 0 ){ 
	document.getElementById(eval(obj.id).c).innerHTML = "&nbsp;<img src=\"../images/true1.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById(eval(obj.id).c).innerHTML;
	}
	document.getElementById(eval(obj.id).i).className = 'note';
	//document.getElementById(eval(obj.id).i).innerHTML = (eval(obj.id).e)[0];
	document.getElementById(eval(obj.id).i).innerHTML = '填写正确。'
	}
		
	}
	
	
	if(errorCode >= 1){
	if(obj.id){
	//alert(eval(obj.id).i);
	if(eval(obj.id).i && document.getElementById(eval(obj.id).i)) 
	document.getElementById(eval(obj.id).i).className = 'noteawoke';
	document.getElementById(eval(obj.id).i).innerHTML = (eval(obj.id).e)[errorCode];
	}
		//showStatus(obj,"Error");
		
	if(document.getElementById(eval(obj.id).c).innerHTML.indexOf("img") > 0 ){
	var start =  document.getElementById(eval(obj.id).c).innerHTML.indexOf('>');
	var end = document.getElementById(eval(obj.id).c).innerHTML.length;
	document.getElementById(eval(obj.id).c).innerHTML = document.getElementById(eval(obj.id).c).innerHTML.substring(start +1,end);
	}
	
	}
	
	if(errorCode < 0){
	
	if(document.getElementById(eval(obj.id).c).innerHTML.indexOf("img") > 0 ){
	var start =  document.getElementById(eval(obj.id).c).innerHTML.indexOf('>');
	var end = document.getElementById(eval(obj.id).c).innerHTML.length;
	document.getElementById(eval(obj.id).c).innerHTML = document.getElementById(eval(obj.id).c).innerHTML.substring(start +1,end);
	}
	
	if(obj.id){
	//alert(eval(obj.id).i);
	if(eval(obj.id).i && document.getElementById(eval(obj.id).i) ) 
	document.getElementById(eval(obj.id).i).className = 'note';
	document.getElementById(eval(obj.id).i).innerHTML = (eval(obj.id).e)[0];
	//document.getElementById(eval(obj.id).i).innerHTML = '&nbsp;';
	}
	
	
		//showStatus(obj,"Normal");
	}
	

}


function showInfo(obj,errorCode,forcible)
//Show Information in Infobox
//errorCode==0 for hint message
//if forcible==true, no matter what the status of infobox now, change it,
//otherwise,if the status of infobox is "Error", do not change it forever.
{
	var infobox = getInfobox(obj);
	
	if(infobox){
		if(infobox.className != infoboxErrorClass || forcible){
			if(errorCode == 0 ){
			//alert(infobox.innerHTML);
				
				infobox.innerHTML	= getErrorMsg(obj,errorCode);
				
				if(infobox.innerHTML != '&nbsp;'){
				infobox.className	= infoboxWarningClass;
				}
			}
			if(errorCode >0){
				infobox.className	= infoboxErrorClass;
				infobox.innerHTML	= getErrorMsg(obj,errorCode);
			}
			if(errorCode <0){
				infobox.className	= infoboxHintClass;
			}
		}
	}	
}
function showMyStatus(evnt){
	var obj,errorCode;
	if (isIE()) {
		obj = event.srcElement;
	}else {
		obj = evnt.target;
	}
	errorCode = validateValue(obj);
	
	if(errorCode == 0){
		showStatus(obj,"Ok");
	}
	if(errorCode >= 1){
		showStatus(obj,"Error");
	}
	if(errorCode < 0){
		showStatus(obj,"Normal");
	}
}
function showStatus(obj,stat)
//Show the status of user currently inputting field
//3 Statuses: Warning|Error|Ok
{
	switch(stat){
		case "Warning":
			obj.className = inputWarningClass;
			break;
		case "Error":
			obj.className = inputErrorClass;
			break;
		case "Ok":
			obj.className = inputOkClass;
			break;
		default:
			obj.className = inputNormalClass;
			break;
	}
}
/////////////////////////////////////////////////////////////
//                Validator Functions
/////////////////////////////////////////////////////////////
function validateValue(obj){
	//trim
	var patn = /(^\s)|(\s$)/;
	if(patn.test(obj.value))	obj.value = obj.value.trim();
	//switcher
	var errorCode = -1;
	
	switch(getDatatype(obj)){
    	case "getcode":
		    errorCode = validateGetcode(obj);
			break;
		case "loginid":
		//alert(obj);
			errorCode = validateUsername(obj);
			break;
		case "password":
			errorCode = validatePassword(obj);
			break;
		case "confirm_password":
			errorCode = validateSafePassword(obj);
			break;
		case "email":
			errorCode = validateEmail(obj);
			break;
		
		case "company":
			errorCode = validateCompany(obj);
			break;
		case "mobile":
			errorCode = validateMobile(obj);
			break;
		case "address":
			errorCode = validateAddress(obj);
			break;
		case "first_name":
			errorCode = validateFirstName(obj);
			break;
 		case "job_title":
			errorCode = validateJobTitle(obj);
			break;
		case "buykeyword":
			errorCode = validateKeyword(obj);
			break;	
		case "salekeyword":
			errorCode = validateKeyword(obj);
			break;	
		case "phone_country":
			errorCode = validatePhoneArea(obj);
			break;	
		case "phone_area":
			errorCode = validatePhoneArea(obj);
			break;	
		case "phone_number":
			errorCode = validatePhoneNumber(obj);
			break;
		case "fax_country":
			errorCode = validateFaxArea(obj);
			break;	
		case "fax_area":
			errorCode = validateFaxArea(obj);
			break;	
		case "fax_number":
			errorCode = validateFaxNumber(obj);
			break;		
		default:
			errorCode = -1;
			break;
	}
	return errorCode;
}

function validateRetryAll(formObj){

	var obj,infobox,pass;
	pass = true;
	var x = formObj;
	if(!x) return;
	var y = x.getElementsByTagName("input");
	for (var i=0;i<y.length;i++){
		obj = y[i];		
		obj.value = obj.value.trim();
		infobox = getInfobox(y[i]);
		if(obj.type == 'text' ){
			if(!isRequired(obj) && obj.value == ""){
				continue;
			}
			if(isRequired(obj) && obj.value == ""){
				pass = false;
				obj.focus();
				showStatus(obj,"Error");
				infobox.className	= infoboxErrorClass;
				infobox.innerHTML	= requireErrorInfo + getErrorMsg(obj,0);
				if(isCombine(obj)) break;
				continue;
			}
			if(validateValue(obj)>0){
				pass = false;
				obj.focus();
				showStatus(obj,"Error");
				showInfo(obj,validateValue(obj),true);
				if(isCombine(obj)) break;
				continue;
			}
			if(validateValue(obj)==0){
			
		
			if(obj.id){
	
	if(eval(obj.id).c && document.getElementById(eval(obj.id).c))
	if(document.getElementById(eval(obj.id).c).innerHTML.indexOf("img") < 0 ){ 
	document.getElementById(eval(obj.id).c).innerHTML = "&nbsp;<img src=\"images/icon_right_19x19.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById(eval(obj.id).c).innerHTML;
	}
	document.getElementById(eval(obj.id).i).className = 'note';
	document.getElementById(eval(obj.id).i).innerHTML = (eval(obj.id).e)[0];
	
	}
		
	
				//showStatus(obj,"Ok");
				//infobox.className	= infoboxHintClass;
				//infobox.innerHTML	= validatedInfo;
				continue;
			}
		}
	}
	return pass;

}

function validateAll(formObj){
	var obj,infobox,pass;
	pass = true;
	var x = formObj;
	if(!x) return;
	var y = x.getElementsByTagName("input");

	for (var i=0;i<y.length;i++){
		obj = y[i];
		obj.value = obj.value.trim();
		infobox = getInfobox(y[i]);
		if(obj.type == 'text' || obj.type == 'password'){
			if(!isRequired(obj) && obj.value == ""){
				continue;
			}
			if(isRequired(obj) && obj.value == ""){
				pass = false;
				obj.focus();
				showStatus(obj,"Error");
				infobox.className	= infoboxErrorClass;
				infobox.innerHTML	= "<h1>"+requireErrorInfo + getErrorMsg(obj,0) + "<\/h1>";
				//if(isCombine(obj)) break;
				continue;
			}
			if(validateValue(obj)>0){
				pass = false;
				obj.focus();
				showStatus(obj,"Error");
				showInfo(obj,validateValue(obj),true);
				//if(isCombine(obj)) break;
				continue;
			}
			if(validateValue(obj)==0){
				//showStatus(obj,"Ok");
				//infobox.className	= infoboxHintClass;
				//infobox.innerHTML	= validatedInfo;
				continue;
			}
		}
	}
	
	var titlecheck = false;
	
	for(i=0;i<document.form.J_z_Z_Title.length;i++){
 	 if(document.form.J_z_Z_Title[i].checked){
  	  titlecheck = true;
  	 
  	  break;
	  }
	}
	if(!titlecheck){
	    pass = false;
	    warning_check("title_info",'<h1>请选择性别<\/h1>');   
	    document.getElementById("title_info").focus();
	}else{
    	clean_check("title_info"); 
	}
	
	var keyselected ='';
	for(i=0;i<document.form.business_role.length;i++){
 	 if(document.form.business_role[i].checked){
  	      keyselected = document.form.business_role[i].value;
  	      break;
	  }
	}
	if(keyselected == 'buyer'){
	    if(document.form.J_z_Z_BuyKeywords.value == ''){
	        warning_check("business_info",'<h1>请填写关键字<\/h1>');  
	        document.getElementById("business_info").focus();
	        pass = false;
	    }
	}else if(keyselected == 'seller'){
	    if(document.form.J_z_Z_SaleKeywords.value == ''){
	        warning_check("business_info",'<h1>请填写关键字<\/h1>');
	        document.getElementById("business_info").focus();
	        pass = false; 
    	} 
	}else if(keyselected == 'both'){
	    if(document.form.J_z_Z_SaleKeywords.value == '' || document.form.J_z_Z_BuyKeywords.value == ''){
	        warning_check("business_info",'<h1>请填写关键字<\/h1>');  
	        document.getElementById("business_info").focus(); 
	        pass = false;
	    }
    }
    
	if(document.form.J_z_Z_City.value == '' ){
	    warning_check("city_info",'<h1>请选择省份城市<\/h1>');  
	    document.getElementById("city_info").focus(); 
	    pass = false;
	}else{
    	clean_check("city_info");  
	}

    //var J_z_Z_CategoryIda=document.form.J_z_Z_CategoryId;
    //for(i=0;i<J_z_Z_CategoryIda.length;i++){
    //   if(!J_z_Z_CategoryIda[i].checked){
	//warning_check("category_info",'<h1>请选择主营行业<\/h1>');  
	//document.getElementById("category_info").focus();  
	//pass = false;
	//}else{
	//clean_check("category_info");  
	//}
	//}
	
	if(document.getElementById("loginid_info_check").innerHTML.toLowerCase().indexOf("img") < 0 || document.getElementById("loginid_info").className == 'noteawoke'){
	    document.getElementById("loginid_info").focus();
	    pass= false;
	}
	
	if(document.getElementById("email_info_check").innerHTML.toLowerCase().indexOf("img") < 0 || document.getElementById("email_info").className == 'noteawoke'){
	    document.getElementById("email_info").focus();
	    pass= false;
	}

	if(document.getElementById("company_info_check").innerHTML.toLowerCase().indexOf("img") < 0 || document.getElementById("company_info").className == 'noteawoke'){
	    document.getElementById("company_info").focus();
	    pass= false;
	}

	return pass;
}


//functions for each particular datatype validation
function validateGetcode(obj){
 var str=obj.value;
 if(str != document.getElementById("sessionCheckCode").value) return 1;
	return 0;
}

function validateUsername(obj){
	var str = obj.value;
	var patn =   /^[a-zA-Z0-9]+$/; 
	//var patn = /^[^\s]*$/;
	if(!checkByteLength(str,4,20)) return 1;
	
	if(!patn.test(str)){
		return 1;
	}
	return 0; 
}
function validatePassword(obj){
	var str = obj.value;
	var patn = /.{6,16}/; 
	var patn1 =   /^[a-zA-Z0-9_]+$/;
	if(!patn.test(str) || !patn1.test(str) ) return 1;
	return 0; 
}
function validateSafePassword(obj){
	var str = obj.value;
	if(str != document.getElementById("password").value) return 1;
	
	return 0;
}
function validateEmail(obj){
	var str = obj.value;
	var patn = /^[_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]*)*@[a-zA-Z0-9\-]+([\.][a-zA-Z0-9\-]+)+$/;
	if(patn.test(str)){
		
		return 0;
	}else{
		return 1; //incorrect format
	}
}
function validateNum(obj){
	var str = obj.value;
	var patn = new RegExp("\\d{"+getAttrValueByName(obj,"minlen")+","+getAttrValueByName(obj,"maxlen")+"}"); 
	if(patn.test(str)) return 0;
	return 1; 	
}
function validateMobile(obj){
var str1 = obj.value;

var str = tot(str1); 
obj.value = str;

	
if(str.length > 16){
	
return 1;
}
if(str.length == 0){
return -1;

}

var patn = /^[0-9]+$/;
if(patn.test(str)) return 0;
return 2; 	
}

function validatePhoneArea(obj){
var str1 = obj.value;

var str = tot(str1); 
obj.value = str;
   
if(str.length == 0){
return -1;

}


var patn = /^[0-9]+$/;
if(!patn.test(str)) return 1;
return validatePhone(); 

}


function validateFaxArea(obj){
var str1 = obj.value;

var str = tot(str1); 
obj.value = str;

if(str.length == 0){
return -1;

return 
}


var patn = /^[0-9]+$/;
if(!patn.test(str)) return 1;
return validateFax(); 

}


function validateArea(obj){
var str1 = obj.value;

var str = tot(str1); 
obj.value = str;

if(str.length == 0){
return -1;

return 
}


var patn = /^[0-9]+$/;
if(!patn.test(str)) return 1;   

return 0; 

}


function validatePhone(){

if(validateArea(document.getElementById("phone_country")) == 0 && validateArea(document.getElementById("phone_area")) == 0 && validateNumber(document.getElementById("phone_number")) == 0){
return 0;
}else{

return -1
}

}


function validateFax(){

if(validateArea(document.getElementById("fax_country")) == 0 && validateArea(document.getElementById("fax_area")) == 0 && validateNumber(document.getElementById("fax_number")) == 0){
return 0;
}else{

return -1
}

}


function validateNumber(obj){
var str1 = obj.value;

var str = tot(str1); 
obj.value = str;
	

if(str.length == 0){
return -1;

}
var patn = /^[0-9-\/]+$/;
if(!patn.test(str)) return 1;
return 0;

}


function validatePhoneNumber(obj){
var str = obj.value;
	

if(str.length == 0){
return -1;

}
var patn = /^[0-9-\/]+$/;
if(!patn.test(str)) return 1;
return validatePhone(); 

}

function validateFaxNumber(obj){
var str = obj.value;
	

if(str.length == 0){
return -1;

}
var patn = /^[0-9-\/]+$/;
if(!patn.test(str)) return 1;
return validateFax(); 

}



function validateKeyword(obj){

var str = obj.value;
	
if(str.length > 40){
return 1;
}

if(str.length == 0){
return -1;

}

	var pass = true;
	var keyselected ='';
	for(i=0;i<document.form.business_role.length;i++){
 	 if(document.form.business_role[i].checked){
  	  keyselected = document.form.business_role[i].value;
  	  break;
	  }
	}
	
	if(keyselected == 'buyer'){
	if(document.form.J_z_Z_BuyKeywords.value == ''){
	pass = false;
	}
	
	}else if(keyselected == 'seller'){
	if(document.form.J_z_Z_SaleKeywords.value == ''){
	pass = false; 
	} 
	
	
	}else if(keyselected == 'both'){
	
	if(document.form.J_z_Z_SaleKeywords.value == '' || document.form.J_z_Z_BuyKeywords.value == ''){
	pass = false;
	}

        }
        
        
        if(pass){
        
        return 0;
        
        }



return -1;

}


function validateCompany(obj){
var str = obj.value;
	
if(str.length > 50){
return 1;
}

if(str.length == 0){
return -1;

}

return 0;

}


function validateJobTitle(obj){
var str = obj.value;
if(str.length > 50){

return 1;

}

if(str.length == 0){
return -1;

}

return 0;
}

function validateFirstName(obj){

var str = obj.value;
	
if(str.length > 32){
return 1;
}

if(str.length == 0){
return -1;

}

return 0;

}


function validateAddress(obj){
var str = obj.value;
	
if(str.length > 80){
return 1;
}

if(str.length == 0){
return -1;

}

return 0;

}

function validateCheckCode(obj){
	var str = obj.value;
	var patn = /^[0-9a-zA-Z]{4}$/;
	if(patn.test(str)) return 0;
	return 1;
}	

function checkByteLength(str,minlen,maxlen) {
	if (str == null) return false;
	var l = str.length;
	var blen = 0;
	for(i=0; i<l; i++) {
		if ((str.charCodeAt(i) & 0xff00) != 0) {
			blen ++;
		}
		blen ++;
	}
	if (blen > maxlen || blen < minlen) {
		return false;
	}
	return true;
}      



function tot(mobnumber){                        
while(mobnumber.indexOf("０")!=-1){           
mobnumber = mobnumber.replace("０","0");        
}                                               
while(mobnumber.indexOf("１")!=-1){             
mobnumber = mobnumber.replace("１","1");}       
while(mobnumber.indexOf("２")!=-1){             
mobnumber = mobnumber.replace("２","2");}       
while(mobnumber.indexOf("３")!=-1){             
mobnumber = mobnumber.replace("３","3");}       
while(mobnumber.indexOf("４")!=-1){             
mobnumber = mobnumber.replace("４","4");}       
while(mobnumber.indexOf("５")!=-1){             
mobnumber = mobnumber.replace("５","5");}       
while(mobnumber.indexOf("６")!=-1){             
mobnumber = mobnumber.replace("６","6");}       
while(mobnumber.indexOf("７")!=-1){             
mobnumber = mobnumber.replace("７","7");}       
while(mobnumber.indexOf("８")!=-1){             
mobnumber = mobnumber.replace("８","8");}       
while(mobnumber.indexOf("９")!=-1){             
mobnumber = mobnumber.replace("９","9");}       
                                                
return mobnumber;                               
}	      

   var keyStr = "ABCDEFGHIJKLMNOP" +
                "QRSTUVWXYZabcdef" +
                "ghijklmnopqrstuv" +
                "wxyz0123456789+/" +
                "=";

   function encode64(input) {
      input = escape(input);
      var output = "";
      var chr1, chr2, chr3 = "";
      var enc1, enc2, enc3, enc4 = "";
      var i = 0;

      do {
         chr1 = input.charCodeAt(i++);
         chr2 = input.charCodeAt(i++);
         chr3 = input.charCodeAt(i++);

         enc1 = chr1 >> 2;
         enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
         enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
         enc4 = chr3 & 63;

         if (isNaN(chr2)) {
            enc3 = enc4 = 64;
         } else if (isNaN(chr3)) {
            enc4 = 64;
         }

         output = output + 
            keyStr.charAt(enc1) + 
            keyStr.charAt(enc2) + 
            keyStr.charAt(enc3) + 
            keyStr.charAt(enc4);
         chr1 = chr2 = chr3 = "";
         enc1 = enc2 = enc3 = enc4 = "";
      } while (i < input.length);

      return output;
   }

   function decode64(input) {
      var output = "";
      var chr1, chr2, chr3 = "";
      var enc1, enc2, enc3, enc4 = "";
      var i = 0;

      // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
      var base64test = /[^A-Za-z0-9\+\/\=]/g;
      if (base64test.exec(input)) {
         alert("There were invalid base64 characters in the input text.\n" +
               "Valid base64 characters are A-Z, a-z, 0-9, '+', '/', and '='\n" +
               "Expect errors in decoding.");
      }
      input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

      do {
         enc1 = keyStr.indexOf(input.charAt(i++));
         enc2 = keyStr.indexOf(input.charAt(i++));
         enc3 = keyStr.indexOf(input.charAt(i++));
         enc4 = keyStr.indexOf(input.charAt(i++));

         chr1 = (enc1 << 2) | (enc2 >> 4);
         chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
         chr3 = ((enc3 & 3) << 6) | enc4;

         output = output + String.fromCharCode(chr1);

         if (enc3 != 64) {
            output = output + String.fromCharCode(chr2);
         }
         if (enc4 != 64) {
            output = output + String.fromCharCode(chr3);
         }

         chr1 = chr2 = chr3 = "";
         enc1 = enc2 = enc3 = enc4 = "";

      } while (i < input.length);

      return unescape(output);
   }


 document.ondragstart = function(){
 
 return false;
 
 }
 

function checkNick() {
	var nick = document.getElementById("loginid").value;
	if (nick == "") {
		return false;
	}
	if (nick == lastNick) {
		return false;
	}
	document.checkNickForm.TPL_NICK.value = nick;
	document.getElementById("loginid_info").innerHTML = "检测中，请稍等...";
	document.getElementById("loginid_info").className = "notetrue";
	document.checkNickForm.submit();
	return true;
}
function checkEmail() {
	var email = document.getElementById("email").value;
	if (email == "") {
		return false;
	}
	
	document.checkEmailForm.TPL_EMAIL.value = email;
	document.getElementById("email_info").innerHTML = "检测中，请稍等...";
	document.getElementById("email_info").className = "notetrue";
	document.checkEmailForm.submit();
	return true;
}
//检测公司名称是否相同
function checkCompany() {
	var company = document.getElementById("company").value;
	if (company == "") {
		return false;
	}
	
	document.checkcompanyForm.TPL_company.value = company;
	document.getElementById("company_info").innerHTML = "检测中，请稍等...";
	document.getElementById("company_info").className = "notetrue";
	document.checkcompanyForm.submit();
	return true;
}

function submitForm(obj) {

		if("cn" == selectCountryList) {
			form.J_z_Z_Country.value = "CN";
            
			var provinceSelectedIndex = form.provinceCN.selectedIndex;
			if( provinceSelectedIndex < 0)
				provinceSelectedIndex = 0;

			form.J_z_Z_Province.value = form.provinceCN.options[provinceSelectedIndex].value;

			var capitalSelectIndex = form.capitalCN.selectedIndex;
			if( capitalSelectIndex < 0)
				capitalSelectIndex = 0;

            form.SelectCapitalId.value = form.capitalCN.options[capitalSelectIndex].value;

			var citySelectIndex = form.cityCN.selectedIndex;
			if( citySelectIndex < 0)
				citySelectIndex = 0;

			form.J_z_Z_City.value = form.cityCN.options[citySelectIndex].value;

		}else if( "hot" == selectCountryList ) {
			var country = CountryArrHot[CountryListHot.selectedIndex];
			form.J_z_Z_Country.value = country.id;

			if(country.hasProvince=="0") {
				form.J_z_Z_Province.value = form.province2.value;
			}
			else {
		    		form.J_z_Z_Province.value = ""
		    }

		    form.J_z_Z_City.value = form.notCNCity.value;


		}else {

            var country = CountryArr[CountryForm.selectedIndex-1];

            form.J_z_Z_Country.value = country.id;

			if(CountryArr[form.CountryList.selectedIndex-1].hasProvince=="0") {
				form.J_z_Z_Province.value = form.province2.value;
			}
		    else if (CountryArr[form.CountryList.selectedIndex-1].hasProvince=="1" ) {
				var selectedIndex = form.province1.selectedIndex;
				if( selectedIndex < 0)
			   		selectedIndex = 0;
		    	form.J_z_Z_Province.value = form.province1.options[selectedIndex].value;
		    }
			else {
		    		form.J_z_Z_Province.value = ""
		    }
		    form.J_z_Z_City.value = form.notCNCity.value;
		}

	var ret = validateAll(obj);
	
	//if(document.form.J_z_Z_Title.value ==
	
	if (ret == true) {
		if (document.form.Submit) {
			document.form.Submit.disabled = true;
		}
	}

	return ret;
}


function setBusinessStyle(){

business_info.className = 'notetrue';	

}

function tr_display(type){

business_info.className = 'notetrue';
business_info.innerHTML = '为了给您提供匹配的产品信息，请填写贵公司主营的产品（或服务）关键字。<br>如有多个，请用逗号分隔。如：吸管，杯子';
if(type == 'buy'){

buykeywords.style.display = 'block';
sellkeywords.style.display = 'none';
}

if(type == 'sell'){

buykeywords.style.display = 'none';
sellkeywords.style.display = 'block';
}

if(type == 'both'){

buykeywords.style.display = 'block';
sellkeywords.style.display = 'block';
}

}


function goinitstyle(obj){
//alert(obj.id);
document.getElementById("business_info").className = 'note';
document.getElementById("business_info").innerHTML = '为了给您提供匹配的产品信息，请填写贵公司主营的产品（或服务）关键字。<br>如有多个，请用逗号分隔。如：吸管，杯子';


	var pass = true;
	var keyselected ='';
	for(i=0;i<document.form.business_role.length;i++){
 	 if(document.form.business_role[i].checked){
  	  keyselected = document.form.business_role[i].value;
  	  break;
	  }
	}
	
	if(keyselected == 'buyer'){
	if(document.form.J_z_Z_BuyKeywords.value != ''){
	
	if(document.getElementById("keywords_info_check").innerHTML.indexOf("images") < 0 ){ 
	document.getElementById("keywords_info_check").innerHTML = "&nbsp;<img src=\"../images/true1.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById("keywords_info_check").innerHTML;
	}
	document.getElementById("business_info").className = 'note';	
	document.getElementById("business_info").innerHTML = '填写正确。'
	}
	
	}else if(keyselected == 'seller'){
	if(document.form.J_z_Z_SaleKeywords.value != ''){
	if(document.getElementById("keywords_info_check").innerHTML.indexOf("images") < 0 ){ 
	document.getElementById("keywords_info_check").innerHTML = "&nbsp;<img src=\"../images/true1.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById(keywords_info_check).innerHTML;
	}
	document.getElementById("business_info").className = 'note';	
	document.getElementById("business_info").innerHTML = '填写正确。'
	} 
	
	
	}else if(keyselected == 'both'){
	
	if(document.form.J_z_Z_SaleKeywords.value != '' && document.form.J_z_Z_BuyKeywords.value != ''){
	
	if(document.getElementById("keywords_info_check").innerHTML.indexOf("images") < 0 ){ 
	document.getElementById("keywords_info_check").innerHTML = "&nbsp;<img src=\"../images/true1.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById("keywords_info_check").innerHTML;
	}
	document.getElementById("business_info").className = 'note';	
	document.getElementById("business_info").innerHTML = '填写正确。'
	}

        }

}


function info_check(obj){

if(document.getElementById(obj).innerHTML.indexOf("images") < 0 ){
	document.getElementById(obj).innerHTML = "&nbsp;<img src=\"../images/true1.gif\" width=\"19\" height=\"16\" align=\"absmiddle\"> " + document.getElementById(obj).innerHTML;

}

}

function warning_check(obj,message){

document.getElementById(obj).innerHTML = message;
document.getElementById(obj).className= 'noteawoke';

}

function clean_check(obj){

document.getElementById(obj).innerHTML = "";
document.getElementById(obj).className= 'note';
}


/********************************** chinese ***************************************/
/**
*校验字符串是否为中文
*返回值：
*如果为空，定义校验通过，           返回true
*如果字串为中文，校验通过，         返回true
*如果字串为非中文，             返回false    参考提示信息：必须为中文！
*/
function checkIsChinese(str)
{
    //如果值为空，通过校验
    if (str == "")
        return true;
    var pattern = /^([\u4E00-\u9FA5]|[\uFE30-\uFFA0])*$/gi;
    if (pattern.test(str))
        return true;
    else
        return false;
}//~~~



	function Country(id,title,phone,hasProvince) {
		this.id = id;
		this.title=title;
		this.phone=phone;
		this.hasProvince=hasProvince;
		this.boardlist=new Array();
		this.addBoard=addBoard;
		this.getOptions = getOptions;
	}

	function addBoard(board) {
		this.boardlist = this.boardlist.concat(board);
	}

	function getOptions() {
		var tmp = new Array();
		for(var i=0; i < this.boardlist.length;i++) {
			var b = this.boardlist[i];
			tmp[i]= b.getOption();
		}
		return tmp;
	}

		function Board(country,provinceId,province) {
		this.country=country;
		this.province=province;
		this.provinceId = provinceId;
		this.getOption=getOption;
	}

	function getOption() {

		if(this.country == "CN")
			return new Option(this.province,this.provinceId);
		return new Option(this.province,this.province);
	}

    function provincesList(countryName,provinceId,provinceName){
        this.countryName = countryName;
        this.provinceId = provinceId;
        this.provinceName = provinceName;
        this.provincesArr = new Array();
        this.addProvinces = addProvinces;
        this.getProvinces = getProvinces;
    }

    function addProvinces(province){
        this.provincesArr = this.provincesArr.concat(province);
    }

    function getProvinces(){
        var tmp = new Array();
        for(var i = 0;i < this.provincesArr.length;i++){
            var b = this.provincesArr[i];
            tmp[i] = b;
        }
        return tmp;
    }


	function provinceCN(provinceName,capitalCityId,capitalCityName) {
		this.provinceName = provinceName;
		this.capitalCityId = capitalCityId;
		this.capitalCityName = capitalCityName;
		this.capitalCityArr = new Array();
		this.addCity = addCity;
		this.getCapitalCitys = getCapitalCitys;

	}

	function addCity(cityId,cityName) {
		this.capitalCityArr = this.capitalCityArr.concat(new Option(cityName,cityId));
	}

	function getCapitalCitys() {
		var tmp = new Array();
		for(var i=0; i < this.capitalCityArr.length;i++) {
			var b = this.capitalCityArr[i];
			tmp[i]= b;
		}
		return tmp;
	}

		
	function changeCountry(list,selectFlag) {
	    var selectIndex = list.selectedIndex;

		if(selectFlag == "cn" || selectFlag == "hot" ) {

			if(selectIndex == 0){
				selectFlag = "cn"
			}else if( selectIndex == 4 ){
				selectFlag = "all";
				selectIndex = 1;
			}else{
				selectFlag = "hot";
			}

		}else if(selectFlag == "all" ){
			var cn = CountryArr[selectIndex-1].id;

			if("CN" == cn) {
				selectFlag = "cn";
				selectIndex = 0;
			}else if("HK" == cn || "TW" == cn || "SG" == cn ){
				selectFlag = "hot";
				if("HK" == cn) {
					selectIndex = 1;
				}
				if("TW" == cn) {
					selectIndex = 2;
				}
				if("SG" == cn) {
					selectIndex = 3;
				}

			}else {
				selectFlag = "all";
			}
		}

		if ( selectFlag == "all" && selectIndex<=0) {

			CountryForm.options[0].selected=true;
    		var len = boardForm.options.length;
    		for (var i=len-1;i>0;i--){
    			boardForm.options[i]=null;
    		}

		}
        else {

        	var countryname;
        	if("cn" == selectFlag){
        		countryname = CountryArrCN[selectIndex].id;
        	}else if ("hot" == selectFlag){
        		countryname = CountryArrHot[selectIndex].id;
        	}else {
        		countryname = CountryArr[selectIndex-1].id;
        	}

    		selectCountryList = selectFlag;

			
			tb6.style.display="block";

            	    if(initFlag != "true"){
            form.notCNCity.value = "";
	    form.province2.value = "";
	    }
	    initFlag = "false";
            
           
    		if("CN" == countryname) {

                var provincecnSelected = provinceCN.selectedIndex;

    			var boardscn = CountryArrCN[selectIndex].getOptions();
	    		for (var i=0;i< boardscn.length;i++) {
	    			provinceCN.options[i+1] = boardscn[i];
	    			if( provincecnSelected > 0 && (provincecnSelected == i+1 ) ) {
	    			    provinceCN.options[i+1].selected=true;
	    			}
    			}

				selectCountryList = "cn";

    			
    			tb1.style.display="block";
    			tb2.style.display="none";
    			tb3.style.display="none";
    			tb4.style.display="none";
    			tb5.style.display="none";
				tb6.style.display="none";

    		}else if("HK" == countryname || "TW" == countryname || "SG" == countryname ) {
    			selectCountryList = "hot";

                tb1.style.display="none";
                tb2.style.display="block";
                tb3.style.display="none";
                tb4.style.display="none";

    			if("HK" == countryname || "TW" == countryname) {
                    tb5.style.display="none";

    			}else {
                    tb5.style.display="block";
    			}

    		}else {

	    		var len = boardForm.options.length;
				var boards = CountryArr[selectIndex-1].getOptions();

	    		for (var i=len-1;i>0;i--){
	    			boardForm.options[i]=null;
	    		}
	    		for (var i=0;i<boards.length;i++) {
	    			boardForm.options[i+1]=boards[i];
	    		}

	    		if(CountryArr[selectIndex-1].hasProvince=="1") {

                    tb1.style.display="none";
                    tb2.style.display="none";
                    tb3.style.display="block";
                    tb4.style.display="block";
                    tb5.style.display="none";

	    		} else if (CountryArr[selectIndex-1].hasProvince=="0"){

                    tb1.style.display="none";
                    tb2.style.display="none";
                    tb3.style.display="block";
                    tb4.style.display="none";
                    tb5.style.display="block";
	    		} else {
                    tb1.style.display="none";
                    tb2.style.display="none";
                    tb3.style.display="block";
                    tb4.style.display="none";
                    tb5.style.display="none";

	    		}
    		}

    		if(selectCountryList == "cn" || selectCountryList == "hot") {
    			CountryPhone.value = CountryArrCN[selectIndex].phone;
				//FaxPhone.value = CountryArrCN[selectIndex].phone;

				CountryListCN.options[selectIndex].selected=true;
        		CountryListHot.options[selectIndex].selected=true;
			}else {
				CountryPhone.value = CountryArr[selectIndex-1].phone;
				//FaxPhone.value = CountryArr[selectIndex-1].phone;
				CountryForm.options[selectIndex].selected=true;
			}
			changeAddress();
		}
	}

	function selectBoard(country,bid) {
		for(var i=0;i<CountryForm.length;i++) {
			if (CountryForm.options[i].value==country) {
				CountryForm.options[i].selected=true;
				changeCountry(CountryForm);
				break;
			}
		}
		for(var i=0;i<boardForm.length;i++) {
			if (boardForm.options[i].value==bid) {
				boardForm.options[i].selected=true;
				break;
			}
		}
	}

	function changeProvinceList(provinceList) {

		var index = provinceList.selectedIndex;
		var len2 = capitalCN.options.length;
		for(var i = len2-1;i>0;i--){
			capitalCN.options[i] = null;
		}

		len2 = cityCN.options.length;
		for (var i = len2-1;i>0;i--){
			cityCN.options[i] = null;
		}

		if(index <= 0) {
            selectedProvinceName = "";
            selectedCityName = "";
		}
		else {
			var province = provinceList.options[index].value;
			SelectProvinceId = province;
			var len = provincesListArr.length;

			var tmpProvincesList;
			for(var i=0;i < len;i++){
                tmpProvincesList = provincesListArr[i];

                if(SelectProvinceId == tmpProvincesList.provinceId ) {               
         			var len1 = capitalCN.options.length;
		            for(var i = len1-1;i>0;i--){
			            capitalCN.options[i] = null;
		            }

		            var capitals = tmpProvincesList.getProvinces();

		            for(var i=0;i<capitals.length;i++){
			          capitalCN.options[i+1] = new Option(capitals[i].capitalCityName,capitals[i].capitalCityId);
			           }
                    break;
                }
			}


              capitalCN.options[1].selected=true;
	      changeCapitalCity(capitalCN);


            selectedProvinceName = provinceList.options[index].text;
          
           

            changeAddress();
info_check('city_info_check');
clean_check("city_info");
		}
	}

	function changeCapitalCity(list) {

		if (list.selectedIndex<=0) {
			form.cityCN.options[0].selected=true;
			var len = form.cityCN.options.length;

			for (var i=len-1;i>0;i--){
				form.cityCN.options[i]=null;
			}
		}
	    else {

			var tmpProvincesList;
    		var len = provincesListArr.length;

    		var capital = list.options[list.selectedIndex].value;

			for(var i=0;i<len;i++){
                tmpProvincesList = provincesListArr[i];

                if(SelectProvinceId == tmpProvincesList.provinceId ) {
                    		            var capitals = tmpProvincesList.getProvinces();
		            for(var i=0;i<capitals.length;i++){
		                var c = capitals[i];
		                if(c.capitalCityId == capital){
                			var len1 = form.cityCN.options.length;
                			for (var i=len1-1;i>0;i--){
                				form.cityCN.options[i]=null;
                			}
                            var citys = c.getCapitalCitys();
                	        for(var i=0;i<citys.length;i++){
                	            form.cityCN.options[i+1] = citys[i];
                	        }
                            break;
		                }
                        //capitalCN.options[i+1] = new Option(capitals[i].Name,capitals[i].Id);
		            }
                    break;
                }
			}
               
	        cityCN.options[1].selected=true;

	        selectedCityName = cityCN.options[cityCN.selectedIndex].text;
	        changeAddress();
		}
	}
    function changeCity(list){
        if( list.selectedIndex > 0 ) {
            selectedCityName = list.options[list.selectedIndex].text;
        }
       info_check('city_info_check');
       clean_check("city_info");
        changeAddress();
    }


	function doSubmit() {

		if("cn" == selectCountryList) {
			form.J_z_Z_Country.value = "CN";
            
			var provinceSelectedIndex = form.provinceCN.selectedIndex;
			if( provinceSelectedIndex < 0)
				provinceSelectedIndex = 0;

			form.J_z_Z_Province.value = form.provinceCN.options[provinceSelectedIndex].value;

			var capitalSelectIndex = form.capitalCN.selectedIndex;
			if( capitalSelectIndex < 0)
				capitalSelectIndex = 0;

            form.SelectCapitalId.value = form.capitalCN.options[capitalSelectIndex].value;

			var citySelectIndex = form.cityCN.selectedIndex;
			if( citySelectIndex < 0)
				citySelectIndex = 0;

			form.J_z_Z_City.value = form.cityCN.options[citySelectIndex].value;

		}else if( "hot" == selectCountryList ) {
			var country = CountryArrHot[CountryListHot.selectedIndex];
			form.J_z_Z_Country.value = country.id;

			if(country.hasProvince=="0") {
				form.J_z_Z_Province.value = form.province2.value;
			}
			else {
		    		form.J_z_Z_Province.value = ""
		    }

		    form.J_z_Z_City.value = form.notCNCity.value;


		}else {

            var country = CountryArr[CountryForm.selectedIndex-1];

            form.J_z_Z_Country.value = country.id;

			if(CountryArr[form.CountryList.selectedIndex-1].hasProvince=="0") {
				form.J_z_Z_Province.value = form.province2.value;
			}
		    else if (CountryArr[form.CountryList.selectedIndex-1].hasProvince=="1" ) {
				var selectedIndex = form.province1.selectedIndex;
				if( selectedIndex < 0)
			   		selectedIndex = 0;
		    	form.J_z_Z_Province.value = form.province1.options[selectedIndex].value;
		    }
			else {
		    		form.J_z_Z_Province.value = ""
		    }
		    form.J_z_Z_City.value = form.notCNCity.value;
		}
	}
