function check1()
{
		day1=document.frm.day[document.frm.day.selectedIndex].value;
		day=day1;
		mon=document.frm.month[document.frm.month.selectedIndex].value;
		yea=document.frm.year[document.frm.year.selectedIndex].value;
		
		if(parseInt("0"+yea,10)<2000 || parseInt("0"+yea,10)>2015)
		  {
		     alert("Please enter The Valid Year");
		     document.frm.year.focus();
		     return(true);
		  }
		else if(mon=='02')
		  {
	             if(parseInt(yea,10)%4==0)
		       
		       day=29;
		     
		     else
           	       day=28;
		  }
		
		else if(mon=='04' || mon=='06' || mon=='09' || mon== '11')
			day=30;
		     else
		        day=31;
		
		if(day1>day)
		 {
		    alert("Please Enter Valid Date");
		    document.frm.day.focus();
		    return(true);
		 }
			
		else
		if(document.frm.tit.value=="")
		{
			alert("Enter the News Title ")
			document.frm.tit.focus();
			return(false);
		}

	else if(document.frm.s_des.value=="")
           {
		alert(" Enter Short Description ")
		document.frm.s_des.focus();
		return(false);
	   }
	else  if(document.frm.des.value=="")
	   {
		alert("Please Enter Description")
		document.frm.des.focus();
		return(false);
	   }
      
         else
		document.frm.submit();

	  }
	  
	function check2()
{
		
	
	if (document.frm.name1.value=="")
	{
		alert("Kindly Enter Your Name")
		document.frm.name1.focus();
		return(false);
	}


	else  if(document.frm.place.value=="")
	   {
		alert("Kindly Enter your Place")
		document.frm.place.focus();
		return(false);
	   }
     
	else if(document.frm.email.value=="")
          {
		alert("Kindly enter the email address")
		document.frm.email.focus();
		return(false);
	  }
	  
	 else if(document.frm.title1.value=="")
          {
		alert("Kindly Enter the title")
		document.frm.title1.focus();
		return(false);
	  } 
	  
	   else if(document.frm.feedback.value=="")
	            {
	  		alert(" Kindly Enter Your Feedback")
	  		document.frm.feedback.focus();
	  		return(false);
	  } 
              //  document.frm.mode.value="insert";
		document.frm.submit();

	  }  
	  
	  
	  
	  
	  
	  function check3()
	  {
	   //alert("praise the Lord");
	   document.frm.mode.value="add";
	   document.frm.submit();
	  		
	   }
	  
	  
	
	  
	  function delcheck1()
	  {
	  
	  flag=false;
	  i=1;
	 val=document.frmdel.elements.length;
	  while(i<=(val-1))
	  {
		  if (document.frmdel.elements[i-1].checked==true)	  flag=true;
		  i=i+1;
	  }
	  if (flag==false)
		  alert("select atleast one Title for Deletion");
	  else
	  	  document.frmdel.submit();

	  }
	  
	  
	  //function photo()
	 // {
	 // ph=document.frm.file1.value;
	 // alert("praise the lord");
	 // return(true);
	//}
	  
	    
 function show(photo)
 	{
 	if(document.frm.file1.value=="") 
 		{if(photo!="")
 			photo="<img src='../newsimage/"+photo+"'  hspace=15 vspace=5 boder=0 align=right>";}
 	else
 	{photo="<img src='"+document.frm.file1.value+"'  hspace=15 vspace=5 boder=0 align=right>";}
 	day1=document.frm.day[document.frm.day.selectedIndex].value;
	day=day1;
	mon=document.frm.month[document.frm.month.selectedIndex].value;
	yea=document.frm.year[document.frm.year.selectedIndex].value;
	date=day+"/"+mon+"/"+yea;
	if(parseInt("0"+yea,10)<2000 || parseInt("0"+yea,10)>2015)
	  {
	     alert("Please enter The Valid Year");
	     document.frm.year.focus();
	     return(true);
	  }
	else if(mon=='02')
	  {
             if(parseInt(yea,10)%4==0)
	       
	       day=29;
	     
	     else
       	       day=28;
	  }
	
	else if(mon=='04' || mon=='06' || mon=='09' || mon== '11')
		day=30;
	     else
	        day=31;
	
	if(day1>day)
	 {
	    alert("Please Enter Valid Date");
	    document.frm.day.focus();
	    return(true);
	 }
		
	else
	if(document.frm.tit.value=="")
	{
		alert("Enter the News Title ")
		document.frm.tit.focus();
		return(false);
	}

		  	else if(document.frm.s_des.value=="")
             {
  		alert(" Enter Short Description ")
  		document.frm.s_des.focus();
  		return(false);
  	   }
  	else  if(document.frm.des.value=="")
  	   {
  		alert("Please Enter Description")
  		document.frm.des.focus();
  		return(false);
  	   }
         
  else
  {

var mystring=new String(document.frm.des.value);
	  var mybars='directories=no,location=no,menubar=no,status=no';
  	  mybars +='titlebar=no,toolbar=no';
  	  var myOptions='scrollbars=yes,width=600,height=400,resizeable=no';
  	  var myFeatures=mybars+','+myOptions;
	  var newwin=open('','myDoc',myFeatures);
	  
	des=mystring.replace("  ","&nbsp; ");
	while(des.indexOf("  ")>0)
	des=des.replace("  ","&nbsp; ");

	while(des.indexOf("\n")>0)
	des=des.replace("\n","<br>");


	newwin.document.writeln("<html><head><title></title> <body topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 bgcolor=C5CCC5>");
	newwin.document.writeln("\n<style type=text/css>");
	newwin.document.writeln("\n.subdes{color:#000088;font-family:Verdana;font-size:10pt;font-weight:normal;text-align:justify;line-height:15pt}");
	newwin.document.writeln("\n.desc{color:#000000;font-family: Verdana;font-size:10pt;font-weight:normal;}");
	newwin.document.writeln("\n.subdes1{color:#000088;font-family:Arial;font-size:10pt;font-weight:normal;text-align:justify;line-height:15pt}");
	newwin.document.writeln("\n.author{color:#008080;font-family:Verdana;font-size:10pt;font-weight:normal;line-height:15pt}");
	newwin.document.writeln("\n.tit{color:#990000;font-family:Verdana;font-size:10pt;font-weight:bold;}");
	newwin.document.writeln("\n</style>");
	newwin.document.writeln("\n<center><table cellpadding=1 cellspacing=3 border=0 width=550 >");
       
       newwin.document.writeln("<tr><td align=center ><b class=tit>"+ document.frm.tit.value +"</b><br><hr size=1 color=000000></td></tr>");
       newwin.document.writeln("<tr><td><b class=subdes1><font color=990000>"+date+"</font></b>  <b class=subdes>- "+document.frm.s_des.value +"</b></td></tr>");
       newwin.document.writeln("<tr><td><span class=desc>"+photo+ " &nbsp; &nbsp; &nbsp; "+ des +"</span><br><div align=right><span class=subdes>Author :</span><span class=Author>"+document.frm.nam.value+"</span><br><span class=subdes>  </span><span class=Author>"+document.frm.ref.value+"</span></div></td></tr>");
       newwin.document.writeln("</table><hr size=1 color=000000>");
       newwin.document.writeln("<a href='javascript:window.close();'><h2>Close</h2></a></center>");
      
       }
}





