var dots = 0;
var bar = '';
function popupnew(file,key,widt,heit,scrol) {
	if (!scrol)
		scrol = "no";
		
	win = window.open(file,key,'status=no,scrollbars=' + scrol + ',resizable=no,width=' + widt + ',height=' + heit);
	win.focus();
}

function showprogress() {
	document.getElementById("mainpage").style.display = 'none';
	document.getElementById("progresspage").style.display = 'block';
}

function drawprogess() {
	dots = dots + 1;
	if (dots >= 6) {
		dots = 0;
	}
	var n;
	bar = '';
	for (n = 1; n <= dots; n++) {
		bar = bar + '.';
	}
	document.getElementById("progressbar").innerHTML = bar;

	setTimeout("drawprogess()", 500);
}

function redirect(page) {
	showprogress();
	document.location.href = page;
}

function drawprogess() {
	dots = dots + 1;
	if (dots >= 6) {
		dots = 0;
	}
	var n;
	bar = '';
	for (n = 1; n <= dots; n++) {
		bar = bar + '.';
	}
	document.getElementById("progressbar").innerHTML = bar;

	setTimeout("drawprogess()", 500);
}

function checkform() {
	if (!isemail(document.getElementById("email").value)) {
		alert("Please enter a valid email address");
		return false;
	} 
	if (!isfirstname(document.getElementById("firstname").value)) {
		alert("Please enter your first name");
		return false;
	} 
	if (!islastname(document.getElementById("lastname").value)) {
		alert("Please enter your surname");
		return false;
	} else {
		return true;
	}
}

function isemail(str) {
	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
function isfirstname(str) {
	return (str.match("^[a-zA-Z]+$"));
}
function islastname(str) {
	return (str.match("^[a-zA-Z]+$"));
}