// JavaScript Document
//dept_name,e_name,dob,e_id,mob,add,resume,bg,mob1.mob2,remak,of_add,co_add,

function fom_validate()
{		
	if(document.getElementById('sli_img').value!='')
	{
		var sli_phto=document.getElementById('sli_img').value; 			
		/*var b = document.getElementById('sli_img');
		var f = -1;		
		var oas;
		var filesize = b.files[0].size; // b.files[0].Size;
		var size1=filesize / (1024 * 1024);
		//alert(size1 + " MB");
		if (size1 > 1.0) 
		{
			alert('Please check the Employee Resume size[File Size Minimum 1MB]');
			return false;
			// return true;
		}*/
		var ext = sli_phto.substring(sli_phto.lastIndexOf('.') + 1);
		//alert(ext);
		if(ext!="jpg" && ext !="JPG" && ext!="jpeg" && ext!="JPEG" && ext !="png" && ext!="PNG" && ext !="gif" && ext!="GIF" && ext !="bmp" && ext!="BMP")
		{
			alert('Browse only .jpg, .jpeg, .png, .gif, .bmp file for Slider Image');    
			document.getElementById('sli_img').focus();  
			return false;
		}
		
	}
	else
	{
		alert('Please Choose the Slider Image...');    
		document.getElementById('sli_img').focus();  
		return false;
	}
	
	var letters_img = /^[\s]+$/; 
	if(document.getElementById('img_tit').value=='')
	{
		alert('Please Enter the Image Title');  
		document.getElementById('img_tit').focus();  
		return false;
	}
	else
	{
		var addr = document.getElementById('img_tit').value;
		var len = addr.length;
		if(letters_img.test(document.getElementById('img_tit').value)==true)  
		{
			alert("Image Title Can't Start with Spaces");  
			document.getElementById('img_tit').focus();  
			return false;  
		}
		
	}
	
	var letters_add2 = /^[\s]+$/; 
	/*if(document.getElementById('desc').value=='')
	{
		alert('Please Enter the Description');  
		document.getElementById('desc').focus();  
		return false;
	}
	else*/ 
	if(document.getElementById('desc').value!='')
	{
		var addr = document.getElementById('desc').value;
		var len = addr.length;
		if(letters_add2.test(document.getElementById('desc').value)==true)  
		{
			alert("Description Can't Start with Spaces");  
			document.getElementById('desc').focus();  
			return false;  
		}
		/*else if(len < 10)
		{
			alert('Description Should be Greater than 10 Letters');  
			document.getElementById('desc').focus();  
			return false;
		}*/
	}
	
	var where_to= confirm("Do you really want to Submit the Data?");
	if (where_to== true)
	{
		document.img.submit();
	}
	else
	{
		return false;	
	}
}

function form_rest() //this is for reset the forms
{
	var where_to= confirm("Do you really want to Reset the Data?");
	if (where_to== true)
	{
		window.location.reload();
	}
	else
	{
	 	return false;	
	}
}

function foc(ids)
{
	//alert(ids+"_div");
	document.getElementById(ids).style.border="2px solid #0099FF";	
}

function stnon(ids)
{
	//alert(ids+"_div");
	document.getElementById(ids).style.border="thin solid #EEFFFF";
}