function nw (link)

{
				 
	//alert(link)
	window.open(link.href);
 	return false;
}


function focusOnField(field)
{
//alert(field)
document.forms[0][field].focus()
}







function verifyContact(enquiry)
{

  if(enquiry.contactName.value == "")
  {
    alert("Please enter your name.");
    enquiry.contactName.focus();
	//enquiry.bill_name.bgcolor == #FFFFFF
	enquiry.contactName.select();
    return (false);
  }
  
  if(enquiry.contactPhone.value == "")
  {
    alert("Please enter a contact telephone number.");
    enquiry.contactPhone.focus();
	enquiry.contactPhone.select();
    return (false);
  } 
 
 
   if(enquiry.contactEmail.value == "")
  {
    alert("Please enter a valid E-mail address where we can contact you.");
    enquiry.contactEmail.focus();
	enquiry.contactEmail.select()
    return (false);
  }
  	

return (true);

}


function prepareGallery()	{

	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	   
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("thumbnails")) return false;

	
	/* get the reference to the thumbnails object and then create an array 
	   of all the <a> tags found in the array. To each tag assign a function to
	   the onclick method - which calls the showPic function. */
	   
	var gallery = document.getElementById("thumbnails");
	var links = gallery.getElementsByTagName("a");
	
	for(i = 0; i < links.length; i++) {
		
		links[i].onclick = function() {
			
			//alert(this)

			return showPic(this);
	/* If the showPic function returns true then the normal link will be followed,
	   if it returns false the normal link will be cancelled and the img src is the only
	    element on the page to be updated */
		}
		
	}
	
	
}


function showPic(whichPic)  {
	
	/* If we don't find an image with the unique id then exit the function */
	if(!document.getElementById("displayImage")) return true;	
	
	/* get the name attribute which contains the actual image filename we want to display,
	   and then get the reference to the actual image object itself */
	   
	var source = whichPic.getAttribute("name");
	var displayImage = document.getElementById("displayImage")
	
	/* finally go get the new image and change the src attribute, returning false to prevent the
	   normal link from being executed */
	displayImage.setAttribute("src", "dynamic/images/" + source);
	
	return false;
	
}


