﻿var FrontQuestionnaire_survey01 ={
  
	
		/**
	 * 提交问卷调查后返回状态
	  * @param submits 提交状态
	 * @param type 问卷类型
	  * @param URL URL地址
	 * 如果状态为2;则返回您已经回答过本问卷 
	 * 如果状态为3;则返回没有相关的问卷信息！
	 */
	savesuccess: function(submits,type,URL){
		if(submits=='4'){
			alert(i18n_questionnaire_doAdd_question_input_noresult);
			history.back(-1);
    	}
		if(submits == '2'){
			if(type == 'product'){
				alert(i18n_questionnaire_save_question_input_answer_repeat);
				window.location = URL;
			}else if(type == 'info'){
				alert(i18n_questionnaire_save_question_input_answer_repeat);
				window.location =  URL;
			}else{
				alert(i18n_questionnaire_save_question_input_answer_repeat);
				history.back(-2);
			}
		}
		if(submits == '3'){
			if(type == 'product'){
				alert(i18n_questionnaire_save_question_input_front_no_result);
				window.location = URL;
			}else if(type == 'info'){
				alert(i18n_questionnaire_save_question_input_front_no_result);
				window.location =  URL;
			}else{
				alert(i18n_questionnaire_save_question_input_front_no_result);
				history.back(-2);
			}
		}
	},
	/**
	 * 参与调查和查看结果连接
	  * @param questionId 问卷ID
	 * @param type 问卷类型
	  * @param callId 问卷调用ID
	  * @param urls URL地址
	  * @param show 是否显示提示
	 *  @param openType 打开方式
	 * 
	 */
	clickopen: function(type,questionId,callId,urls,show,openType){
		if(type=="product"){
			if(show=="true"){
			// alert(i18n_questionnaire_doAdd_question_input_noresultshow);
			 return;
			}else{
				urls=urls.replace("param1",questionId).replace("param2",callId);
                 if(openType=="_blank"){
			       window.open(urls,'','height=500, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
				 }else{
				   window.location.href=urls;
				 }
			}
		
		}else if(type=="info"){
		    if(show=="true"){
			//  alert(i18n_questionnaire_doAdd_question_input_noresultshow);
			  return;
			}else{
				urls=urls.replace("param1",questionId).replace("param2",callId);
			   if(openType=="_blank"){
			       window.open(urls,'','height=500, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
				 }else{
				   window.location.href=urls;
				 }
			}
		}else if(type=="other"){
		     // alert(i18n_questionnaire_doAdd_question_input_noresultshow);
			  return;
		}
		else{
		  if(show=="true"){
			// alert(i18n_questionnaire_doAdd_question_input_noresultshow);
			 return;
			}else{
				urls=urls.replace("param1",questionId);
			   if(openType=="_blank"){
			       window.open(urls,'','height=500, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no');
				 }else{
				   window.location.href=urls;
				 }
			}
		
		}
		  
	},
	/**
	 * 表单验证
	 *
	 * @param frm 表单
	 * @param userId 用户ID
	 * @param mustInputUserInfo 必须输入用户信息
	 * @param openurl 连接URL
	 * @param pname 名称
	 * @param pcomp  公司
	 * @param padd 地址
	 * @return 表单是否验证成功
	 */
check: function(frm,userId,mustInputUserInfo,openurl,pname,pcomp,padd){

	for(m=0;m< frm.length;m++) {  
		//当前项
        var myElement = frm.elements[m];
        //判断是否判断必填项      
		if ( myElement.name.indexOf("qId_") != -1 ){       
	    	//取得问题ID
	     	var questionID = myElement.name.substr(4,myElement.name.length);
	     	//定义问题是否必答
			var isMustAnswer=false;
			if(myElement.value =='0'){
				isMustAnswer=true;
			}
			//定义问题是否已回答
	     	var isOk = false ; 
	     	//选择题还是输入题
	     	var isInput = false;
	     	//取得当前问题的名字
	     	//var questionName_id = questionID+"_questionName";
	     	var questionName_id = "qName_"+questionID;
	     		
			var questionName=eval("frm."+questionName_id+".value");
			    //alert(frm.elements[questionName_id].value);
	     		//var questionName  =  trim(frm.elements[questionName_id].value);
	     		//var questionName  =  trim(frm.questionName_id.value);
			var selectCount = 0; // 实际选择的选项个数
			var minSelect = 0;
			var maxSelect = 0;
			var questionType_element = document.getElementById("qType_" + questionID); // 问题类型
			var questionType ;
			if(questionType_element){
				questionType=document.getElementById("qType_" + questionID).value; 
			}
			if(questionType == 1) { // 如果是多选
				minSelect = document.getElementById("qMin_" + questionID).value;
				maxSelect = document.getElementById("qMax_" + questionID).value;
			}
					//循环指定问题的所有项	
	    		for (n=0 ;n < frm.length ;n++){ 	
	    			//获得当前项
		   			childElement = frm.elements[n];
		   			if (childElement.name.indexOf(questionID) != -1){

		  				//如果是radio对象			
		   	   			if (childElement.type == "radio"){	
							//alert("radio childElement.name"+childElement.name);
	   	   					isOk = childElement.checked;
	   	   				
	   	   					if (isOk == true ) {
	   	   						//alert(questionName+i18n_questionnaire_doAdd_question_input_required);		
	   	   	  					//isOk=true;
	   	   	  					break ;	
	   	   	  					//return false;
	   	   					}
	   	    			} else if (childElement.type == "checkbox"){//如果是checkbox对象	  
							if(isOk==false){
								isOk = childElement.checked;
							}
							if(minSelect != "" || maxSelect != "") {

								if (childElement.checked) {
									selectCount++;
									//alert(questionName+i18n_questionnaire_doAdd_question_input_required);		
									//break;
									//return false;
								}
							}
						} else if (childElement.type == "select-one"){	 //如果是select对象  	  
								isOk=childElement.value != "";;
								if (isOk == true ) {
									break ;	
								}
	   	        			//isOk = childElement.selected;alert("isOk "+isOk)
		   	   				//if (isOk == true ) {
		   	   	  				//alert(questionName+i18n_questionnaire_doAdd_question_input_required);		
	   	   			 		//	break;
	   	   	    				//return false;
	   	        			//}
						} else if (childElement.type == "text"){	//如果是text对象
							var str = childElement.value ;
	   				    	if (isMustAnswer && trim(str) == "" ){
	   	    					alert(questionName+i18n_questionnaire_doAdd_question_input_notNull);	
	   	    					childElement.focus();
	   	    	       				//isOk = true ;
	   	    	       				//isInput = true;
	   	     					return false;
	   						}else{
	   							isOk = true ;
	   						}
		   				} else if(childElement.type == "textarea") { // 多行输入
	   						var str = childElement.value ;
   	    	  			if (isMustAnswer && trim(str) == "" ) {
   	    	    			alert(questionName+i18n_questionnaire_doAdd_question_input_notNull);	
   	    	    			childElement.focus();
   	     	      			return false;
   	    	  			}
   	    	  			if(trim(str).length > 512) {
   	    	  				alert(questionName+i18n_questionnaire_doAdd_question_varcharlimit_512);
   	    	  				childElement.focus();
   	     	      			return false;
   	        			} else {
   	        				isOk = true ;
   	        			}
	   				}
					}	
				}
				//如果当前必答的问题没有回答，弹出必须回答的警告
			
				if (isMustAnswer && !isOk){
					alert(questionName+i18n_questionnaire_doAdd_question_input_required);	
					return false; 
				} 
				if(isOk){		
					if(questionType_element){
						if(questionType == 1) {
							if(minSelect == "") {
								if(maxSelect != "" && selectCount > maxSelect) {
									alert(questionName+i18n_questionnaire_doAdd_question_maxselect + maxSelect + i18n_questionnaire_doAdd_question_item);
									return false; 
								}
							} else {
								if(maxSelect == "") {
									if(selectCount < minSelect) {
										alert(questionName+i18n_questionnaire_doAdd_question_minseselect + minSelect + i18n_questionnaire_doAdd_question_item);
										return false; 
									}
								} else {
									if(minSelect == maxSelect) {
										if(minSelect != selectCount) {
											alert(questionName+i18n_questionnaire_doAdd_question_pleaseselect + minSelect + i18n_questionnaire_doAdd_question_item);
											return false; 
										}
									}  else {
										if(selectCount < minSelect || selectCount > maxSelect) {
											alert(questionName+i18n_questionnaire_doAdd_question_canselect + minSelect + "-" + maxSelect + i18n_questionnaire_doAdd_question_item);
											return false; 
										}
									}
								}
							}
						}
					}	
				}
			}
			
  		}
		
  	if(userId == null || userId=='')
	  {	 
		if( mustInputUserInfo == '0'){
		var username = frm.userName;
		var email = frm.email;
		var comp = frm.company;
		var address = frm.address;
		if(isNull(email.value))
		{  
			FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_notNull);
		
			return false;
		}
			if(email != null && !isEmail(email.value,true))
 		{
			FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_notFormat);
 		
 			return false;
 		}

		if(email != null && strlen(email.value)>50)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_maxlength);
 			
 			//return false;
 		}
		if(pname=="showandinput"){
 		if(isNull(username.value))
		{
			
			 FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_notNull);
			
			 return false;
		}
		if(username != null && strlen(username.value) >20)
 		{
 			
			// FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_maxlength);
 			
 			//return false;
 		}
		}
		if(pname=="show"){
		  if(username != null && strlen(username.value) >20)
 		{
 		
           // FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_maxlength);
 			
 			//return false;
 		}
		
		}
		if(pcomp=="showandinput" ){
		if(isNull(comp.value))
		{
			
			  FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_mustcomp);
			
			 return false;
		}
 		if(comp != null && strlen(comp.value) >200)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_comp_maxlength);
 			
 			//return false;
 		}
 		}
		if(pcomp=="show"){
		 if(comp != null && strlen(comp.value) >200)
 		{
			//FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_comp_maxlength);
 		
 			//return false;
 		}   
		}
		if(padd=="showandinput"){
		if(isNull(address.value))
		{
			 
			 FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_mustaddress);
			
			 return false;
		}
 		if(address != null && strlen(address.value) >200)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_address_maxlength);
 			
 			//return false;
 		}
 		
 	    }
		if(padd=="show"){
		if(address != null && strlen(address.value) >200)
 		{
 			
            //FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_address_maxlength);
 			
 			//return false;
 		}
		
		}
		
	   }
	  }
	
	// 答卷人信息
		for(m=0; m< frm.length; m++) {  //当前项
			var myElement = frm.elements[m];
			if ( myElement.name.indexOf("propName_") != -1){     
				//判断是否判断必填项
				//取得模板属性ID
				var tempPropertyID = myElement.name.substr(9, myElement.name.length);
				//取得当前模板属性的名字
				var propertyName = document.getElementById("propName_" + tempPropertyID).value;
				var propertyValid = document.getElementById("propValid_" + tempPropertyID).value;
				var propertyDatatype = document.getElementById("propDatatype_" + tempPropertyID).value;
				var propertyMust = document.getElementById("propMust_" + tempPropertyID).value;
				
				//定义个人信息是否必答的判断变量
				var isOk = false ; 
				if(propertyDatatype==2 || propertyDatatype==3 || propertyDatatype==4 || propertyDatatype==5 || propertyDatatype==6){
					var propertyValue = document.getElementById("tempprop_" + tempPropertyID).value;
					var netStr =/^((http|https|ftp):(\/\/|\\\\))?((\w)+[.]){1,}/;
					if(propertyMust == 1 && isNull(propertyValue)) {
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_question_input_notNull1);
						return false;
					}
					if(propertyDatatype==4 && trim(propertyValue).length>500){
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_property_varcharlimit_500);	
						return false;
					}
					if (trim(propertyValue) != "" && propertyValid == "2" && (trim(propertyValue).length>20 || !isMobileNumber(propertyValue))){
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_property_input_mobile_notFormat);	
								//childElement.focus();
						return false;
					} else if(trim(propertyValue) != "" && propertyValid == "3" && !isTelNo(propertyValue)) {
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_property_input_tel_notFormat);	
								//childElement.focus();
						return false;
					} else if(trim(propertyValue) != "" && propertyValid == "4" && !netStr.test(propertyValue, true)) {
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_property_input_website_notFormat);	
								//childElement.focus();
						return false;
					}
					if(propertyMust == 1 && propertyDatatype==6 && trim(propertyValue) == "http://") {
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_question_input_notNull1);
						return false;
					}
				}
				if((propertyDatatype==0 || propertyDatatype==1) && propertyMust == 1){
					var isChecked=false;
					var propertyValues = document.getElementsByName("tempprop_" + tempPropertyID);
					for(i=0;i<propertyValues.length;i++){
						if(propertyValues[i].checked){
							isChecked=true;
							break;
						}
					}
					if(!isChecked){
						FrontQuestionnaire_survey01.displayErrorMsg(tempPropertyID+"Msg", i18n_questionnaire_doAdd_question_input_notNull1);
						return false;
					}
				}
				/*if ( myElement.name.indexOf("propMust_") != -1 && myElement.value =='1'){
					//循环指定模板属性的所有项	
					for (n=0 ;n < frm.length ;n++) { 	
						//获得当前项
						childElement = frm.elements[n];
						  
								if (childElement.name.indexOf(tempPropertyID) != -1) {
									//如果是radio对象
									if (childElement.type == "radio" || childElement.type == "checkbox") {
										isOk = childElement.checked;
										if (isOk == true ) {
											break ;	
										}
									} else if (childElement.type == "text" || childElement.type == "textarea") {	//如果是text对象
										if (trim(childElement.value) == "" ){
											alert(propertyName + i18n_questionnaire_doAdd_question_input_tempProperty_notNull);	
											childElement.focus();
											return false;
										}else{
											isOk = true ;
										}
									} else if(childElement.type == "select-one") {
										if (trim(childElement.value) == "" ){
											alert(propertyName + i18n_questionnaire_doAdd_question_input_required);	
											return false;
										}else{
											isOk = true ;
										}
									}
								}
							
					}
				}	*/	
		
				//取得当前模板属性的验证类型
				/*var propertyValid = document.getElementById("propValid_" + tempPropertyID).value;
				for (n=0 ;n < frm.length ;n++) { 	
					//获得当前项
					childElement = frm.elements[n];
					if (childElement.name.indexOf(tempPropertyID) != -1 && childElement.type == "text") {
						if (propertyValid == "1") {
							if (trim(childElement.value) != "" && !isMobile(childElement.value)){
								alert(propertyName + i18n_questionnaire_tempProperty_mobile_input_notNull);	
								childElement.focus();
								return false;
							}else{
								isOk = true ;
							}
						} else if(propertyValid == "2") {
							if(trim(childElement.value) != "" && !isTelNo(childElement.value, true)) {
								alert(propertyName + i18n_questionnaire_tempProperty_mobile_input_notNull);	
								childElement.focus();
								return false;
							} else {
								isOk = true ;
							}
						} else if(propertyValid == "3") {
							if(trim(childElement.value) != "" && !isTelNo(childElement.value, true)) {
								alert(propertyName + i18n_questionnaire_doAdd_question_input_notNull);	
								childElement.focus();
								return false;
							} else {
								isOk = true ;
							}
						}
					}	
				}*/
			}
		}
	 var frmID=frm.name.substr(0,frm.name.length-5);
		var compID="comp-"+frmID;
		frm.action="/FrontQuestionnaire.do?method=success&compId="+frmID+"&comp_stats="+compID;	
		
  	return true;
  	},
	/**
	 * 输入框失去焦点时表单验证
	 *
	 * @param frm 表单
	 * @param userId 用户ID
	 * @param mustInputUserInfo 必须输入用户信息
	 * @param openurl 连接URL
	 * @param pname 名称
	 * @param pcomp  公司
	 * @param padd 地址
	  * @param id验证输入框标识
	 * @return 表单是否验证成功
	 */
	 checkFrom: function(frm,userId,mustInputUserInfo,openurl,pname,pcomp,padd,id){
		if(userId == null || userId=='')
	  {	 
		if( mustInputUserInfo == '0'){
		var username = frm.userName;
		var email = frm.email;
		var comp = frm.company;
		var address = frm.address;
		if(id=="emailMsg"){
		if(isNull(email.value))
		{  
			FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_notNull);
		
		
		}
			if(email != null && !isEmail(email.value,true))
 		{
			FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_notFormat);
 		
 		}

		if(email != null && strlen(email.value)>50)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("emailMsg",i18n_questionnaire_doAdd_question_input_email_maxlength);
 			
 			
 		}
		}else if(id=="nameMsg"){
		if(pname=="showandinput"){
 		if(isNull(username.value))
		{
			
			 FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_notNull);
			
			
		}
		if(username != null && strlen(username.value) >20)
 		{
 			
			// FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_maxlength);
 			
 			
 		}
		}
		if(pname=="show"){
		  if(username != null && strlen(username.value) >20)
 		{
 		
           // FrontQuestionnaire_survey01.displayErrorMsg("nameMsg",i18n_questionnaire_doAdd_question_input_name_maxlength);
 			
 			
 		}
		
		}
		}else if(id=="compMsg"){
		if(pcomp=="showandinput" ){
		if(isNull(comp.value))
		{
			
			  FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_mustcomp);
			
			
		}
 		if(comp != null && strlen(comp.value) >200)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_comp_maxlength);
 			
 			
 		}
 		}
		if(pcomp=="show"){
		 if(comp != null && strlen(comp.value) >200)
 		{
			//FrontQuestionnaire_survey01.displayErrorMsg("compMsg",i18n_questionnaire_doAdd_question_input_comp_maxlength);
 		
 			
 		}   
		}
		}else if(id=="addMsg"){
		if(padd=="showandinput"){
		if(isNull(address.value))
		{
			 
			 FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_mustaddress);
			
			
		}
 		if(address != null && strlen(address.value) >200)
 		{
 			
			//FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_address_maxlength);
 			
 			
 		}
 		
 	    }
		if(padd=="show"){
		if(address != null && strlen(address.value) >200)
 		{
 			
           // FrontQuestionnaire_survey01.displayErrorMsg("addMsg",i18n_questionnaire_doAdd_question_input_address_maxlength);
 			
 			
 		}
		
		}
		}
	  
	  }
	  }
		
 
	
	},
    displayErrorMsg:function(id, errorMsg){
	$("#"+id).removeClass("tip-default");
	$("#"+id).addClass("tip-error");
	$("#"+id).html(errorMsg);
	},
	hiddenErrorMsg:function(id, defaultMsg){
	$("#"+id).removeClass("tip-error");
	$("#"+id).addClass("tip-default");
	$("#"+id).html(defaultMsg);
  	},
  	checkUserInfo:function(userId, mustInputUserInfo, validationType, checkNode, mustInput, id, datatype) {
  		if(userId != null && userId != '') {
  			return;
  		}
		//if( mustInputUserInfo != '0' || validationType == 0){
		//	return;
		//}
		
		var errorInfo = "";
		var propertyValue = trim(checkNode.value);
		if(mustInput == 1) {
			if(isNull(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_question_input_notNull1);
			}else{
				FrontQuestionnaire_survey01.hiddenErrorMsg(id+'Msg','');
			}
		}
		if(datatype==4 && !isNull(propertyValue) && propertyValue.length > 500){
			FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_varcharlimit_500);
		}else{
			FrontQuestionnaire_survey01.hiddenErrorMsg(id+'Msg','');
		}
		var netStr =/^((http|https|ftp):(\/\/|\\\\))?((\w)+[.]){1,}/;
		if(propertyValue != "") {
			if(validationType == 2 && (trim(propertyValue).length>20 || !isMobileNumber(propertyValue))) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_mobile_notFormat);
			} else if(validationType == 3 && !isTelNo(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_tel_notFormat);
			} else if(validationType == 4 && !netStr.test(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_website_notFormat);
			}
		}
  	},
	checkUserInfoForSelect:function(userId, mustInputUserInfo, validationType, checkNode, mustInput, id) {
  		if(userId != null && userId != '') {
  			return;
  		}
		//if( mustInputUserInfo != '0' || validationType == 0){
		//	return;
		//}
		
		var errorInfo = "";
		var propertyValue = trim(checkNode.value);
		if(mustInput == 1) {
			if(isNull(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_question_input_notNull1);
			}else{
				FrontQuestionnaire_survey01.hiddenErrorMsg(id,'');
			}
		}
		var netStr =/^((http|https|ftp):(\/\/|\\\\))?((\w)+[.]){1,}/;
		if(propertyValue != "") {
			if(validationType == 2 && !isMobileNumber(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_mobile_notFormat);
			} else if(validationType == 3 && !isTelNo(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_tel_notFormat);
			} else if(validationType == 4 && !netStr.test(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_website_notFormat);
			}
		}
  	},
	checkUserInfoForDate:function(userId, mustInputUserInfo, validationType, checkNode, mustInput, id) {
  		if(userId != null && userId != '') {
  			return;
  		}
		FrontQuestionnaire_survey01.hiddenErrorMsg(id+'Msg','');
		FrontQuestionnaire_survey01.hiddenErrorMsg(id+i18n_questionnaire_doAdd_question_input_notNull1);
		//if( mustInputUserInfo != '0' || validationType == 0){
		//	return;
		//}alert("ddddddddddsssssssss");
		
		var errorInfo = "";
		var propertyValue = trim(checkNode.value);
		if(mustInput == 1) {
			if(isNull(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_question_input_notNull1);
			}else{
				FrontQuestionnaire_survey01.hiddenErrorMsg(id+'Msg','');
			}
		}
		var netStr =/^((http|https|ftp):(\/\/|\\\\))?((\w)+[.]){1,}/;
		if(propertyValue != "") {
			if(validationType == 2 && !isMobileNumber(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_mobile_notFormat);
			} else if(validationType == 3 && !isTelNo(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_tel_notFormat);
			} else if(validationType == 4 && !netStr.test(propertyValue)) {
				FrontQuestionnaire_survey01.displayErrorMsg(id, i18n_questionnaire_doAdd_property_input_website_notFormat);
			}
		}
  	}
  }
