//Form validation for artist education Univer/college
function checkval(){
if(document.unv.unvname.value==""){
alert("Please Enter University/College Name:");
document.unv.unvname.focus();
return false;
}

if(document.unv.unvplace.value==""){
alert("Please Enter The Address Of University/College:");
document.unv.unvplace.focus();
return false;
}

if(document.unv.unvprg.value==""){
alert("Please Enter The Program Name:");
document.unv.unvprg.focus();
return false;
}

if(document.unv.unv_from_date.value==""){
alert("Please Choose Starting Date");
document.unv.unv_from_date.focus();
return false;
}

if(document.unv.unv_to_date.value==""){
var ans=confirm("You Left End Date Blank.Is It Your Present University/College?");
if(ans){
document.unv.unv_to_date.value=0;
document.unv.unv_grad.focus();
return false;
 }
 else
 {
 alert("Please Choose End Date");
 document.unv.unv_to_date.focus();
 return false;
 }
 
}




// set the end value to blank
 if((document.unv.unv_from_date.value!="") && (document.unv.unv_to_date.value!="") && (document.unv.unv_to_date.value!=0)){
 var Startdt=document.unv.unv_from_date.value;
 var Enddt=document.unv.unv_to_date.value;
 if(checkdate(Startdt,Enddt)==false){
 document.unv.unv_to_date.value="";
 document.unv.unv_to_date.focus();
 return false;
 }
 }
 //end set
if(document.unv.unv_grad.value==""){
alert("Please Enter Field Of Graduation ");
document.unv.unv_grad.focus();
return false;
}

return true;
}
//end form








//Form validation for artist education private tutorial
function tutorialval(){
if(document.tutorial.tut_name.value==""){
alert("Please Enter Name Of Tuorials ");
document.tutorial.tut_name.focus();
return false;
}

if(document.tutorial.tut_place.value==""){
alert("Please Enter Address Of Tutorial");
document.tutorial.tut_place.focus();
return false;
}

if(document.tutorial.tut_sub.value==""){
alert("Which Program's Tutor U R");
document.tutorial.tut_sub.focus();
return false;
}

if(document.tutorial.from_date2.value==""){
alert("Please Choose Starting Date");
document.tutorial.from_date2.focus();
return false;
}

if(document.tutorial.to_date2.value==""){
var ans=confirm("You Left End Date Blank.Is It Your Present Tutorial?");
if(ans){
document.tutorial.to_date2.value=0;
return false;
 }
 else
 {
 alert("Please Choose End Date");
 document.tutorial.to_date2.focus();
 return false;
 }
 
}

// set the end value to blank
 if((document.tutorial.from_date2.value!="") && (document.tutorial.to_date2.value!="") && (document.tutorial.to_date2.value!=0)){
  var Startdt=document.tutorial.from_date2.value;
 var Enddt=document.tutorial.to_date2.value;
 if(checkdate(Startdt,Enddt)==false){
 document.tutorial.to_date2.value="";
 document.tutorial.to_date2.focus();
// return false;
 }

 }
 //end form2
 return true;
}




//Form validation for artist Education Training Institute
function checktraining(){
if(document.traning.tra_name.value==""){
alert("Please Enter Your Training Institutions Name.");
document.traning.tra_name.focus();
return false;
}

if(document.traning.tra_place.value==""){
alert("Please Enter Your Address Of The Training Institutions ");
document.traning.tra_place.focus();
return false;
}

if(document.traning.tra_sub.value==""){
alert("Please Enter Your Subject Of Traning");
document.traning.tra_sub.focus();
return false;
}

if(document.traning.from_date3.value==""){
alert("Please Choose Starting Date");
document.traning.from_date3.focus();
return false;
}

if(document.traning.to_date3.value==""){
var ans=confirm("You Left End Date Blank.Is It Your Present Traning Institute?");
if(ans){
document.traning.to_date3.value=0;
return false;
 }
 else
 {
 alert("Please Choose End Date");
 document.traning.to_date3.focus();
 return false;
 }
 
 }


//end
// set the end value to blank
 if((document.traning.from_date3.value!="") && (document.traning.to_date3.value!="") && (document.traning.to_date3.value!=0)){
 var Startdt=document.traning.from_date3.value;
 var Enddt=document.traning.to_date3.value;
 if(checkdate(Startdt,Enddt)==false){
 document.traning.to_date3.value="";
 document.traning.to_date3.focus();
 return false;
 }
 }
 return true;
 }
 //end form3
 
 
 
 
 
 
