function check_user_edit()
{
	if(document.edit_account.user_nicename.value=="")
		{
			alert("Please enter name");
			document.edit_account.user_nicename.focus();
			return false;
		}
	if(document.edit_account.user_login.value=="")
		{
			alert("Please enter user id");
			document.edit_account.user_login.focus();
			return false;
		}
	if(document.edit_account.user_email.value=="")
		{
			alert("Please enter email id");
			document.edit_account.user_email.focus();
			return false;
		}
	if(document.edit_account.user_pass.value!="")
		{
			if(document.edit_account.conf_pass.value=="")
			{
				alert("Please enter confirm password");
				document.edit_account.conf_pass.focus();
				return false;
			}
			if(document.edit_account.user_pass.value!=document.edit_account.conf_pass.value)
			{
				alert("Please enter currect confirm password");
				document.edit_account.conf_pass.value="";
				document.edit_account.conf_pass.focus();
				return false;
			}
		}
	
	return true;
}

// change password

function check_user_edit_pass()
{
	
			if(document.edit_account.user_pass.value=="")
			{
				alert("Please enter password");
				document.edit_account.user_pass.focus();
				return false;
			}
			if(document.edit_account.conf_pass.value=="")
			{
				alert("Please enter confirm password");
				document.edit_account.conf_pass.focus();
				return false;
			}
			if(document.edit_account.user_pass.value!=document.edit_account.conf_pass.value)
			{
				alert("Please enter currect confirm password");
				document.edit_account.conf_pass.value="";
				document.edit_account.conf_pass.focus();
				return false;
			}
}

// image validation 

function checkPhotoEdit() {
	
	if(document.getElementById('file_name').value=="")
	{
		alert("Please enter file heading name");
		document.getElementById('file_name').value="";
		document.getElementById('file_name').focus();
		return false;		
	}
	if(document.getElementById('upload').value!="")
	{
		//alert("test");
		var imagePath=document.getElementById('upload').value;
		//alert(imagePath);
	   var pathLength = imagePath.length;
	   var lastDot = imagePath.lastIndexOf(".");
	   var fileType = imagePath.substring(lastDot,pathLength);
	
	   if((fileType == ".doc") || (fileType == ".DOC") || (fileType == ".pdf") || (fileType == ".PDF") || (fileType == ".txt") || (fileType == ".TXT") || (fileType == ".docx") || (fileType == ".DOCX")) {
		   return true;
	   } else {
		   alert("We supports .doc, .docx , .pdf, and .txt file formats. Your file-type is " + fileType + ".");
		   return false;
	   }
	}
}



function checkPhotoMain() {
	
	if(document.getElementById('file_name').value=="")
	{
		alert("Please enter file heading name");
		document.getElementById('file_name').value="";
		document.getElementById('file_name').focus();
		return false;		
	}
	
	if(document.getElementById('upload').value=="")
	{
		alert("Please upload file .");
		document.getElementById('upload').value="";
		document.getElementById('upload').focus();
		return false;		
	}
	
	if(document.getElementById('upload').value!="")
	{
		//alert("test");
		var imagePath=document.getElementById('upload').value;
		//alert(imagePath);
	   var pathLength = imagePath.length;
	   var lastDot = imagePath.lastIndexOf(".");
	   var fileType = imagePath.substring(lastDot,pathLength);
	
	   if((fileType == ".doc") || (fileType == ".DOC") || (fileType == ".pdf") || (fileType == ".PDF") || (fileType == ".txt") || (fileType == ".TXT") || (fileType == ".docx") || (fileType == ".DOCX")) {
		   return true;
	   } else {
		   alert("We supports .doc, .docx , .pdf, and .txt file formats. Your file-type is " + fileType + ".");
		   return false;
	   }
	}
}


function checkAllM(){
	alert("test");
	var arr = new Array();
	//alert(document.send_cv.elements.length);
	for (var i=0;i<document.send_cv.elements.length;i++)
	{
		//alert(i);
		var e=document.send_cv.elements[i];
		alert(e);
		if ((e.name != 'allbox') && (e.type=='checkbox'))
		{
			e.checked=document.send_cv.allbox.checked;
		}
	}
	
	}
	function check(id)
	{	
		var ele=document.send_cv.elements["allbox[]"];
		var chk=0;
		for(var i=0;i<ele.length;i++)
		{
			if(ele[i].checked==true)
			chk=chk+1;
		}
		if(chk==ele.length)document.send_cv.allbox.checked="true";
		else document.send_cv.allbox.checked="";
	
	}
