// JavaScript Document
//for the send to colleague form (recommend site)
function resetAll()
{
	document.frmrecommend.reset();
	document.frmrecommend.sendto.focus();
}

function changeColour(element)
{
	element.style.cursor="hand";
}

function sendmails()
{
if(!gfb_EmailCheck(document.frmrecommend.sendto))
{
  return false; 
}
else if(document.frmrecommend.sendSubject.value=="")
{
alert("Please enter the subject of the mail");
document.frmrecommend.sendSubject.focus();
return false;
}
else if(!validate_FName(document.frmrecommend.sendBody))
{
	return false;	
}
else if(document.frmrecommend.txtname.value=="") 
{
alert("Please enter your name")
document.frmrecommend.txtname.focus();
return false;
}
else if(!gfb_EmailCheck(document.frmrecommend.sendfrom))
{
  return false ;
}
else
	  {
	   //	document.frmrecommend.action="/admin/Email_RecommendSite.asp";
	   document.frmrecommend.action="/Forms/Sendtocolleague/SendtoColleague.aspx?sendmail=No&curSec=";
		document.frmrecommend.submit();
		return true;
	  }
//return false;

}
function validate_FName(ctrlText)
{
    val=ctrlText.value;
    val_Length = val.length;
    if((val != "" ) && (val_Length >=3))
	 {
	    for(i=0;i<val_Length;i++)
		{ 
		  str=val.charCodeAt(i);
		  if((str==62) || (str == 60))
		  {	  
			alert("< and > is not allowed");
			ctrlText.focus();
			return false;
		  }
		  
		}
	  }
	  else
	  {
	     alert("Company Name should be minimum of 3 characters");
	     ctrlText.focus();
	     return false;
	  }	
		return true;

}

//send to colleague ends...