/* Scripts for Within Reach: Free Stuff Page */

/* random image JavaScript function for free.php */
/* based on script available in "JavaScript for the World Wide Web" by Negrino and Smith, also at http://www.javascriptworld.com/ */

var myPix = new Array("images/security1.gif", "images/security2.gif", "images/security3.gif", "images/security4.gif", "images/security5.gif", "images/security6.gif", "images/security7.gif")

function choosePic() {
	if (document.images) {
		randomNum = Math.floor((Math.random() * 10)) % 7
			document.myPicture.src = myPix[randomNum]
		}
	}
	

/* client-side form validation for free.php */

function Validate() {
	if (document.form_mail.realname.value.length == 0)
	  	{alert("You must enter your name."); return false;}
	else if (document.form_mail.email.value.length == 0)				  	 
		{alert("You must enter your email address."); return false;}
	else if (document.form_mail.sample.value.length == 0)				  	 
		{alert("You must select a sample e-book."); return false;}								
	else return true;
}	
