// check email's validity
function isValidEmail( strEmail )
{
	//var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(strEmail);
}

// all numeric
function isNumeric(str){
	var chk_numeric=false;
	for(i=0; i< str.length; i++){		
		if(str.charAt(i) >= '0' &&  str.charAt(i) <='9'){
			chk_numeric=true;
		}else{
			chk_numeric=false;
			break;
		}
	}
	return chk_numeric;
}

// number + none numeric
function isNumericAndOther(str){
	var chk_numeric=false;
	var chk_alpha=false;
	
	for(i=0; i< str.length; i++){		
		if(str.charAt(i) >= '0' &&  str.charAt(i) <='9'){
			chk_numeric=true;				
		}else{
			chk_alpha=true;			
		}
		if(chk_numeric==true && chk_alpha==true){
			break;
		}
	}
	return chk_numeric && chk_alpha;
}

function setCookie(name,value,expires){
	var d = new Date(), day="";
	if(expires){
		d.setDate(d.getDate()+expires);
		day = "expires="+d.toGMTString()+";";
	}
	document.cookie = name+"="+escape(value)+"; path=/;"+day;
};

function getCookie(name){
	var _name = name + "=",
		cookie = document.cookie + ";", 
		start = cookie.indexOf(_name), end;
	if(start != -1){
		end = cookie.indexOf(";",start);
		return unescape(cookie.substring(start + _name.length, end));
	}
	return;
};

function delCookie(name){
	document.cookie = name + "=;expires=Fri, 31 Dec 1987 23:59:59 GMT;";
};