function loginform()
{
	obj=document.forms[0];
	if(obj.adm_loginid.value=="")
	{
		alert("Please Enter Login Id")
		obj.adm_loginid.focus();
		return false;
	}
	if(obj.adm_password.value=="")
	{
		alert("Please Enter Password")
		obj.adm_password.focus();
		return false;
	}
    
}
///// validation for forgot password form
function validforgot()
{
	obj= document.forms[0];
    obj.forgotemail.value = trim(obj.forgotemail.value)
	if(obj.forgotemail.value == "")
	{
		alert ("Please enter your Email ID");
		obj.forgotemail.focus();
		return false;
	}


	obj= document.forms[0];
    obj.forgotdob.value = trim(obj.forgotdob.value)
	if(obj.forgotdob.value == "")
	{
		alert ("Please enter your Date of Birth");
		obj.forgotdob.focus();
		return false;
	}
return true;
}



//---------------------emppost validation---------------------------------//
function submitpostForm()
{

obj= document.postForm;
    obj.emp_loginid.value = trim(obj.emp_loginid.value)
	if(obj.emp_loginid.value == "")
	{
		alert ("Please enter your  ID");
		obj.emp_loginid.focus();
		return false;
	}



	obj1= document.postForm;
	
	if(obj1.emp_pass.value=="")
	{
		alert("Password can not be blank. Please enter it.")
		obj1.emp_pass.focus();
		return false;
	}

	obj2= document.postForm;
	if(obj2.confirmpassword.value=="")
	{
		alert("Re Type Password can not be blank. Please enter it.")
		obj2.confirmpassword.focus();
		return false;
	}


	if(obj1.emp_pass.value!=obj2.confirmpassword.value)
   {
		
    alert("User Password and User Re Type Password are not matching Please Enter Correctly.");
    
    return false;
  }

return true;

}














//add Package validation

function OpenLargeImage(reg_id)
{
	//window.open("details.php?reg_id="+reg_id+","",scrollbars, width=502, height=460, status,toolbar=Off,menubar")
	window.open ("details.php?reg_id="+reg_id,"","scrollbars, width=600, height=560, rightmargin=350, status=0,toolbar=Off,menubar'");
	return;
}


//free details page popup//
function OpenLargeImagefree(reg_id)
{
	
	//window.open("details.php?reg_id="+reg_id+","",scrollbars, width=502, height=460, status,toolbar=Off,menubar")
	window.open ("freedetails.php?reg_id="+reg_id,"","scrollbars, width=600, height=470,rightmargin=350, status=0,toolbar=Off,menubar'");
	return;
}


function OpenLargeImage3(reg_id)
{

	//window.open("details.php?reg_id="+reg_id+","",scrollbars, width=502, height=460, status,toolbar=Off,menubar")
	window.open ("details1.php?reg_id="+reg_id,"","scrollbars, width=100, height=1000, status,toolbar=Off,menubar'");
	return;
}

 //_-------------valid email-id----------//
function isValidEmailId(obj, name)
{
   obj.value=trim(obj.value);
   if (obj.value=='')
   {
	   alert('"'  + name + '" can not be blank. Please enter it.' );
	   obj.focus();
	   return false;
   }
   
   if (! isValidEmail(obj.value))
   {
      alert("Invalid e-Mail-Id entered.");
	  obj.focus();
	  return false;
   }
   return true;
}

function isValidEmail(elm)
{
 if(elm.indexOf('@',1) ==-1)
 	return (false);
 
 if(elm.indexOf('.',1) ==-1)
 	return (false);
 
 return true;
}

function trim(p_str)
{
   var i=0;
   while(1)
   {
     if ( p_str.charAt(0)==" " || p_str.charAt(0)=="\n" || p_str.charAt(0)=="\r") 
       p_str = p_str.substr(i+1);
     else
       break;
    } 
   
   while(1)
   {
     i=p_str.length;
     if ( p_str.charAt(i-1)==" " || p_str.charAt(i-1)=="\n" || p_str.charAt(i-1)=="\r") 
       p_str=p_str.substr(0,i-1);
     else
       break;
   }
  return p_str; 
}


