
// GENERAL FUNCTIONS

function isDefined(variable) {
	return (typeof(window[variable]) == "undefined")?  false: true;
}

/*
	Method extending the base object to allow for deep or shallow cloning
*/
function clone(deep) {
  var objectClone = new this.constructor();
  for (var property in this)
    if (!deep)
      objectClone[property] = this[property];
    else if (typeof this[property] == 'object')
      objectClone[property] = this[property].clone(deep);
    else
      objectClone[property] = this[property];
  return objectClone;
}
Object.prototype.clone = clone;

/*
	Trimming of all strings
*/
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

/*
	This will add an item to theOriginal list, separating it with a comma if nececssary.
*/
function addCommaList(theOriginal,theString) {
	if( "" == theOriginal ) {
		return theString;
	} else {
		return theOriginal + ", " + theString;
	}
}

/*
	This will pad out the string with the character provided, to make it up to the specified length.
*/
function leftPad(text,padChar,length) {
	text = "" + text;
	while( text.length < length ) {
		text = padChar + text;
	}
	return text;
}

/*
	This will pad out the string with the character provided, to make it up to the specified length.
*/
function rightPad(text,padChar,length) {
	text = "" + text;
	while( text.length < length ) {
		text = text + padChar;
	}
	return text;
}

/*
	This will evaluate a string as a number. If it is not a number, this will return zero.
*/
function evalNumber(value) {
	value = parseFloat( value );
	if( isNaN( value ) ) {
		return 0;
	} else {
		return value;
	}
}
/*
	This will evaluate a string as a number. If it is not a number, this will return zero.
*/
function evalInteger(value) {
	value = parseInt( value );
	if( isNaN( value ) ) {
		return 0;
	} else {
		return value;
	}
}

/*
	This will find the x co-ordinate of the phsyical location in the window of the specified object.
*/
function findPosX(obj) {
	var curleft = 0;
	if (document.all || document.getElementById) {
		while (obj.offsetParent) {
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		curleft += obj.offsetLeft;
	} else if (document.layers) {
		curleft += obj.x;
	}
	return curleft;
}

/*
	This will find the y co-ordinate of the phsyical location in the window of the specified object.
*/
function findPosY(obj) {
	var curtop = 0;
	if (document.getElementById || document.all) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
		curtop += obj.offsetTop;
	} else if (document.layers) {
		curtop += obj.y;
	}
	return curtop;
}

/*
	This will take a value and format it with two decimal places.
*/
function parseCurrency(value) {
	value = round( value - 0 , 2 );
	var frac = Math.floor( ( round( value - Math.floor( value ) , 2 ) ) * 100 );
	if( frac == 0 ) {
		value = ( "" + value ) + '.00';
	} else if( mod(frac,10)==0 ) {
		value = ( "" + value ) + '0';
	}
	return value;
}

function mod(X, Y) { return X - Math.floor(X/Y)*Y }

/*
	This will round the number fo the specified number of decimal places.
*/
function round(value,numDecimalPlaces) {
	var factor = Math.pow( 10 , numDecimalPlaces );
	return ( Math.round(value*factor) ) / factor;
}

/*
	This will parse the date, validate it, and return a new string in the format of "dd month yyyy".
*/
function parseDateSimple(str_date) {
	if( "" == str_date ) {
		return "";
	}
	var theDate = parseDate( str_date );
	return theDate.getDate() + " " + text_months[theDate.getMonth()] + " " + theDate.getFullYear();
}

function parseDateOrder(str_date) {
	if( "" == str_date ) {
		return "";
	}
	var theDate = parseDate( str_date );
	return theDate.getDate() + " " + text_months[theDate.getMonth()] + " " + theDate.getFullYear()
}
/*
	This will take a string containing a time and format it properly.
*/
function parseTime(str_time) {

	if( "" + str_time == "" ) {
		return "";
	}

	var str_temp = str_time.toLowerCase();

	var hour = 0;
	var minute = 0;

	if( str_temp.indexOf( ":" ) >= 0 ) {
		vals = str_temp.split( ":" );
		if( vals.length > 1 ) {
			hour = evalNumber( vals[0] );
			minute = evalNumber( vals[1] );
		} else if( vals.length == 1 ) {
			hour = evalNumber( vals[0] );
			minute = 0;
		}
	} else if( str_temp.indexOf( "." ) >= 0 ) {
		vals = str_temp.split( "." );
		if( vals.length > 1 ) {
			hour = evalNumber( vals[0] );
			minute = evalNumber( vals[1] );
		} else if( vals.length == 1 ) {
			hour = evalNumber( vals[0] );
			minute = 0;
		}
	} else {
		var v = evalNumber( str_temp );
		hour = Math.floor( v / 100 );
		minute = Math.floor( v % 100 );
	}
	
	hour = round( ( (hour) % 24 ) , 0 );
	minute = round( ( (minute-1) % 60 ) + 1 , 0 );

	return leftPad( hour , '0' , 2 ) + ":" + leftPad( minute , '0' , 2 );
}

