function checkURL(s)
{
	if (s.match("^((ht|f)tp(s?)\\:\\/\\/|~/|/)?([\\w]+:\\w+@)?([a-zA-Z]{1}([\\w\\-]+\\.)+([\\w]{2,5}))(:[\\d]{1,5})?((/?\\w+/)+|/?)(\\w+\\.[\\w]{3,4})?((\\?\\w+=\\w+)?(&\\w+=\\w+)*)?")) {
		return true;
	}

	return false;
}

function checkEmail(s)
{
	var match = new RegExp("^([a-zA-Z0-9\\-\\.\\_]+)(\\@)([a-zA-Z0-9\\-\\.]+)(\\.)([a-zA-Z]{2,4})$"); 
	return(match.test(s));
}


function checkForm(check)
{
	var ok = true;

	if (typeof check == "object")
	{
		if (check.length == 0) {
			ok = false;
		}
		else
		{
			for (var i=0; i<check.length; i++)
			{
				if ($.trim($("#"+check[i]).val()) == "") {
					$("#"+check[i]).addClass("error");
					ok = false;
				}
				else
				{
					if (check[i] == "email" && !checkEmail($("#"+check[i]).val())) {
						$("#"+check[i]).addClass("error");
						ok = false;
					}
					else {
						$("#"+check[i]).removeClass("error");
					}
				}
			}
		}
	}
	else {
		ok = false;
	}

	return ok;
}
