function checkuploadForm()
{
	title = document.getElementById("title").value;
	tags = document.getElementById("tags").value;
  	vwdescription = document.getElementById("vwdescription").value;
	category = document.getElementById("category").value;
  	
  	if (title == "")
	{
  		hideAllErrors();
		document.getElementById("titleError").style.display = "inline";
		document.getElementById("title").select();
		document.getElementById("title").focus();
  		return false;
  	} 
	else if (tags == "")
	{
		hideAllErrors();
		document.getElementById("tagsError").style.display = "inline";
		document.getElementById("tags").select();
		document.getElementById("tags").focus();
  		return false;
  	}
	else if (vwdescription == "")
	{
		hideAllErrors();
		document.getElementById("vwdescriptionError").style.display = "inline";
		document.getElementById("vwdescription").select();
		document.getElementById("vwdescription").focus();
  		return false;
  	}
	else if (category == "0")
	{
		hideAllErrors();
		document.getElementById("categoryError").style.display = "inline";
  		return false;
  	}
	
  	return true;
}
 
function hideAllErrors() 
{
	document.getElementById("titleError").style.display = "none"
	document.getElementById("tagsError").style.display = "none"
	document.getElementById("vwdescriptionError").style.display = "none"
	document.getElementById("categoryError").style.display = "none"
	document.getElementById("fileError").style.display = "none"
}

function uploadPreCheck() 
{
	if (checkuploadForm())
	{
		uploadFiles();
	}
	else
	return false;
}

function checkcontactform() {
	var nam1     = document.contactusform.nam1.value;
	var emailid  = document.contactusform.emailid.value;
	if(nam1==""){
	 alert("Enter Your Name");	
	 document.contactusform.nam1.focus();
	 return false;
	} else if(emailid==""){
	 alert("Enter Mail Address");
	 document.contactusform.emailid.focus();
	 return false;
   }
	return true;
}

function checkblogcommentform() {
	var comment_name= document.blogcomments.comment_name.value;
	var comment_email  = document.blogcomments.comment_email.value;
	if(comment_name==""){
	 alert("Enter Your Name");	
	 document.blogcomments.comment_name.focus();
	 return false;
	} else if(comment_email==""){
	 alert("Enter Mail Address");
	 document.blogcomments.comment_email.focus();
	 return false;
   }
	return true;
}

function checkforumloginform() {
	var usermail= document.forumform.usermail.value;
	var userpass  = document.forumform.userpass.value;
	if(usermail==""){
	 alert("Enter Mail Address");	
	 document.forumform.usermail.focus();
	 return false;
	} else if(userpass==""){
	 alert("Enter Password");
	 document.forumform.userpass.focus();
	 return false;
   }
	return true;
}


function checkforumregister() {
	var username= document.forumform.username.value;
	var usermail  = document.forumform.usermail.value;
	var userpass1  = document.forumform.userpass1.value;
	var userpass2  = document.forumform.userpass2.value;
	var security_code  = document.forumform.security_code.value;
	if(username==""){
	 alert("Enter UserName");	
	 document.forumform.username.focus();
	 return false;
	} else if(usermail==""){
	 alert("Enter Mail Address ");
	 document.forumform.usermail.focus();
	 return false;
   }else if(userpass1==""){
	 alert("Enter Password ");
	 document.forumform.userpass1.focus();
	 return false;
   }else if(userpass2==""){
	 alert("Enter Retype Password ");
	 document.forumform.userpass2.focus();
	 return false;
   }else if(userpass1!=userpass2){
	 alert("Password And Retype Password should be same");
	 document.forumform.userpass2.focus();
	 return false;
   }else if(security_code==""){
	 alert("Enter Character From Above Picture");
	 document.forumform.security_code.focus();
	 return false;
   }
	return true;
}

function checkforumtopic() {
	var subject= document.forumform.subject.value;
	var txtmsg  = document.forumform.txtmsg.value;
	if(subject==""){
	 alert("Enter Topic");	
	 document.forumform.subject.focus();
	 return false;
	} else if(txtmsg==""){
	 alert("Enter Message");
	 document.forumform.txtmsg.focus();
	 return false;
   }
	return true;
}

function checkforumreply() {
	var subject= document.forumform.subject.value;
	var txtmsg  = document.forumform.txtmsg.value;
	if(subject==""){
	 alert("Enter Topic");	
	 document.forumform.subject.focus();
	 return false;
	} else if(txtmsg==""){
	 alert("Enter Message");
	 document.forumform.txtmsg.focus();
	 return false;
   }
	return true;
}