// SPECIALIST FUNCTIONS

var globalActiveDropDown = null;

function onMouseLeaveSelector() {
	var theFieldId = this.id.substring( 0 , this.id.length - 9 );
	var theField = document.getElementById( theFieldId );

	// Magic alert! We're not interested in MouseLeaves when it's a sublayer.

	if( window.event.clientX != -1 ) {
		showHideDropSelector( theField );
	}
}

function showHideDateSelector(theField) {
	showHideDropSelector( theField , "<div id=\"calendar_target\" style=\"overflow:hidden\">" + createCalendarHTML(theField.value,theField.offsetWidth) + "</div>" , 130 , "hidden" );
}

/*
	This will create a generic drop-selector. The developer can pass his own HTML for the contents.

*/
function showHideDropSelector(theField,theHtmlContents,theHeight,theOverflow) {

	// Get the position and dimensions of the drop text box

	var left = findPosX(theField);// theField.offsetLeft
	var top = findPosY(theField); // theField.offsetTop;
	var width = theField.style.width;//theField.offsetWidth;
	var height = theField.offsetHeight;
	
	if( theHeight == null ) {
		theHeight = 120;
	}
	if( theOverflow == null ) {
		theOverflow = "auto";
	}

	// The Id that the selector div should have

	var theContentDivId = theField.id + ".selector";

	// If the selector div does not yet exist, we will create it now

	var nextSibling = theField.nextSibling;
	if( nextSibling.id != theContentDivId ) {

		// Hide any existing drop-down

		if( globalActiveDropDown != null ) {
			showHideDropSelector( globalActiveDropDown );
		}


		// Create the div to hold the selector

		var contentDiv = document.createElement( "div" );
		contentDiv.id = theContentDivId;
		contentDiv.style.position = "absolute";
		contentDiv.style.left = left + "px";
		contentDiv.style.top = top + "px";
		contentDiv.style.width = width;
		contentDiv.style.height = theHeight;
//		contentDiv.style.overflow = theOverflow; // AP: This breaks Firefox(!?)
		contentDiv.style.border = "1px solid black";
		contentDiv.style.backgroundColor = "#ffffff";
		contentDiv.style.verticalAlign = "top";
		contentDiv.style.textAlign = "left";
		contentDiv.style.zIndex = 999;
		contentDiv.onmouseleave = onMouseLeaveSelector;
		theField.parentNode.insertBefore( contentDiv , nextSibling );
		theField.style.visibility = "hidden";

		// Draw the contents of the selector

		contentDiv.innerHTML = theHtmlContents;

		// And activate the selector

		globalActiveDropDown = theField;
		if( contentDiv.focus ) {
			contentDiv.focus();
		}
		
	} else {

		// Remove the selector from the page

		var contentDiv = document.getElementById( theContentDivId );
		contentDiv.parentNode.removeChild( contentDiv );

		// Make the input box visible again

		theField.style.visibility = "visible";
		globalActiveDropDown = null;
	}

}

