// JavaScript Document
// Credit Card Validation Javascript
// copyright 12th May 2003, by Stephen Chapman, Felgall Pty Ltd
				
// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.
function validateCreditCard(s) {
	var v = "0123456789";
	var w = "";
	for (var i=0; i < s.length; i++) {
		x = s.charAt(i);
		if (v.indexOf(x,0) != -1)
		w += x;
	}
	var j = w.length / 2;
	if (j < 6.5 || j > 8 || j == 7) return false;
	var k = Math.floor(j);
	var m = Math.ceil(j) - k;
	var c = 0;
	for (var i=0; i<k; i++) {
		a = w.charAt(i*2+m) * 2;
		c += a > 9 ? Math.floor(a/10 + a%10) : a;
	}
	for (var i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
	return (c%10 == 0);
}

function checkEmail(eMailer) {
    var check=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (check.test(eMailer)) {
		 return true;
	} else {
		 return false;
	}
}
//function checkZip(zipper) {
//	var check=/([0-9]{5})/i;
//	if (check.test(zipper)) {
//		return true;
//	} else {
//		return false;
//	}
//}				
//function showLi(itm) {
//	var t_ul = itm.nextSibling.nextSibling;
//	t_ul.style.display="block";
//}
//var timer = "";
//function hideLi(itm) {
//	timer = window.setTimeout(hideMe, 700, itm);
//}
//function setValue(itm) {
//	var stype = document.getElementById("stypeval");
//	var svalue = itm.innerHTML;
//	stype.value = svalue;
//	document.getElementById("stype").style.display = "none";
//	document.getElementById("ssize").style.display = "block";	
//}
//function setValue2(itm) {
//	var ssize = document.getElementById("ssizeval");
//	var ssvalue = itm.innerHTML;
//	ssize.value = ssvalue;
//	document.form1.submit();
//}
//function hideMe(itm) {
//	window.clearTimeout(timer);
//	itm.style.display = "none";	
//}
//function clearMe() {
//	window.clearTimeout(timer);
//	itm.style.display = "block";	
//}
//function popMe(itm) {
//		var popper = document.getElementById(itm);
//		if (popper.style.display == "block") {
//			popper.style.display = "none";
//		} else {
//			popper.style.display = "block";
//		}
//	}
//	
//function equalizeIt() {
//	var a = document.getElementById('content');
//	var b = document.getElementById('right');
//	
//	if (a.offsetHeight > b.offsetHeight)  {
//		var oset = a.offsetHeight - b.offsetHeight - 18;
//		b.style.height += (b.offsetHeight + oset)+"px";
//	}
//}
