function ValidateCat()
  {
	  if(document.form1.CatDescription.value <1)
	  {
		  document.getElementById('cat').innerHTML = 'Please Provide Category Name';
		  document.form1.CatDescription.focus();
		  return false;
		  }
	  else {
		  return true;
		  }
	  }

		
		function ValidatePresenter(){
	  if(document.form1.PresenterName.value <1)
	  {
		  document.getElementById('DivPresenterName').innerHTML = 'Please Provide Presenter Name';
		  document.form1.PresenterName.focus();
		  return false;
		  }
	  else {
		  return true;
		  }
	  }
	  
	  	function ValidateTestimonial(){
	  if(document.form1.PostedBy.value <1)
	  {
		  document.getElementById('DivPresenterName').innerHTML = 'Please Provide Posted by ';
		  document.form1.PostedBy.focus();
		  return false;
		  }
	  else {
		  return true;
		  }
	  }
	  
	  	function ValidateClient(){
	  if(document.form1.ClientName.value <1)
	  {
		  document.getElementById('DivPresenterName').innerHTML = 'Please Provide Client Name ';
		  document.form1.ClientName.focus();
		  return false;
		  }
	  else {
		  return true;
		  }
	  }
	  

	 function backtohome(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'categorylist.php';
	}
}
 
 function backtohomecourselist(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'CoursesList.php';
	}
}


	function backtohomepresenterlist(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'Presenterlist.php';
	}
}

   function backtohometestimoniallist(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'testimonial_list.php';
	}
}

 function backtohomeGeneral(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'main.php';
	}
}

function backtohomeclientlist(){
	if(confirm('Are You Sure to Cancel?')){
	  window.location = 'main.php';
	}
}

 function AddCategory(){
	 
	 var status = ValidateCat();
	 if(status){
		 document.form1.hdAction.value = 1;
		 document.form1.submit();
		 
		 }
	 
	 } 
	 
	 
	 
	 
	 function AddCourse()
	 {
		 document.form1.hdAction.value = 3;
		 document.form1.submit();
		 
		 }
		 
		
		function ValidateLogin()
	 {
		 //return true;
		 if(document.form1.username.value < 1)
		  {
			  //alert('Please Provide Username');
			  document.getElementById('myusername').innerHTML = '*Please Provide Username';
			  document.form1.username.focus();
			  document.getElementById('mypass').innerHTML = '';
			  return false;
			  }
		     if(document.form1.password.value <1)
			  {
				  document.getElementById('myusername').innerHTML = '';
				 // alert('Please Provide Password');
				   document.getElementById('mypass').innerHTML = '*Please Provide Password';
				   document.form1.password.focus();
				   return false;
				  }
		 else {
			 document.form1.hdAction.value=1;
			 document.form1.submit();
			 return true;
			 }
		 }
		  
		  function LogOut(){
			  
			  if(confirm('Are You Sure To Logout?')){
			     window.location = 'index.php?status=logout';
			   }
			  }
			  
			  
			  function AddPresenter1(){
						
			  var status = ValidatePresenter();
	 			if(status){
		 		document.form1.hdAction.value = 1;
		 		document.form1.submit();
		 		}
			} 
			
			
			
			function UpdatePresenter1(){
						
			  var status = ValidatePresenter();
	 			if(status){
		 		document.form1.hdAction.value = 2;
		 		document.form1.submit();
		 		}
			} 
			  
			  function CourseSearch(){
				  
				  document.form1.submit();
				  
				  }
				  
				  function UpdateCourse(id){
					  
					  document.form2.hdIdent.value = id;
					  document.form2.UpdateIdent.value = 3;
					  document.form2.action = 'addcourse.php';
					  document.form2.submit();	  
					  }
					  
					  function DeleteCourse(id){
						  
						  if(confirm('Are You Sure to Delete this Course?')){
						  document.form2.hdAction.value = 2;
						  document.form2.hdIdent.value = id;
						  document.form2.submit();
						   }
						  }
						  
						  function getUpdateCourse(){	  
						  document.form1.hdIdent.value 
						  document.form1.hdAction.value = 4;
						  document.form1.submit();	  
					  }
					  
					 function AddTestimonial(){		
			  		var status = ValidateTestimonial();
	 				if(status){
		 			document.form1.hdAction.value = 1;
		 			document.form1.submit();
		 			}
				} 
				
				function UpdateDoTestimonial(){		
			  		var status = ValidateTestimonial();
	 				if(status){
		 			document.form1.hdAction.value = 2;
		 			document.form1.submit();
		 			}
				} 
				
				function AddClient(){		
			  		var status = ValidateClient();
	 				if(status){
		 			document.form1.hdAction.value = 1;
		 			document.form1.submit();
		 			}
				} 
				
				function DeletePresenter(id){
					
					if(confirm('Are You Sure to Delete This Presenter?')){
						
						document.form1.hdAction.value = 1;
						document.form1.hdIdent.value = id;
						document.form1.submit();
						}
					}
					
					function DeleteCountry(id){
					
					if(confirm('Are You Sure to Delete This Country?')){
						
						document.form1.hdAction.value = 1;
						document.form1.hdIdent.value = id;
						document.form1.submit();
						}
					}
					
					
					
					function UpdatePresenter(id){
						
						document.form1.action = 'addpresenter.php?id='+id;
						document.form1.submit();
						}
						
						
						function DeleteTestimonial(id){
					
					if(confirm('Are You Sure to Delete This Testimonial?')){
						
						document.form1.hdAction.value = 1;
						document.form1.hdIdent.value = id;
						document.form1.submit();
						}
					}
					
					function UpdateTestimonial(id){
						
						document.form1.action = 'addtestimonial.php?id='+id;
						document.form1.submit();
						}
						
						function UpdatePage(){
							document.form1.hdAction.value = 1;
							document.form1.submit();
							}
							
							
							function AddCountryMy(){
								
								document.form1.hdAction.value = 1;
								document.form1.submit();
								
								}
								
								
							function UpdateMainDoc(CourseId,DocName){
	   						window.open ("updatedoc.php?CourseId="+CourseId+"&DocName="+DocName,"Promis","status=0,scrollbars=0,left=150,top=120,width=300,height=200");
	   						}
							
							
							function MakeOfferVisible(){
								
								if(document.getElementById('SpecialOffer').checked){
								  document.getElementById('offer').className = 'PROMIS_text_course';
								}
								else{
									document.getElementById('offer').className = 'PROMIS_text_course_hide';
									
									}
								}

								function EditImage(){
								
								
								  document.getElementById('offer').className = 'PROMIS_text_course';
								
								
									//document.getElementById('offer').className = 'PROMIS_text_course_hide';		
								}
						
						
						function ViewPresenter(id){
							
							document.form1.hdIdent.value = id;
							document.form1.action = 'ViewPresenterDetails.php';
							document.form1.submit();
							
							}