<!--
	//var SDCRFileExtensionType = "pdf,jpeg,jpg,bmp,gif,png,tif,html,htm,txt,doc";
	//var SDCRFileExtensionType = "gif,ppt,pptx,bmp,pdf,css,doc,docx,xls,xlsx,exe,zip,jpg,jpeg,htm,html,swf,asp,txt,inc,js,mdb,rar";
	//var SDCRFileExtensionTypeArray = new Array('pdf','gif','bmp','jpg','jpeg','txt','htm','html','css','asp','js','inc','doc','docx','xls','xlsx','ppt','pptx','mdb','zip','rar','swf','exe');
	var SDCRFileExtensionType = "gif,png,tif,tiff,ppt,pptx,bmp,pdf,css,doc,docx,xls,xlsx,zip,jpg,jpeg,htm,html,swf,txt,inc,mdb,rar";
	var SDCRFileExtensionTypeArray = new Array('pdf','gif','bmp','jpg','jpeg','png','tif','tiff','txt','htm','html','css','inc','doc','docx','xls','xlsx','ppt','pptx','mdb','zip','rar','swf');
	var SDCRIllegalChCRNArr = new Array("'",'"');
	
	var SDCREmptyStr = "";
	var SDCRPictureExtensionType = "jpg,jpeg,bmp,gif,png";
	var SDCRCreateFileExtensionType = "pdf,html,htm,txt";
  var DMFileExtensionType = "pdf,jpeg,jpg,bmp,gif,png,tif,tiff,html,htm";
	var SDCRTrimPatten = /(^\s+)|\s+$/g;
	var SDCRIllegalCharInFileName = '/,\\,|,*,?,:,",<,>';
	var SDCRFileNamePattern = /^[a-zA-Z0-9&()+-_. ]+$/g;
	var SDCRRoomNamePattern = /^[a-zA-Z0-9() ]+$/g;
	var SDCRIllegalCharInFileNameArray = new Array('/','\\','|','*','?',':','"','<','>',"'");
	var SDCRFileLengthAllow = 50;
	var SDCRFolderLengthAllow = 50;
	var SDCRSendContentMaxChar = 8000;
	var SDCRDesContentMaxChar = 1000;
	var SDCRAnnContentMaxChar = 1000;
	var SDCRInvitationMaxConut = 5;
	var SDCRRoomNameMaxLen = 50; 
	var SDCRRoomCommentsMinChar = 10;
	var SDCRRoomCommentsMaxChar = 300;
	var SDCRCreateDocContentMax = 10000;
	var SDCRPollQMax = 50;
	var SDCRPollAMax = 30;

  // error message
  var fileExtensionError = "The document type you specified is not supported yet.";
      fileExtensionError += "<br /><i>The supported document types so far are : ( ";
      fileExtensionError += SDCRFileExtensionTypeArray.join(" , ") + " )</i>";
  var createFileExtensionError = "The document type you specified is not supported yet.";
      createFileExtensionError = createFileExtensionError + "<br /><i>The supported document types so far are : ";
      createFileExtensionError = createFileExtensionError + SDCRCreateFileExtensionType + "</i>";
  var noInputFileName = "Please input file name.";
  var noFileContent = "Please input file content.";
  var noSelectFile = "Please select a file.";
  var noInputFolderName = "Please input folder name.";
  var noSavedWorkFlow = "Please create workflow first.";
  var noEmailAddress = "Please input the email.";
  var emailAddressError = "Invalid email address.";
  var emailAddressSameAsSelf = "Please don't send to yourself.";
  var noSendDocumentName = "Please input document name.";
  var noLogoPicutreSelect = "There should be a picture.";
  var logoFileExtensionError = "The logo should be a picutre!"; 
      logoFileExtensionError = logoFileExtensionError + "<br /><i>It's extension name such as : ";
      logoFileExtensionError = logoFileExtensionError + SDCRPictureExtensionType + "</i>";
  var noPollQuestion = "Please input poll question.";
  var noPollAnswer = "Poll answer at least needs one option.";
  var pollAnswerExists = "Poll answer has the same options.";
  var noPassword = "Please input your password.";
  var noConfirmPassword = "Please input confirm password.";
  var twoPasswordDif = "Your password is different with confirm password.";
  var passwordTooShort = "Your password should be longer. Please don't less than 5 chars.";
  var noMemberName = "Please input your member name.";
  var noInviteMember = "Please input the member's email.";
  var noPollAnswerSelect = "Please make a choice.";
  var notSameAccessCode = "Access Code and Confirm Code are not the same as.";
  var onlyFileExtensionName = "Only extension name not allowed, please input file name.";
  /*var illegalCharInFileName = "File name has illegal charactor, please check it.";
      illegalCharInFileName += "<br />( <i>illegal charactor : " + SDCRIllegalCharInFileNameArray.join(" , ");
      illegalCharInFileName += "</i> )";
  var illegalCharInFolderName = "Folder name has illegal charactor, please check it.";
      illegalCharInFolderName += "<br />( <i>illegal charactor : " + SDCRIllegalCharInFileNameArray.join(" , ");
      illegalCharInFolderName += "</i> )";*/
  var illegalCharInFileName = "File name only can be made up by a-z,A-Z,0-9,&,(,),+,-,_,.and space.";
  var illegalCharInFolderName = "folder name only can be made up by a-z,A-Z,0-9,&,(,),+,-,_,.and space.";
  var sharedDriveSendFileNotAllow = "The document type you specified is not supported yet.";
      sharedDriveSendFileNotAllow = sharedDriveSendFileNotAllow + "<br /><br /><i>The supported document types so far are : ";
      sharedDriveSendFileNotAllow = sharedDriveSendFileNotAllow + DMFileExtensionType + "</i>";
  var fileNameLengthNotAllow = "The file name charactor can not more than " + SDCRFileLengthAllow + ".";
  var folderNameLengthNotAllow = "The folder name charactor can not more than " + SDCRFolderLengthAllow + ".";
  var diskInputIsNaN = "Input text is not a positive integer!";
  var diskUsageExceedAllocated = "Disk usage of member or shard drive has exceeded disk allocated.";
  var diskAllocatedExceedUnallocated = "Allocated space exceed the disk space of unallocated.";
  //var hasChineseChar = "contains the full-width characters or Chinese characters.";
  var hasChineseChar = "only can be made up by a-z,A-Z,0-9,&,(,),+,-,_,.and space.";
  var roomNameC = "Room name only can be made up by a-z,A-Z,0-9,(,)and space.";
  var noRoomName = "Please input room name.";
  var noSendToEmail = "Whom are you want to mail.";
  var noSendTitle = "Mail title can not be empty.";
  var noSendContent = "Mail content can not be empty.";
  var sendContentExtend = "Mail content can not extend "+SDCRSendContentMaxChar+" charactors.";
  var invitationMaxNum = "The maximum invitation number for once is "+SDCRInvitationMaxConut+".";
  var noCreateTopic = "Discussion topic is required.";
  var desContentExtend = "Description content can not extend "+SDCRDesContentMaxChar+" charactors.";
  var annContentExtend = "Announcement content can not extend "+SDCRAnnContentMaxChar+" charactors.";
  var roomNameExtend = "Room name should not extend "+SDCRRoomNameMaxLen+" charactors.";
  var roomNameIllegalCh = "Room name contains illegal charactor(s).";
  var noTopicComment = "Comment can not less than "+SDCRRoomCommentsMinChar+" charactors.";
  var topicCommentExtend = "Comment can not more than "+SDCRRoomCommentsMaxChar+" charactors.";
  var topicDetailsExtend = "Details can not more than "+SDCRRoomCommentsMaxChar+" charactors.";
  var cDocContentExtend = "File content can not more than "+SDCRCreateDocContentMax+" charactors.";
  var pollQExtend = "Poll question control in "+SDCRPollQMax+" words.";
  var pollAextend = "Poll Answer control in "+SDCRPollAMax+" words.";

	// trim space left and right
	function trimSpace(inputString) {
		  var returnString = "";
		  if (inputString == null || inputString == "") {
		  } else {
		      returnString = inputString.replace(SDCRTrimPatten, "");
		  }
		  return returnString;
	}

	// check email
	function checkMail(inputmail)	{ 
			var pattern = /^[\w\.-]+@[\w\.-]+\.\w+$/i;
			
			if(pattern.test(inputmail)) { 
					return true; 
			} else { 
					return false; 
			}
	}
	//========================================================================== 

	// check the custom file extension is allowed or not
	function checkFileExtension(filepath) {
	    var FileExtensionType = SDCRFileExtensionType;
	    var feArray = FileExtensionType.split(",");
	    filepathArray = filepath.split(".");
	    returnString = false;
	    if (filepathArray.length > 1) {
			    for (var i = 0; i < feArray.length; i++) {
			        if (feArray[i] == filepathArray[filepathArray.length - 1].toLowerCase()) {
			        	  returnString = true;
			        	  break;
			        }	
			    }
			}
	    return returnString;
	}
	// ==================================================================================

	// check the custom file length is allowed or not
	function checkFileLength(filepath, allowlength) {
	    var returnString = true;
	    var filePathString = "";
	    if (trimSpace(filepath) == "") {
	    } else {
	        if (filepath.lastIndexOf("\\") >= 0) {
	            filePathString = trimSpace(filepath.substring(filepath.lastIndexOf("\\") + 1));
	        } else if (filepath.lastIndexOf("/") >= 0) {
	            filePathString = trimSpace(filepath.substring(filepath.lastIndexOf("/") + 1));	            
	        } else {
	            filePathString = trimSpace(filepath);
	        }
	    }
	    if (filePathString.length > allowlength) {
	        returnString = false;
	    }
	    return returnString;
	}
	// ==================================================================================

	// check the custom file only has extension name
	function checkFileOnlyExtension(customFileName) {
	    var returnString = true;
	    if (trimSpace(customFileName) == "") {
	        returnString = false;
	    } else {
	        if (customFileName.indexOf(".") <= 0) {
	            returnString = false;
	        } else {
	            var customFileNameString = trimSpace(customFileName.substring(0, customFileName.lastIndexOf(".")));
	            if (customFileNameString == "") {
	                returnString = false;
	            }	            
	        }
	    }
	    return returnString;
	}
	// ==================================================================================

	// check the illegal char in file name
	function checkIllCharInFileName(customFileName) {
	    var charArray = SDCRIllegalCharInFileNameArray;
	    var returnString = true;

	    /*if (trimSpace(customFileName) == "") {
	    } else {
	        if (customFileName.lastIndexOf("\\") >= 0) {
	            fileNameString = trimSpace(customFileName.substring(customFileName.lastIndexOf("\\") + 1));
	        } else if (customFileName.lastIndexOf("/") >= 0) {
	            fileNameString = trimSpace(customFileName.substring(customFileName.lastIndexOf("/") + 1));	            
	        } else {
	            fileNameString = trimSpace(customFileName);
	        }
	    }*/
	    fileNameString = trimSpace(customFileName);

	    if (fileNameString == ""){
	    		returnString = false;
			} else {
			    for (var i = 0; i < charArray.length; i++) {
			        if (fileNameString.indexOf(charArray[i]) > -1) {
			            returnString = false;
			            break;
			        }
			    }
			}
	    return returnString;
	}
	// ==================================================================================

	// check upload file illegal charactors
	function checkIllCharInUploadFileName(customFileName) {
	    var charArray = SDCRIllegalCharInFileNameArray;
	    var returnString = true;

	    if (trimSpace(customFileName) == "") {
	    } else {
	        if (customFileName.lastIndexOf("\\") >= 0) {
	            fileNameString = trimSpace(customFileName.substring(customFileName.lastIndexOf("\\") + 1));
	        } else if (customFileName.lastIndexOf("/") >= 0) {
	            fileNameString = trimSpace(customFileName.substring(customFileName.lastIndexOf("/") + 1));	            
	        } else {
	            fileNameString = trimSpace(customFileName);
	        }
	    }

	    if (fileNameString == ""){
	    		returnString = false;
			} else {
			    for (var i = 0; i < charArray.length; i++) {
			        if (fileNameString.indexOf(charArray[i]) > -1) {
			            returnString = false;
			            break;
			        }
			    }
			}
	    return returnString;
	}
	//======================================================================================================
	
	// check file extension common
	function checkFileExtensionCommon(fileAllowedExtension, fileNameCustom) {
	    var feArray = fileAllowedExtension.split(",");
	    filepathArray = fileNameCustom.split(".");
	    returnString = false;
	    if (filepathArray.length > 1) {
			    for (var i = 0; i < feArray.length; i++) {
			        if (feArray[i] == filepathArray[filepathArray.length - 1].toLowerCase()) {
			        	  returnString = true;
			        	  break;
			        }	
			    }
			}
	    return returnString;
	}
	// ===================================================================================

	// check the custom file name has Chinese characters or not
	function checkFileNameWFC(filepath) {
	    var returnString = true;
	    var filePathString = "";
	    if (trimSpace(filepath) == "") {
	    } else {
	        if (filepath.lastIndexOf("\\") >= 0) {
	            filePathString = trimSpace(filepath.substring(filepath.lastIndexOf("\\") + 1));
	        } else if (filepath.lastIndexOf("/") >= 0) {
	            filePathString = trimSpace(filepath.substring(filepath.lastIndexOf("/") + 1));	            
	        } else {
	            filePathString = trimSpace(filepath);
	        }
	    }
	    if (filePathString.match(/[^\x00-\xff]/ig)) {
	        returnString = false;
	    }
	    /*******************/
	    if (returnString && filePathString.replace(SDCRFileNamePattern, "") != "") {
	        returnString = false;
	    }
	    /********************/
	    return returnString;
	}
	// ==================================================================================
	
	// check illegar char in room name
	function checkIllChCustom(checkStr, illStr) {
	   var illArray;
	   var returnFlag = true;
	   if (!illStr){
	       returnFlag = false;
	   } else if (illStr.constructor == Array){
	       illArray = illStr;
	   } else {
	       illArray = illStr.split(",");
	   }
	   if (returnFlag && (!checkStr || trimSpace(checkStr)=="")){
	       returnFlag = false;
	   } else {
	       for (var i = 0; i < illArray.length; i++){
	           if (checkStr.indexOf(illArray[i])>=0){
	               returnFlag = false;
	               break;
	           }
	       }
	   }
	   return returnFlag;
	}
	// ==================================================================================
	
	// check room name more
	function checkRoomNameMore(roomname) {
	    var returnString = false;
	    if (roomname && trimSpace(roomname) != "") {
	        if (roomname.replace(SDCRRoomNamePattern, "") == "") {
	            returnString = true;
	        }
	    }
	    return returnString;
	}
	// ==================================================================================

	// show user error message
  function showErrorMsg(errorLabel, errorMsg) {
  	  var errorInnerHTML = "<font style='font-size:12px;font-family:Verdana,sans-serif;color:tomato;font-weight:bold;'>" + errorMsg + "</font>";
  	  document.getElementById(errorLabel).innerHTML = errorInnerHTML;
      document.getElementById(errorLabel).style.display = "block";
  }
  // ==================================================================================  

  // show user error message custom
  function showErrorMsgCustom(errorLabel, errorMsg, customString) {
  	  var errorInnerHTML = "<br /><font style='font-size:12px;font-family:Verdana,sans-serif;color:tomato;font-weight:bold;'>&nbsp;" + customString + " " + errorMsg + "</font>";
  	  document.getElementById(errorLabel).innerHTML = errorInnerHTML;
      document.getElementById(errorLabel).style.display = "block";
  }
  // ==================================================================================
  
  // show user error message custom
  function showErrorMsgCustomNo(errorLabel, errorMsg, customString) {
  	  var errorInnerHTML = "<font style='font-size:12px;font-family:Verdana,sans-serif;color:tomato;font-weight:bold;'>&nbsp;" + customString + " " + errorMsg + "</font>";
  	  document.getElementById(errorLabel).innerHTML = errorInnerHTML;
      document.getElementById(errorLabel).style.display = "block";
  }
  // ==================================================================================

  // hide user error message  
  function hideErrorMsg(errorLabel) {
  	  document.getElementById(errorLabel).innerHTML = "";
      document.getElementById(errorLabel).style.display = "none";
  }
  // ==================================================================================
//-->
