function web_check(str) {
	re = /\.ru|\.com|\.net|\.ua|htm|www\.|@|http|\.uk|\.info|\.ca|\.net|\.ua/;

	if (str.search(re) != -1)
		return false;
	else
		return true;

}

function BeginLayer(z, left, top) {
	if (document.layers) {
		document.writeln('<layer z-index=' + z + ' left=' + left + ' top='
				+ top + '>');
	} else {
		document.writeln('<DIV style="position: absolute; z-index=' + z
				+ '; left: ' + left + 'px; top: ' + top + 'px;">');
	}
}

function EndLayer() {
	if (document.layers) {
		document.writeln('</layer>');
	} else {
		document.writeln('</DIV>');
	}
}
function Openw(name) {
	y = y + 20;
	pid = 'win' + Math.round((Math.random() * (10000000)));
	window
			.open(
					'/foto.phtml?f=' + name,
					pid,
					'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=600, height=404, top=50,left=50');
}
function Openw1(name, x, y) {
	y = y + 20;
	pid = 'win' + Math.round((Math.random() * (10000000)));
	window
			.open(
					'/foto.phtml?f=' + name,
					pid,
					'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width='
							+ x + ', height=' + y + ', top=10,left=10');
}
function Openw3(name, x, y) {
	y = y + 20;
	pid = 'win' + Math.round((Math.random() * (10000000)));
	window
			.open(
					'/foto.phtml?f=' + name,
					pid,
					'scrollBars=no,resizable=no,toolbar=yes,menubar=yes,location=yes,directories=no,width='
							+ x + ', height=' + y + ', top=10,left=10');
}
function Openw2(name, x, y) {
	y = y + 20;
	pid = 'win' + Math.round((Math.random() * (10000000)));
	window
			.open(
					name,
					pid,
					'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width='
							+ x + ', height=' + y + ', top=40,left=40');
}
function isInteger(checkString) {
	newString = "";
	count = 0;
	for (i = 0; i < checkString.length; i++) {
		ch = checkString.substring(i, i + 1);
		if ((ch >= "0" && ch <= "9") || (ch == "-")) {
			newString += ch;
		}
	}
	if (checkString != newString)
		return false;
	else
		return true;
}

function isPhone(checkString) {
	newString = "";
	count = 0;
	for (i = 0; i < checkString.length; i++) {
		ch = checkString.substring(i, i + 1);
		if ((ch >= "0" && ch <= "9") || (ch == "-") || (ch == " ")
				|| (ch == ")") || (ch == "(")) {
			newString += ch;
		}
	}
	if (checkString != newString)
		return false;
	else
		return true;
}

function isFloat(checkString) {
	newString = "";
	count = 0;
	for (i = 0; i < checkString.length; i++) {
		ch = checkString.substring(i, i + 1);
		if ((ch >= "0" && ch <= "9") || (ch == ".")) {
			newString += ch;
		}
	}
	if (checkString != newString)
		return false;
	else
		return true;
}

function Rline()

{
	window.status = line.substring(x++, line.length);
	if (x == line.length)
		x = 0;
	setTimeout("Rline()", 100);
}

function Valid_top_en(theform) {
	if (theform.site_url.value == 0) {
		alert("Your site address must be filled in!");
		theform.site_url.focus();
		return false;
	} else if (theform.site_name.value == 0) {
		alert("Your site name must be filled  in!");
		theform.site_name.focus();
		return false;
	} else if (theform.email.value == 0) {
		alert("Your email must be filled in");
		theform.email.focus();
		return false;
	} else if (theform.email.value.indexOf("@") < 1) {
		alert("The e-mail is wrong!");
		theform.email.focus();
		return false;
	} else if (theform.email.value.indexOf(".") < 1) {
		alert("The e-mail is wrong");
		theform.email.focus();
		return false;
	} else if (theform.category.selectedIndex == 0) {
		alert("You must select a category !");
		return false;
	} else
		return true;
		/*theform.submit();*/
}