//*************validation for Registration form ********************//
function validresume()
{	
		obj= document.myform;
		obj.fname.value= trim(obj.fname.value);
		if(obj.fname.value=="")
		{
		alert(" Name can not be blank. Please enter it.")
		obj.fname.focus();
		return false;
		}
		obj= document.myform;
		obj.lname.value= trim(obj.lname.value);
		if(obj.lname.value=="")
		{
		alert("Last Name can not be blank. Please enter it.")
		obj.lname.focus();
		return false;
		}
		obj= document.myform;
		if(obj.birth_date.value=="-1" || obj.birth_month.value=="-1" ||obj.birth_year.value=="-1")
		{
		alert("Date Of Birth can not be blank. Please enter it.")
			if(obj.birth_date.value=="-1")
			{
				obj.birth_date.focus();
			return false;
			}
			if(obj.birth_month.value=="-1")
			{
				obj.birth_month.focus();
			return false;
			}
			if(obj.birth_year.value=="-1")
			{
				obj.birth_year.focus();
			return false;
			}
		
		}
		

		
		obj7=document.myform.email;
			if(!isValidEmailId(obj7, "Email"))
			{
					return false;
			}

		/*obj= document.myform;
		if(obj.cmbdegree.value=="-1")
		{
		alert("Highest Qualification can not be blank. Please enter it.")
		obj.cmbdegree.focus();
		return false;
		}
		*/

		obj= document.myform;
		if(obj.image1.value=="")
		{
		alert(" Please Upload updated Resume")
		obj.image1.focus();
		return false;
		}
		
		
		
	return true;
	
	}

	function validenquiry()
	{
		obj= document.myform;
		obj.name.value= trim(obj.name.value);
		if(obj.name.value=="")
		{
		alert(" Name can not be blank. Please enter it.")
		obj.name.focus();
		return false;
		}

		

		obj= document.myform;
		obj.company.value= trim(obj.company.value);
		if(obj.company.value=="")
		{
		alert("company  Name can not be blank. Please enter it.")
		obj.company.focus();
		return false;
		}

		obj= document.myform;
		if(obj.cmbcountry.value=="-1")
		{
		alert("Country can not be blank. Please enter it.")
		obj.cmbcountry.focus();
		return false;
		}
		
		
		obj7=document.myform.email;
			if(!isValidEmailId(obj7, "Email"))
			{
					return false;
			}
			

		obj=document.myform;
		if(obj.enquiry.value=="")
		{
		
		alert("Enquiry can not be blank. Please enter it.")
		obj.enquiry.focus();
		return false;
		}
	
		return true;
	
	}

function SmallWin(id)
{
  window.open("newsdetails.php?NID="+id,"","resizable=no,width=450,height=350,scrollbars=yes,status=no,top=75,screenY=255,left=200,screenX=350");
}


function statefromcnt()
{
	obj= document.forms[0];
	obj.action="customerservice.php?act=search&cmbcountry="+obj.cmbcountry.value
	obj.submit();
	return true;

}

function sendmail()
{

	obj=document.myform;
	if(obj.txtname.value=="")
	{
		
		alert("Name can not be blank. Please enter it.")
		obj.txtname.focus();
		return false;
	}



	obj1=document.myform.txtemail;
	if(!isValidEmailId(obj1, "Email"))
	{
					return false;
	}

	obj=document.myform;
	if(obj.txtfriendname.value=="")
	{
		
		alert("Name can not be blank. Please enter it.")
		obj.txtfriendname.focus();
		return false;
	}

	obj2=document.myform.txtfriendemail;
	if(!isValidEmailId(obj2, " Friend's Email Id"))
	{
			return false;
	}
	
		return true;
}


function SmallWin5(id)
{
  window.open("sendmail.php?JID="+id,"","resizable=no,width=370,height=220,scrollbars=Yes,status=no,top=75,screenY=255,left=200,screenX=350");
}


function validclientform()
	{
		obj= document.myform;
		obj.name.value= trim(obj.name.value);
		if(obj.name.value=="")
		{
		alert(" Name can not be blank. Please enter it.")
		obj.name.focus();
		return false;
		}

		obj= document.myform;
		obj.company.value= trim(obj.company.value);
		if(obj.company.value=="")
		{
		alert("company  Name can not be blank. Please enter it.")
		obj.company.focus();
		return false;
		}

		obj= document.myform;
		if(obj.cmbcountry.value=="-1")
		{
		alert("Country can not be blank. Please enter it.")
		obj.cmbcountry.focus();
		return false;
		}
		
		
		obj7=document.myform.email;
			if(!isValidEmailId(obj7, "Email"))
			{
					return false;
			}
			

		
	
		return true;
	
	}

function validorlappconsul()
{
	
	var selectedid=-1;
	obj=document.myform.client;
	var flag=false;

	if(obj.length>1)
	{

		for(i=0; i<obj.length; i++)
		{
			if(obj[i].checked)
			{

				selectedid=selectedid+","+obj[i].value;
				flag=true;
			}

		}
	
	}
	else
	{
		if(obj.checked)
		{
			flag=true;
			selectedid=selectedid+","+obj.value;
		}
	}

	if(flag==false)
	{
		alert("Please select at least one consultent");
		return false;
	}
	obj=document.myform;
	//obj.cns_id.value=selectedid;
}


