// Piers Caswell - Digital-zest.com

// THIS must be updated to an accurate path for the Greybox popup to work correctly
var GB_ROOT_DIR = "./_greybox/";

function popUpWindow (URL,width,height,wname,toScroll) { 
	if (toScroll == "") {
		toScroll = "no"
	}
	window.open(URL,wname,'width='+width+',height='+height+',location=no,toolbar=no,status=no,scrollbars='+toScroll+',resizable=no'); 
}
function showAndHideDiv(element) {
	if (document.getElementById(element).getAttribute('attr')!="show") {
		document.getElementById(element).style.display = "block";
		document.getElementById(element).setAttribute('attr','show');
	} else {
		document.getElementById(element).style.display = "none";
		document.getElementById(element).setAttribute('attr','hide');
	}
}
function swapImage(imgToSwap,imgPlacholder)  {
   document[imgPlacholder].src=imgToSwap;

   document.getElementById([imgPlacholder+"Link"]).href = imgToSwap;
   //alert('imgPlacholder= '+document.getElementById([imgPlacholder+"Link"]).href);
}
function writeOutImage(imgToWrite)  {
	alert('writeOutImage= '+imgToWrite);
	document.write(document['mainImage'].src);
}

// Google analytics tracking code

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17413150-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();




