window.onload=function(){
linkEmail();
externalLinks();
}

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";
		if (anchor.getAttribute("href") &&  anchor.getAttribute("rel") == "external") anchor.rel = "nofollow";
	}
}

function linkEmail() {
  if(!document.getElementsByTagName) return;
  var allElts = document.getElementsByTagName("*");
  if(allElts.length == 0 && document.all) 
    allElts = document.all; //hack for IE5
  for(var i=0; i<allElts.length; i++) {
    var elt = allElts[i];
    var className = elt.className || elt.getAttribute("class") 
      || elt.getAttribute("className");
    if(className && className.match(/\bemail\b/)
        && elt.firstChild.nodeType == 3) {
      var addr = elt.firstChild.nodeValue;
      addr = addr.replace(/[ \[\{\(\|\/\\]at[ \]\}\)\|\/\\]/i, "@")
        .replace(/[ \[\{\(\|\/\\](dot|period)[ \]\}\)\|\/\\]/gi, ".");
      var lnk = document.createElement("a");
      lnk.setAttribute("href","mailto:"+addr);
      lnk.appendChild(document.createTextNode(addr));
      elt.replaceChild(lnk, elt.firstChild);
    }
  }
}


var quote=new Array();
  quote[0]='<p class="testimonial-body">Wow! You are so efficient! Thanks soooooo much - we received the photos today - absolutely fantastic...over the moon....love them</p><p class="testimonial-names">Ian &amp; Sue</p>';
  quote[1]='<p class="testimonial-body">We received the photos last week. My god they are just breathtaking. You even somehow managed to make me look half decent. You went far and beyond being just our photographer for our wedding day. I am glad we also had you there for moral support.</p><p class="testimonial-names">Mark &amp; Jodie</p>';
  quote[2]='<p class="testimonial-body">We have viewed the images on your website - they are beautiful! Thank you very much for your services on the day. We thought you were great.</p><p class="testimonial-names">Sally &amp; Pieter</p>';
  quote[3]='<p class="testimonial-body">Your energy and enthusiasm really put Dave and I at ease and made our afternoon run smoothly. You really captured the essence of the day for us.</p><p class="testimonial-names">Kim &amp; Dave</p>';

var speed=8000;
var q=0;

function showQuote() {

	document.getElementById("quotes").innerHTML=quote[q];
	q++;
	if(q==quote.length) {
		q=0;
  }
}

