/* Copyright Digital:Idiom c 1999 - 2008 - Contact designer @ digitalidiom.co.uk */
/* www.digitalidiom.co.uk for professional web design to W3C standards */
/* NO copy or use of original material by Digital:Idiom without permission */

/* BROWSER CHECKS */
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ie6 = (document.all && document.getElementById && navigator.userAgent.indexOf("6") > 0);
var ns6 = (!document.all && document.getElementById);


/* ====================================================== */
/* MENU HIGHLIGHTER Changes appearance of selected menu   */
/* item to indicate which page is being viewed */

function chgNavBar(id){
	// Netscape 4
	if(ns4){
		document.layers[id].color ="#999";
	}
	// Explorer 4
	else if(ie4){
		document.all[id].style.color ="#999";
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		document.getElementById(id).style.color ="#999";
	}
}

/* ====================================================== */
/* Dynamically Write Email so spam spiders do not        */
/*  pick up email or address details */
function writeDIEmail(who)
{
	document.write("<a href='mailto:"+who+"&#064;digitalidiom.co.&#117;&#107;'>");
	document.write(who);
	document.write("&#064;");
	document.write("digitalidiom");
	document.write(".co .&#117;&#107;");
	document.write("</a>");
}



/* =======================POPUP WINDOW=============================== */
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}



/* ================= BACKGROUND IMAGE CHANGER ======================== */

//Based on Background Image Slideshow- © Dynamic Drive (www.dynamicdrive.com)

//Specify an array of background images
var bgslides=new Array();
bgslides[0]="images/bg-masthead10.jpg";
bgslides[1]="images/bg-masthead1.jpg";
bgslides[2]="images/bg-masthead2.jpg";
bgslides[3]="images/bg-masthead3.jpg";
bgslides[4]="images/bg-masthead4.jpg";
bgslides[5]="images/bg-masthead5.jpg";
bgslides[6]="images/bg-masthead6.jpg";
bgslides[7]="images/bg-masthead7.jpg";
bgslides[8]="images/bg-masthead8.jpg";
bgslides[9]="images/bg-masthead9.jpg";

//Specify interval between slide (in milliseconds)
var speed=15000;
var inc=-1;

function slideback(){
	if (inc<bgslides.length-1)
	{
	inc++ ;
	}
	else
	{
	inc=0;
	}
	document.getElementById("masthead").style.backgroundImage = "url('" + bgslides[inc] + "')";
}


/* RANDOM NUMBER */
function getRandomImage()
{
var randomnumber=Math.floor(Math.random()* bgslides.length);
//alert ('The random number is ' + randomnumber);
document.getElementById("masthead").style.backgroundImage = "url('" + bgslides[randomnumber] + "')";
}

if (document.getElementById)
{
//alert('alert');
//window.onload=new Function('setInterval("slideback()",speed)');
//window.onload=new Function('setInterval("getRandomImage()",speed)');
}

/* ====================================================== */
/* Form field ##########        */
function fh()
{
document.write('<input type="hidden" id="hdPop" name="hdPop" value="YFeeRTu" />');
}