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 isCmail(str) {
	if (str.match(/^[\w_\.-]+$/)) return true;
	return false; 
}

function isPWD(str) {
	if (str.length < 4 || str.length > 20) return false;
	if (str.match(/^[\w_]+$/)) return true;
	return false;
}

function fncAlert() {
	alert('ログイン後または、会員登録後にご利用ください。');
}

function fncChange() {
	if (document.footerform.link.value == '1') {
		window.open('http://www.mylohas.net/');
	} else if (document.footerform.link.value == '2') {
		window.open('http://www.ultracyzo.com/');
	} else if (document.footerform.link.value == '3') {
		window.open('http://www.m-kungfu.com/');
	} else if (document.footerform.link.value == '4') {
		window.open('https://cataloger.jp/pc/');
	} else if (document.footerform.link.value == '5') {
		window.open('http://www.kensho11.com/');
	} else if (document.footerform.link.value == '6') {
		window.open('http://www.podcastnavi.com/');
	} else if (document.footerform.link.value == '7') {
		window.open('http://www.infobahn.co.jp/research/');　
	} else if (document.footerform.link.value == '8') {
		window.open('http://www.publishing-vm.net/blog/');
	}
}

function fncEnquete() {
	var check = 0;
	
	for (i = 0; i < document.enqueteform.elements.length; i++) {
		if (document.enqueteform.elements[i].type == 'radio') {
			if (document.enqueteform.elements[i].checked) {
				check = document.enqueteform.elements[i].value;
				break;
			}
		}
	}
	
	if (check > 0) {
		eid = document.enqueteform.EID.value;
		param = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=500, height=500';
		window.open('enquete.php?EID=' + eid + '&answer=' + check, 'enquete', param);
	} else {
		alert('チェックされていません。');
	}
	return false;
}

function openEnquete(eid) {
	param = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=500, height=500';
	window.open('enquete.php?EID=' + eid, 'enquete', param);
}

