function isSpace(str) {
	var i;

	for(i = 0; i < str.length; i++) {
		if (str.charAt(i) != ' ' && str.charAt(i) != 'กก') return false;
	}
	return true;
}

function isNumber(str) {
	if (str.match(/^[0-9\.]+$/)) return true;
	return false;
}

function isTelNum(str) {
	if (str.match(/^[0-9-]+$/)) return true;
	return false;
}

function isURL(str) {
	var tmp, ary;

	if (str.toLowerCase().substr(0, 7) == 'http://') {
		tmp = str.substr(7);
	} else if (str.toLowerCase().substr(0, 8) == 'https://') {
		tmp = str.substr(8);
	} else {
		tmp = str;
	}
	ary = tmp.split('/');
	tmp = ary[0];
	if (tmp.match(/^[\w\.-]+\.\w{2,}$/)) return true;
	return false;
}

function isEmail(str) {
	if (str.match(/^[\w_\.-]+@[\w\.-]+\.\w{2,}$/)) return true;
	return false; 
}

function isDate(str) {
	if (str.length == 0 || str.match(/^20[0-9]{2}\-[01][0-9]\-[0-3][0-9]$/)) return true;
	return false;
}

function isCampaignChk(str1, str2) {
	if (str1.length > 0 && str2.length == 0) return false;
	return true;
}

function lengthCheck(str, len) {
	if (str.length > len) return false;
	return true;
}
