function nw (link)

{
				 
	//alert(link)
	window.open(link.href);
 	return false;
}


function focusOnLogin(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;
	
}



function linkToNewWindow()	{

	/* 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("externalLinks")) return false;
	
	
	
	/* get the reference to the externalLinks object and then create an array 
	   of all the <a> tags found in the array. To each href link we find we will
	   set the target attribute to _blank to force the link to open in a new browser window */
	
	
	var links = document.getElementById("externalLinks").getElementsByTagName("a"); 
						
	if (links.length > 0) {
	
			for(i = 0; i < links.length; i++) {
		
										
						links[i].setAttribute("target", "_blank");
						

						/* extract only the main website address - we don't want to display all the variables in the title tip */
						var titleString = links[i].getAttribute('href').substring(links[i].getAttribute('href').indexOf("www"),links[i].getAttribute('href').length)
						
						/* titleString = titleString.substring(0,titleString.indexOf("www")) */
						
						links[i].setAttribute("title", " link to website " + titleString);
						
									
																									
			}
			
	}	   
	
}