<!-- hide script from old browsers

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
function showPic(whichpic){
	var source = whichpic.getAttribute("href");
	var placeholder = document.getElementById("main-image");
	placeholder.setAttribute('src',source);
}

function prepareLinks(){
	var links = document.getElementsByTagName("a");
	for (var i=0; i<links.length; i++){
		//alert ('Classname'+links[i].getAttribute("class"));
		if (links[i].getAttribute("class") == "prop-thumb") {
			links[i].onmouseover = function() {
			showPic(this);
			return false;
			}
			links[i].onclick = function() {
			showPic(this);
			return false;
			}
		}
	}
}

function exists(elm){
	  if(elm.value == "" ||
	     elm.value == null)
	  return false;
	  else return true;
}

function iniServices() {
	var dds = document.getElementsByTagName("div");
	for (var i=0; i<dds.length; i++) {
		var dd = dds[i];
		if (dd.getAttribute("class") == "testimonialFocus")
			dd.setAttribute("class","testimonial");
	}
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("class") == "dd-close"){
			anchor.onclick = function(){
				hidediv(this.getAttribute("href"));
			}
		}
		if (anchor.getAttribute("class") == "testimonialLinkFocus") anchor.onclick= function(){
				showdiv(this.getAttribute("href"));
			}
	}
}

function hidediv(BoxId){
	var BoxId;
	var mySplitResult = BoxId.split("#");
	if (ShowLayer = document.getElementById('div-'+mySplitResult[1])) ShowLayer.setAttribute("class","testimonial");
	if (ShowLayerLink = document.getElementById('link-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","testimonialLinkFocus");
	if (ShowLayerLink = document.getElementById('wrap-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","testimonialLinkFocus");
}
function showdiv(BoxId){
	var BoxId;
	var mySplitResult = BoxId.split("#");
	if (ShowLayer = document.getElementById('div-'+mySplitResult[1])) ShowLayer.setAttribute("class","testimonialFocus");
	if (ShowLayerLink = document.getElementById('link-'+mySplitResult[1])) ShowLayerLink.setAttribute("class","testimonialLink");
	if (ShowLayerWrap = document.getElementById('wrap-'+mySplitResult[1])) ShowLayerWrap.setAttribute("class","testimonialLink");
}
function checkForm(form) {
	if(exists(form.firstname)==false) {
		alert("Please fill in First Name.");
		form.first-name.focus();
		return false;
	}
	if(exists(form.surname)==false) {
		alert("Please fill in Surname.");
		form.surname.focus();
		return false;
	}
	if(exists(form.telephone)==false) {
		alert("Please fill in Telephone.");
		form.telephone.focus();
		return false;
	}
	if(exists(form.email)==false) {
		alert("Please fill in Email.");
		form.email.focus();
		return false;
	}
	if(exists(form.message)==false) {
		alert("Please fill in Message.");
		form.message.focus();
		return false;
	}
	return true;
}
window.onload = function() {
	if (!document.getElementsByTagName || !document.getElementById) return false;
	if (myinput = document.getElementById('email_newsletter')){;
		myinput.onfocus = function() {
			if(this.value=="Enter email address") this.value="";
		}
		myinput.onblur = function() {
			if(this.value=="")this.value="Enter email address";
		}
	}
	if (myinput = document.getElementById('name_newsletter')){;
		myinput.onfocus = function() {
			if(this.value=="Full name") this.value="";
		}
		myinput.onblur = function() {
			if(this.value=="")this.value="Full name";
		}
	}
	prepareLinks();
	externalLinks();
	iniServices();
	if (form = document.getElementById('contactform')){
		form.onsubmit = function(){
			return checkForm(this);
		}
	}
}

// end hiding script from old browsers -->