//Form validation for artist work experience 
function checkwork(){
if(document.work.workname.value==""){
alert("Please Enter Name Of Work Place:");
document.work.workname.focus();
return false;
}

if(document.work.workplace.value==""){
alert("Please Enter Address Of Your Work Place:");
document.work.workplace.focus();
return false;
}

if(document.work.from_date.value==""){
alert("Please Choose Starting Date");
document.work.from_date.focus();
return false;
}

if(document.work.to_date.value==""){
var ans=confirm("You Left End Date Blank.Is It Your Present Work Place?");
if(ans){
document.work.to_date.value=0;
return false;
 }
 else
 {
 alert("Please Choose End Date");
 document.work.to_date.focus();
 return false;
 }
}
 //end
 
 // set the end value to blank
 if((document.work.from_date.value!="") && (document.work.to_date.value!="") && (document.work.to_date.value!=0)){
var Startdt=document.work.from_date.value;
 var Enddt=document.work.to_date.value;
 if(checkdate(Startdt,Enddt)==false){
 document.work.to_date.value="";
 document.work.to_date.focus();
 return false;
 }
 }
 //end set
 if(document.work.jobname.value==""){
alert("Please Enter Your Job Name");
document.work.jobname.focus();
return false;
}

if(document.work.jobnotes.value==""){
alert("Enter The Details About This Job");
document.work.jobnotes.focus();
return false;
}
return true;
}
//end form4







//Form validation for artist award experience
function checkaward(){
if(document.award.awdname.value==""){
alert("Enter Name Of The Award");
document.award.awdname.focus();
return false;
}
if(document.award.awdplace.value==""){
alert("Enter The Place Of The Award Ceremony:");
document.award.awdplace.focus();
return false;
}
if(document.award.award_dt.value==""){
alert("Enter Date Of Award");
document.award.award_dt.focus();
return false;
}
if(document.award.awdnotes.value==""){
alert("Please Write About Your Award");
document.award.awdnotes.focus();
return false;
}
return true;
}
//end form5


//checking that start date is less tht current date
function checkdate(Startdt,Enddt){
//var stdt=document.work.from_date.value;
//var eddt=document.work.to_date.value;
var nstdt=Startdt.split("/");
var neddt=Enddt.split("/");
var stmm=nstdt[0];
var stdd=nstdt[1];
var styr=nstdt[2];
var edmm=neddt[0];
var eddd=neddt[1];
var edyr=neddt[2];
if(parseInt(styr)==parseInt(edyr)){
   if(parseInt(stmm)==parseInt(edmm)){
         /*if(parseInt(stdd)==parseInt(eddd)){
	        alert("Two Date Cannot Be Same:");
	        return false;
	       }
	    else{//3rd else*/
	    if(parseInt(stdd)>parseInt(eddd)){
		alert("Start Date Cannot Be Greater Than End Date:");
		return false;
		   }
	      //}
   }//3nd if end	
  else{//2nd else
    if(parseInt(stmm)>parseInt(edmm)){
    alert("Start Month Cannot Be Greater Than End Month:");
    return false;
	   }   
	}	   
  }
else{
 if(parseInt(styr)>parseInt(edyr)){
alert("Starting date Cannot Be Greater than End Date");
return false;
   }
}

}//function end

//end checking 
