// JavaScript For Restoration Christian Church Site

//pre-load the images for the site

Image1= new Image()
Image1.src = "images/banner2.jpg"

Image2 = new Image()
Image2.src = "images/zionleaders.gif"

Image3 = new Image()
Image3.src = "images/series.jpg"

Image4 = new Image()
Image4.src = "images/churchoftheweek.jpg"

Image5 = new Image()
Image5.src = "images/sundayschool.jpg"

Image6 = new Image()
Image6.src = "../images/about_rd.gif"

Image7 = new Image()
Image7.src = "../images/about_bb.gif"

//form validation for the contact form

function formvalidate1()
	{
	
		var name = document.Form.name.value;
		var email = document.Form.email.value;
		var comments = document.Form.comments.value;
	
		if(name == "")
			{
				alert("You must enter a name");
				document.Form.name.focus();
				return false;
			}
			
		if(email == "")
			{
				alert("You must enter an e-mail");
				document.Form.email.focus();
				return false;
			}
			
		if(comments == "")
			{
				alert("You must enter comments");
				document.Form.comments.focus();
				return false;
			}
			
	}
	
	//form validation for the media form
	
	function formvalidate2()
	{
	
		var name = document.mediaForm.name.value;
		var email = document.mediaForm.email.value;
		var comments = document.mediaForm.comments.value;
	
		if(name == "")
			{
				alert("You must enter a name");
				document.mediaForm.name.focus();
				return false;
			}
			
		if(email == "")
			{
				alert("You must enter an e-mail");
				document.mediaForm.email.focus();
				return false;
			}
			
		if(comments == "")
			{
				alert("You must enter comments");
				document.mediaForm.comments.focus();
				return false;
			}
			
	}

function hideIt(object) {
   object.style.visibility="hidden";
}

function showIt(object) {
   object.style.visibility="visible";
}
	
	