function submitStudentLicenseApplication()
{
	if (document.getElementById('Student_FName').value == "")
	{
		alert('Please specify your First name.');
		return;
	}
	if (document.getElementById('Student_LName').value == "")
	{
		alert('Please specify your Last name.');
		return;
	}
	if (document.getElementById('Student_Email').value == "")
	{
		alert('Please specify your E-mail.');
		return;
	}

   	if(!validate_email(document.getElementById('Student_Email').value)) 
	{
    	alert('Student\'s E-mail is invalid.');
      	return;
   	}

	if (document.getElementById('Student_App_Area').value == "")
	{
		alert('Please specify your Application area.');
		return;
	}
	if (document.getElementById('Univ_Name').value == "")
	{
		alert('Please specify University/Institution.');
		return;
	}
	if (document.getElementById('Univ_Faculty').value == "")
	{
		alert('Please specify Department/Faculty.');
		return;
	}
	if (document.getElementById('Univ_Address').value == "")
	{
		alert('Please specify University address.');
		return;
	}
	if (document.getElementById('Univ_City').value == "")
	{
		alert('Please specify City.');
		return;
	}
	if (document.getElementById('Univ_PostalCode').value == "")
	{
		alert('Please specify Postal code.');
		return;
	}

	if (document.getElementById('Univ_Country').value == "-1")
	{
		alert('Please specify Country.');
		return;
	}
	
	if (document.getElementById('Univ_Webpage').value != "")
	{
		if (!validate_website(document.getElementById('Univ_Webpage').value))
		{
			alert("University Home page is invalid.");
			return;
		}
	}
	
	if (document.getElementById('Professor_Email').value != "")
	{
		if (!validate_email(document.getElementById('Professor_Email').value))
		{
			alert("Professor\'s E-mail is invalid.");
			return;
		}
	}
	
	if (document.getElementById('Professor_Webpage').value != "")
	{
		if (!validate_website(document.getElementById('Professor_Webpage').value))
		{
			alert("Professor's Home page is invalid.");
			return;
		}
	}
	
	//alert(document.getElementById('Specify_Request').value);
	
	document.forms['form-application'].submit();
}

function submitRegistrationForm()
{
	if (document.getElementById('FName').value == "")
	{
		alert('Please specify your First name.');
		return;
	}
	if (document.getElementById('LName').value == "")
	{
		alert('Please specify your Last name.');
		return;
	}

   	if (document.getElementById('Email').value != "")
	{
	if (!validate_email(document.getElementById('Email').value)) 
	{
    	alert('Provided E-mail is invalid.');
      	return;
   	}
	}

	if (document.getElementById('Company_Name').value == "")
	{
		alert('Please specify Company.');
		return;
	}

	if (document.getElementById('Company_Country').value == "-1")
	{
		alert('Please specify Country.');
		return;
	}
	
	//alert(document.getElementById('Specify_Request').value);
	
	document.forms['form-registration'].submit();
}

function validate_email(email)
{
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   	if(reg.test(email) == false) 
      	return false;
	
	return true;
} 

function validate_website(website)
{
	if ((website.indexOf("http://") != 0 && website.indexOf("www.") != 0) || website.indexOf(".") == -1)
		return false;

	
	return true;
} 
