function checkNewsUpload(){
	validated = true;
	title = document.getElementById("title").value;
	news = document.getElementById("news").value;
	date = document.getElementById("date1").value;
	author = document.getElementById("author").value;
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (date == ""){
		document.getElementById("dateError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("dateError").style.display = "none";
	}
	if (news == ""){
		document.getElementById("newsError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("newsError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert(); }
	else{ 
		return validated; }
}


function checkContact(){
	validated = true;
	name = document.getElementById("name").value;
	email = document.getElementById("email").value;
	faculty = document.getElementById("faculty").value;
	subject = document.getElementById("subject").value;
	message = document.getElementById("message").value;

	if (name == ""){
		document.getElementById("nameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("nameError").style.display = "none";
	}
	if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1){
		document.getElementById("emailError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("emailError").style.display = "none";
	}
	if (faculty == "0"){
		document.getElementById("facultyError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("facultyError").style.display = "none";
	}
	if (subject == ""){
		document.getElementById("subjectError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("subjectError").style.display = "none";
	}
	if (message == ""){
		document.getElementById("messageError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("messageError").style.display = "none";
	}
	return validated;
}


function checkFeedback(){
	validated = true;
	sender = document.getElementById("sender").value;
	email = document.getElementById("senderEmail").value;
	subject = document.getElementById("feedbackSubject").value;
	comment = document.getElementById("comment").value;

	if (sender == ""){
		document.getElementById("senderError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("senderError").style.display = "none";
	}
	if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1){
		document.getElementById("senderEmailError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("senderEmailError").style.display = "none";
	}
	if (subject == ""){
		document.getElementById("feedbackSubjectError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("feedbackSubjectError").style.display = "none";
	}
	if (comment == ""){
		document.getElementById("commentError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("commentError").style.display = "none";
	}
	return validated;
}


function checkAdminUpdate(){
	validated = true;
	fname = document.getElementById("firstname").value;
	lname = document.getElementById("lastname").value;
	email = document.getElementById("email").value;
	password1 = document.getElementById("password1").value;
	password2 = document.getElementById("password2").value;
	
	if (fname == ""){
		document.getElementById("fnameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("fnameError").style.display = "none";
	}
	if (lname == ""){
		document.getElementById("lnameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("lnameError").style.display = "none";
	}
	if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1){
		document.getElementById("emailError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("emailError").style.display = "none";
	}
	if (password1 == "" && password2 !=""){
		document.getElementById("password1Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("password1Error").style.display = "none";
	}
	if (password1 != "" && password2 == ""){
		document.getElementById("password2Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("password2Error").style.display = "none";
	}
	if(validated == true && password1 != password2){
		alert('Passwords do not match. Please re-enter the passwords!');
		validated = false;
	}
	if(validated == true){ 
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkEmploymentUpload(){
	validated = true;
	title = document.getElementById("title").value;
	description = document.getElementById("description").value;
	requirements = document.getElementById("requirements").value;
	author = document.getElementById("author").value;

	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (description == ""){
		document.getElementById("descriptionError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("descriptionError").style.display = "none";
	}
	if (requirements == ""){
		document.getElementById("requirementsError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("requirementsError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkFileUpload(){
	validated = true;
	title = document.getElementById("title").value;
	fileItem = document.getElementById("file").value;
	author = document.getElementById("author").value;
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (fileItem == "" || !(fileItem.substr(fileItem.length-4) == ".pdf")){
		document.getElementById("fileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("fileError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkEventUpload(){
	validated = true;
	title = document.getElementById("title").value;
	date = document.getElementById("date1").value;
	fileItem = document.getElementById("file").value;
	author = document.getElementById("author").value;
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (date == ""){
		document.getElementById("dateError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("dateError").style.display = "none";
	}
	if (fileItem == "" || !(fileItem.substr(fileItem.length-4) == ".pdf")){
		document.getElementById("fileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("fileError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkCharacterUpload(){
	validated = true;
	title = document.getElementById("title").value;
	fileItem = document.getElementById("file").value;
	author = document.getElementById("author").value;
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (fileItem != "" && !(fileItem.substr(fileItem.length-4) == ".pdf")){
		document.getElementById("fileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("fileError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkAlbumUpload(){
	validated = true;
	title = document.getElementById("title").value;
	cover = document.getElementById("cover").value;
	author = document.getElementById("author").value;
	photo1 = document.getElementById("photo1").value;
	photo2 = document.getElementById("photo2").value;
	photo3 = document.getElementById("photo3").value;
	photo4 = document.getElementById("photo4").value;
	photo5 = document.getElementById("photo5").value;
	photo6 = document.getElementById("photo6").value;
	photo7 = document.getElementById("photo7").value;
	photo8 = document.getElementById("photo8").value;
	photo9 = document.getElementById("photo9").value;
	photo10 = document.getElementById("photo10").value;
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (cover == ""){
		document.getElementById("emptyCoverError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("emptyCoverError").style.display = "none";
	}
	if (cover != "" && (!(cover.substr(cover.length-4) == ".jpg") && !(cover.substr(cover.length-4) == ".JPG") && !(cover.substr(cover.length-4) == ".jpeg") && !(cover.substr(cover.length-4) == ".JPEG"))){
		document.getElementById("invalidCoverError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidCoverError").style.display = "none";
	}	
	if (photo1 != "" && (!(photo1.substr(photo1.length-4) == ".jpg") && !(photo1.substr(photo1.length-4) == ".JPG") && !(photo1.substr(photo1.length-4) == ".jpeg") && !(photo1.substr(photo1.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto1Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto1Error").style.display = "none";
	}
	if (photo2 != "" && (!(photo2.substr(photo2.length-4) == ".jpg") && !(photo2.substr(photo2.length-4) == ".JPG") && !(photo2.substr(photo2.length-4) == ".jpeg") && !(photo2.substr(photo2.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto2Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto2Error").style.display = "none";
	}
	if (photo3 != "" && (!(photo3.substr(photo3.length-4) == ".jpg") && !(photo3.substr(photo3.length-4) == ".JPG") && !(photo3.substr(photo3.length-4) == ".jpeg") && !(photo3.substr(photo3.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto3Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto3Error").style.display = "none";
	}
	if (photo4 != "" && (!(photo4.substr(photo4.length-4) == ".jpg") && !(photo4.substr(photo4.length-4) == ".JPG") && !(photo4.substr(photo4.length-4) == ".jpeg") && !(photo4.substr(photo4.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto4Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto4Error").style.display = "none";
	}
	if (photo5 != "" && (!(photo5.substr(photo5.length-4) == ".jpg") && !(photo5.substr(photo5.length-4) == ".JPG") && !(photo5.substr(photo5.length-4) == ".jpeg") && !(photo5.substr(photo5.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto5Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto5Error").style.display = "none";
	}
	if (photo6 != "" && (!(photo6.substr(photo6.length-4) == ".jpg") && !(photo6.substr(photo6.length-4) == ".JPG") && !(photo6.substr(photo6.length-4) == ".jpeg") && !(photo6.substr(photo6.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto6Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto6Error").style.display = "none";
	}
	if (photo7 != "" && (!(photo7.substr(photo7.length-4) == ".jpg") && !(photo7.substr(photo7.length-4) == ".JPG") && !(photo7.substr(photo7.length-4) == ".jpeg") && !(photo7.substr(photo7.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto7Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto7Error").style.display = "none";
	}
	if (photo8 != "" && (!(photo8.substr(photo8.length-4) == ".jpg") && !(photo8.substr(photo8.length-4) == ".JPG") && !(photo8.substr(photo8.length-4) == ".jpeg") && !(photo8.substr(photo8.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto8Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto8Error").style.display = "none";
	}
	if (photo9 != "" && (!(photo9.substr(photo9.length-4) == ".jpg") && !(photo9.substr(photo9.length-4) == ".JPG") && !(photo9.substr(photo9.length-4) == ".jpeg") && !(photo9.substr(photo9.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto9Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto9Error").style.display = "none";
	}
	if (photo10 != "" && (!(photo10.substr(photo10.length-4) == ".jpg") && !(photo10.substr(photo10.length-4) == ".JPG") && !(photo10.substr(photo10.length-4) == ".jpeg") && !(photo10.substr(photo10.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto10Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto10Error").style.display = "none";
	}											
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkAlbumEdit(){
	validated = true;
	title = document.getElementById("title").value;
	cover = document.getElementById("cover").value;
	author = document.getElementById("author").value;
	photo1 = document.getElementById("photo1").value;
	photo2 = document.getElementById("photo2").value;
	photo3 = document.getElementById("photo3").value;
	photo4 = document.getElementById("photo4").value;
	photo5 = document.getElementById("photo5").value;
	photo6 = document.getElementById("photo6").value;
	photo7 = document.getElementById("photo7").value;
	photo8 = document.getElementById("photo8").value;
	photo9 = document.getElementById("photo9").value;
	photo10 = document.getElementById("photo10").value;	
	
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (author == ""){
		document.getElementById("authorError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("authorError").style.display = "none";
	}
	if (cover != "" && (!(cover.substr(cover.length-4) == ".jpg") && !(cover.substr(cover.length-4) == ".JPG") && !(cover.substr(cover.length-4) == ".jpeg") && !(cover.substr(cover.length-4) == ".JPEG"))){
		document.getElementById("invalidCoverError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidCoverError").style.display = "none";
	}
	if (photo1 != "" && (!(photo1.substr(photo1.length-4) == ".jpg") && !(photo1.substr(photo1.length-4) == ".JPG") && !(photo1.substr(photo1.length-4) == ".jpeg") && !(photo1.substr(photo1.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto1Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto1Error").style.display = "none";
	}
	if (photo2 != "" && (!(photo2.substr(photo2.length-4) == ".jpg") && !(photo2.substr(photo2.length-4) == ".JPG") && !(photo2.substr(photo2.length-4) == ".jpeg") && !(photo2.substr(photo2.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto2Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto2Error").style.display = "none";
	}
	if (photo3 != "" && (!(photo3.substr(photo3.length-4) == ".jpg") && !(photo3.substr(photo3.length-4) == ".JPG") && !(photo3.substr(photo3.length-4) == ".jpeg") && !(photo3.substr(photo3.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto3Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto3Error").style.display = "none";
	}
	if (photo4 != "" && (!(photo4.substr(photo4.length-4) == ".jpg") && !(photo4.substr(photo4.length-4) == ".JPG") && !(photo4.substr(photo4.length-4) == ".jpeg") && !(photo4.substr(photo4.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto4Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto4Error").style.display = "none";
	}
	if (photo5 != "" && (!(photo5.substr(photo5.length-4) == ".jpg") && !(photo5.substr(photo5.length-4) == ".JPG") && !(photo5.substr(photo5.length-4) == ".jpeg") && !(photo5.substr(photo5.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto5Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto5Error").style.display = "none";
	}
	if (photo6 != "" && (!(photo6.substr(photo6.length-4) == ".jpg") && !(photo6.substr(photo6.length-4) == ".JPG") && !(photo6.substr(photo6.length-4) == ".jpeg") && !(photo6.substr(photo6.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto6Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto6Error").style.display = "none";
	}
	if (photo7 != "" && (!(photo7.substr(photo7.length-4) == ".jpg") && !(photo7.substr(photo7.length-4) == ".JPG") && !(photo7.substr(photo7.length-4) == ".jpeg") && !(photo7.substr(photo7.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto7Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto7Error").style.display = "none";
	}
	if (photo8 != "" && (!(photo8.substr(photo8.length-4) == ".jpg") && !(photo8.substr(photo8.length-4) == ".JPG") && !(photo8.substr(photo8.length-4) == ".jpeg") && !(photo8.substr(photo8.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto8Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto8Error").style.display = "none";
	}
	if (photo9 != "" && (!(photo9.substr(photo9.length-4) == ".jpg") && !(photo9.substr(photo9.length-4) == ".JPG") && !(photo9.substr(photo9.length-4) == ".jpeg") && !(photo9.substr(photo9.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto9Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto9Error").style.display = "none";
	}
	if (photo10 != "" && (!(photo10.substr(photo10.length-4) == ".jpg") && !(photo10.substr(photo10.length-4) == ".JPG") && !(photo10.substr(photo10.length-4) == ".jpeg") && !(photo10.substr(photo10.length-4) == ".JPEG"))){
		document.getElementById("invalidPhoto10Error").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidPhoto10Error").style.display = "none";
	}	
	if(validated == true){ 
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkFacultyUpload(){
	var validated = true;
	var firstname = document.getElementById("firstname").value;
	var lastname = document.getElementById("lastname").value;
	var title = document.getElementById("title").value;
	var department = document.getElementById("department").value;
	var email = document.getElementById("email").value;
	var photo = document.getElementById("photo").value;

	if (firstname == ""){
		document.getElementById("firstnameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("firstnameError").style.display = "none";
	}
	if (lastname == ""){
		document.getElementById("lastnameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("lastnameError").style.display = "none";
	}
	if (title == ""){
		document.getElementById("titleError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("titleError").style.display = "none";
	}
	if (department == ""){
		document.getElementById("departmentError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("departmentError").style.display = "none";
	}
	if (email == "" || email.indexOf("@") == -1 || email.indexOf(".") == -1){
		document.getElementById("emailError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("emailError").style.display = "none";
	}
	if (photo != "" && (!(photo.substr(photo.length-4) == ".jpg") && !(photo.substr(photo.length-4) == ".JPG") && !(photo.substr(photo.length-4) == ".jpeg") && !(photo.substr(photo.length-4) == ".JPEG"))){
		document.getElementById("photoError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("photoError").style.display = "none";
	}	
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkClubUpload(){
	var validated = true;
	var name = document.getElementById("name").value;
	var description = document.getElementById("description").value;
	var banner = document.getElementById("banner").value;
	var pagefile = document.getElementById("pagefile").value;;

	if (name == ""){
		document.getElementById("nameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("nameError").style.display = "none";
	}
	if (description == ""){
		document.getElementById("descriptionError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("descriptionError").style.display = "none";
	}
	if (banner == ""){
		document.getElementById("emptyBannerError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("emptyBannerError").style.display = "none";
	}
	if (banner != "" && (!(banner.substr(banner.length-4) == ".jpg") && !(banner.substr(banner.length-4) == ".JPG") && !(banner.substr(banner.length-4) == ".jpeg") && !(banner.substr(banner.length-4) == ".JPEG"))){
		document.getElementById("invalidBannerError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidBannerError").style.display = "none";
	}
	if (pagefile != "" && !(pagefile.substr(pagefile.length-4) == ".pdf")){
		document.getElementById("pagefileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("pagefileError").style.display = "none";
	}
	
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkClubEdit(){
	var validated = true;
	var name = document.getElementById("name").value;
	var description = document.getElementById("description").value;
	var banner = document.getElementById("banner").value;
	var pagefile = document.getElementById("pagefile").value;;

	if (name == ""){
		document.getElementById("nameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("nameError").style.display = "none";
	}
	if (description == ""){
		document.getElementById("descriptionError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("descriptionError").style.display = "none";
	}
	if (banner != "" && (!(banner.substr(banner.length-4) == ".jpg") && !(banner.substr(banner.length-4) == ".JPG") && !(banner.substr(banner.length-4) == ".jpeg") && !(banner.substr(banner.length-4) == ".JPEG"))){
		document.getElementById("invalidBannerError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("invalidBannerError").style.display = "none";
	}
	if (pagefile != "" && !(pagefile.substr(pagefile.length-4) == ".pdf")){
		document.getElementById("pagefileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("pagefileError").style.display = "none";
	}
	
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkIsPdf(){
	validated = true;
	ptonews = document.editForm.file.value;
	if (ptonews != "" && !(ptonews.substr(ptonews.length-4) == ".pdf")){
		document.getElementById("fileError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("fileError").style.display = "none";
	}
	if(validated == true){
		return confirmAlert();
	}else{ 
		return validated;
	}
}


function checkLogin(){
	validated = true;
	username = document.getElementById("username").value;
	password = document.getElementById("password").value;
	
	if (username == ""){
		document.getElementById("usernameError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("usernameError").style.display = "none";
	}
	if (password == ""){
		document.getElementById("passwordError").style.display = "inline";
		validated = false;
	}else{
		document.getElementById("passwordError").style.display = "none";
	}
	return validated;
}


function confirmAlert(){
	return confirm("Press OK to continue or Cancel to go back!");
}


function limitText(limitField, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } 
}


function Check(){
    if (document.form1.tPassword.value != "" && document.form1.tUsername.value != ""){
        return true;
    }else{
        alert("Please fill required fields");
        return false;
    }
}


function OpenForgotPassword(){
    testwindow= window.open ("http://72.167.255.34/pioneercss/forgot.aspx", "mywindow", "toolbar=no,location=No,status=No,scrollbars=Yes,width=480,height=280");
    testwindow.moveTo(400,150);
}