function disableForSubmit() {
	document.body.style.cursor = "wait";
	var allElements = document.getElementsByTagName( "*" );
	for( var i = 0 ; i < allElements.length ; i++ ) {
		var tn = allElements[i].tagName.toLowerCase();
		if( "input" == tn ) {
			allElements[i].readOnly = true;
			if (allElements[i].type == 'button') { 				
				allElements[i].disabled = true;				
			}
		}
		allElements[i].style.cursor = "wait";
	}
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return "";
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function dateDiff(date1,date2) {
	return Math.round( date1 - date2 )/(1000*60*60*24);
}

/*
	Field validation routines. Each takes a field which MUST have an id.

	Usage:
	... onBlur="if( validateFieldNumber(this) && validateFieldMoreThanOrEqualTo(this,1) );" ... 
*/

function validateNotBlank(theField,theDisplayName) {
	if( theField.value.trim() == "" ) {
		alert( theDisplayName + " cannot be left blank" );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The value must be a number
function validateFieldNumber(theField) {
	if( isNaN( theField.value ) ) {
		alert( "You must enter a number" );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// Must be an integer
function validateFieldWholeNumber(theField) {
	if( Math.round( theField.value ) != theField.value ) {
		alert( "You must enter a whole number" );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The number must be more than...
function validateFieldMoreThan(theField,value) {
	if( theField.value <= value ) {
		alert( "You must enter a value more than " + value );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

/// The number must be more than or equal to...
function validateFieldMoreThanOrEqualTo(theField,value) {
	if( theField.value < value ) {
		alert( "You must enter a value no less than " + value );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The number nust be less than...
function validateFieldLessThan(theField,value) {
	if( theField.value > value ) {
		alert( "You must enter a value less than " + value );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The number must be less than or equal to...
function validateFieldLessThanOrEqualTo(theField,value) {
	if( theField.value >= value ) {
		alert( "You must enter a value no more than " + value );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The number must be between minValue and maxValue (inclusive)
function validateFieldBetweenInclusive(theField,minValue,maxValue) {
	if( theField.value < minValue || theField.value > maxValue ) {
		alert( "You must enter a value between " + minValue + " and " + maxValue + " (inclusive)" );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// The number must be between minValue and maxValue (excluding the ends)
function validateFieldBetweenExclusive(theField,minValue,maxValue) {
	if( theField.value <= minValue || theField.value >= maxValue ) {
		alert( "You must enter a value more than " + minValue + " but less than " + maxValue );
		window.setTimeout( "document.getElementById('" + theField.id + "').focus();" , 1 );
		window.setTimeout( "document.getElementById('" + theField.id + "').select();" , 1 );
		return false;
	} else {
		return true;
	}
}

// Disable the input box
function disableInputBox(theInputElement,cssStyle) {
	theInputElement.readOnly = true;
	if(cssStyle != "undefined"){
		theInputElement.className = cssStyle ;
	}else{
		theInputElement.className = "input-box-disabled";
	}
}

// Enable the input box
function enableInputBox(theInputElement) {
	theInputElement.readOnly = false;
	theInputElement.className = "input-box";
}

// display the error message
function displayError(element,message){
	var theInputElement = document.getElementById( element );
	if(message!=null){
		alert(message);
	}
	theInputElement.className = "input-box-error";
	theInputElement.focus();
}
//hidden the error message 
function hiddenError(element){
	document.getElementById( element ).className = "" ;
}

// Disable all text boxes in parent window
function disableParentElementsForSubmit() {
	document.body.style.cursor = "wait";
	var allElements = window.parent.opener.document.getElementsByTagName( "*" );
	for( var i = 0 ; i < allElements.length ; i++ ) {
		var tn = allElements[i].tagName.toLowerCase();
		if( "input" == tn ) {
			allElements[i].readOnly = true;
			if( allElements[i].type && allElements[i].type.toLowerCase() == "text" ) {
				allElements[i].className += " input-box-disabled";
			}
		}
	}
}

function showHelpPage(topicID) {
	var theWindow = window.open( "h/help_" + topicID + ".jsp" , '易邮递帮助页面' , 'height=355,width=600,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,modal=no' );
	theWindow.focus();
}

/**
*	检查string中是否存在匹配的字符regexp,
*   例如：Code:
*   rexp = /er/
*   if(rexp.test("the fisherman"))
*      document.write("It's true, I tell you.")
*    
*   Output:
*   It's true, I tell you.
*/
function checkByRegexp(regexp,string){
	if(!regexp.test(string)){
		return false ;
	}
	return true ;
}
/**
*去掉前后空格
*/
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
/**
*清除汉字
*/
function clearChinese(value){
	if(value != "undefined"){
		return value.replace(/[\u4e00-\u9fa5]/g,''); 
	}	
}
/**
*清空文本框中的内容
*/
function clearText(container){
	document.getElementById(container).value = "" ;
	setFocus(container) ;
}
/**
*是否是汉字
*/
function isChinese(container){
	var regexp = /[\u4e00-\u9fa5]/g ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证电话号码
*/
function isTelephone(container){
	//var regexp = /(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{7,8}$)|(^\([0-9]{3,4}\)[0-9]{3,8}$)|(^0{0,1}13[0-9]{9}$)/ ;
	var regexp = /(^[0-9]{3,4}\-[0-9]{7,8}$)|(^[0-9]{3,4}[0-9]{7,8}$)|(^[0-9]{3,4}[0-9]{7,8}\-[0-9]+$)|(^[0-9]{3,4}\-[0-9]{7,8}\-[0-9]+$)/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证邮编号码
*/
function isPostCode(container){
	var regexp = /^[0-9]{6}$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}

/**
*验证Email地址
*/
function isEmail(container){
	var regexp = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证url
*/
function isUrl(container){
	var regexp = /((^http)|(^https)|(^ftp)):\/\/(\\w)+\.(\\w)+/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证手机号码
*/
function isMobile(container){
	//var regexp = /^((13[0-9])|(15[0-9])){1}\d{8}$/ ;
	var regexp = /^1\d{10}$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*是否包含数字
*/
function isContainNumber(container){
	var regexp = /[0-9]+/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*是否是实数
*@param container 标签对应的id属性
*/
function isNumeric(container){
	var regexp = /^(\+|-)?(0|[1-9]\d*)(\.\d*[1-9])?$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证是否是正实数
*@param container 标签对应的id属性
*/
function isUnsignedNumeric(container){
	var regexp = /^\d+(\.\d+)?$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证是否是整数
*@param container 标签对应的id属性
*/
function isInteger(container){
	var regexp = /^-?[1-9]\d*$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证是否是正整数
*@param container 标签对应的id属性
*/
function isUnsignedInteger(container){
	var regexp = /^[1-9]\d*$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证是否是qq号码
*@param container 标签对应的id属性
*/
function isQq(container){
	var regexp = /^\d{4,}$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*验证是否是qq号码
*@param container 标签对应的id属性
*/
function isTeleORMobile(container){
	var regexp = /^\d{6,}$/ ;
	var value = document.getElementById(container).value.trim() ;
	return checkByRegexp(regexp,value) ;
}
/**
*完全转化为实数
*/
function parseNumberic(container){
	if(isNumeric(container)){
		var value = document.getElementById(container).value.trim() ;
		return value - 0 ;
	}else{
		return false ;
	}
}
/**
*部分转化为实数
*/
function parsePartNumberic(container){
	var value = document.getElementById(container).value.trim() ;
	if(value != "undefined"){
		return parseFloat(value) ;
	}
}
/**
*完全转化为整数
*/
function parseInteger(container){
	if(isInteger(container)){
		var value = document.getElementById(container).value.trim() ;
		return value - 0 ;
	}else{
		return false ;
	}
}
/**
*部分转化为整数
*/
function parsePartInteger(container){
	var value = document.getElementById(container).value.trim() ;
	if(value != "undefined"){
		return parseInt(value) ;
	}
}
/**
*验证是否为空
*/
function isSpace(container){
	var value = document.getElementById(container).value.trim() ;
	if(value == ""){
		return true ;
	}
	return false ;
}
/**
*光标聚焦到指定位置
*/
function setFocus(container){
	document.getElementById(container).focus() ;
}
/**
*验证字符串长度
@param container    the id of the containter 
*@param minLength   the min length
*@param maxLength   the max length
*/
function isStringLength(container,minLength,maxLength){
	var value = document.getElementById(container).value.trim() ;
	if(value.length > minLength && value.length < maxLength){
		return true ;
	}
	return false ;
}
/**
*小于某个长度
*@param minLength 
*/
function isStringMinLength(container,minLength){
	var value = document.getElementById(container).value.trim() ;
	if(value.length < minLength ){
		return true ;
	}
	return false ;
}
/**
*大于某个长度
*@param maxLength   
*/
function isStringMaxLength(container,maxLength){
	var value = document.getElementById(container).value.trim() ;
	if(value.length > maxLength){
		return true ;
	}
	return false ;
}
/**
*是否等于某个长度
*@param equalLength
*/
function isEqualLength(container,equalLength){
	var value = document.getElementById(container).value ;
	if(value.length == equalLength){
		return true ;
	}
	return false ;
}
/**
*比较两个数值长度的大小 
*@param fristContainer
*@param sencodContainer
*@return 1，0，-1（前者大，相等，后者大）
*/
function isEqualValue(fristContainer,sencodContainer){
	var fValue = document.getElementById(fristContainer).value.trim() ;
	var sValue = document.getElementById(sencodContainer).value.trim() ;
	if(fValue != "undefined" && sValue != "undefined"){
		if(fValue.length > sValue.length){
			return 1 ;
		}else if(fValue.length == sValue.length){
			return 0 ;
		}else{
			return -1 ;
		}
	}	
}
/**
*比较两个值是否相等
*@param fristContainer
*@param sencodContainer
*@return 
*/
function isEqualValues(fristContainer,sencodContainer){
	var fValue = document.getElementById(fristContainer).value.trim() ;
	var sValue = document.getElementById(sencodContainer).value.trim() ;
	if(fValue != "undefined" && sValue != "undefined"){
		if(fValue == sValue){
			return true ;
		}else{
			return false ;
		}
	}	
}

function setGuideLineNo(theNo){
	createCookie("guideId",theNo);
}

//================《div bottom page bottom的应用》开始
//获取当前div的bottom的值
function getDivPosition(obj){
    var topValue= 0, heightValue= 0;
	heightValue = obj.offsetHeight;
    while(obj){
		topValue += obj.offsetTop;
		obj = obj.offsetParent;
    }
    var bottomValue = heightValue + topValue;
    return bottomValue;
}
//获取页面的高度
function getPageSize() {  
	var winH = 0;  
	if(window.innerHeight) { 
		// all except IE    
		winH = window.innerHeight;  
	} else if (document.documentElement && document.documentElement.clientHeight) {    
		// IE 6 Strict Mode    
		winH = document.documentElement.clientHeight;  
	} else if (document.body) { 
		// other    
		winH = document.body.clientHeight;  
	}  
	return winH;
}
//获取scrollbar的位置，目前是y坐标，需要加入x坐标的识别
function getScroll(){     
	var t, h;
	if (document.documentElement && document.documentElement.scrollTop) {         
		t = document.documentElement.scrollTop + getPageSize();         
		h = document.documentElement.scrollHeight;     
	} else if (document.body) {         
		t = document.body.scrollTop + getPageSize();         
		h = document.body.scrollHeight;     
	}
	var result = (h<t) ? h:t;
	return result; 
} 
//设置div的bottom不低于页面的bottom
function setScrollTo(theDiv){
	var divBottom = getDivPosition(theDiv);
	var scrollBottom = getScroll();
	if(divBottom > scrollBottom){
		var scrX = window.scrollX;
		window.scrollTo(scrX,divBottom-getPageSize()+10);
	}
}
//================《div bottom page bottom的应用》结束

	//检查过程中失去光标
	function checkBlur(container,index,functionName,cssName){
		for(var i=1;i<=index;i++){
			if(functionName(container)==i){
				document.getElementById(container+"-"+i).style.display="";
			}
			else{document.getElementById(container+"-"+i).style.display="none";
			}
		}
		document.getElementById(container).className = cssName;
	}
	//光标选中该输入框,container为当前组件，container1为之前组件，当container 为 "",不检查当前控件，当container1 为 "",不检查之前的控件
	function checkFocus(container,index,cssName,focusFlag,container1,index1,functionName1,cssName1){
		if(container!=""){
			if(focusFlag==0){
				document.getElementById(container+"-1").style.display="none";
			}
			else if(focusFlag==1){
				document.getElementById(container+"-1").style.display="block";
			}
			for(var i=2;i<=index;i++){
				document.getElementById(container+"-"+i).style.display="none";
			}
			document.getElementById(container).className = cssName;
		}
		if(container1!=""){
			checkBlur(container1,index1,functionName1,cssName1);
		}
	}
	
		
	function isEUDPhone(container){
		if(document.getElementById(container).value=="")return 2;
		else return 4;
	}

	function isEUDMobile(container){
		if( !isSpace( container ) ) {
			if(!isMobile(container)){
				return 1 ;
			}
		}
		else return 2;
	}
	function isEUDQq(container){
		if( !isSpace( container ) ) {
			if(!isQq(container)){
				return 1 ;
			}
		} 
		else return 2;
	}
	function isEUDMsn(container){
		if( !isSpace( container ) ) {
			if(!isEmail(container)){
				return 1 ;
			}
		} 
		else return 2;
	}
	
	function isEUDPostCode(container){
		if( !isSpace( container ) ) {
			if(!isPostCode(container)){
				return 1 ;
			}
		} 
		else return 2;
	
	}
	
	function isZero( temp ){
		if(temp==0){
			return 1;
		}else return 2;
	}
	
	function isEUDFax( container ){
		if( !isSpace( container ) ) {
			if(!isTelephone(container)){
				return 1 ;
			}
		} 
		else return 2;
	}
	function isEUDEmail(container){
		if(document.getElementById(container).value=="")return 2;
		if(isEmail(container)) return 4;
		else return 3;
	}