function showService(jsAction,id,img){

	cid = id+"child";

	if(!document.getElementById(cid))
	{
		var lipar = document.getElementById(id);
		var lichd   = document.createElement("li");
		lipar.appendChild(lichd);
		lichd.setAttribute("id", cid);
	}
	
	liParent = document.getElementById(id).parentNode.childNodes[0];
	
	if(bName == "Explorer" && bVer == "6")
	{
		if(jsAction == 1)
		{
			liParent.className = "current";

			document.getElementById(cid).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='gfx/ic-"+img+".png',sizingMethod='scale')";
			
			document.getElementById(id).style.display = "block";
		}
		else if(jsAction == 0)
		{
			document.getElementById(cid).style.filter = "";
			document.getElementById(id).style.display = "none";

			liParent.className = "";
		}
	}
	else
	{
		if(jsAction == 1)
		{
			liParent.className = "current";

			document.getElementById(cid).style.background = 'url(gfx/ic-'+img+'.png) no-repeat left top';
			document.getElementById(id).style.display = "block";
		}
		else if(jsAction == 0)
		{
			document.getElementById(cid).style.background = '';
			document.getElementById(id).style.display = "none";

			liParent.className = "";
		}
	}
}

function opacityin(id, opacStart, opacEnd, millisec) { 
//speed for each frame 
var speed = Math.round(millisec / 100); 
var timer = 10; 

//determine the direction for the blending, if start and end are the same nothing happens 
if(opacStart > opacEnd) { 
 for(i = opacStart; i >= opacEnd; i--) { 
     setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed)); 
     timer++; 
 } 
} else if(opacStart < opacEnd) { 
 for(i = opacStart; i <= opacEnd; i++) 
 { 
     setTimeout("changeOpacin(" + i + ",'" + id + "')",(timer * speed)); 
     timer++; 
 } 
} 
} 

//change the opacity for different browsers 
function changeOpacin(opacity, id) { 
var object = document.getElementById(id).style; 
	object.filter = "alpha(opacity=" + opacity + ")"; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
}

function headPhoto(i,tsw){

	if(tsw == 1)
	{
		headPhotoChg(i);
	}
	else if(tsw == 2)
	{
		myTimec = setTimeout("headPhotoTrs("+i+")",500);
	}
	else if(tsw == 3)
	{
		headPhotoChg(i);
		myTimec = setTimeout("headPhotoTrs("+i+")",500);
	}
}

headphotos = new Array();
headphotos[0] = 'gfx/contracting.jpg';
headphotos[1] = 'gfx/plant-hire.jpg';
headphotos[2] = 'gfx/hire-haulage.jpg';
headphotos[3] = 'gfx/ready-mix-concrete.jpg';
headphotos[4] = 'gfx/recycling.jpg';
headphotos[5] = 'gfx/jcb-contracting-j-whittaker-school.jpg';
	
function headPhotoChg(i){

	if(document.getElementById("header"))
	{
		document.getElementById("header").style.backgroundImage = 'url('+headphotos[i]+')';

		i=i+1;
		if(i>=headphotos.length){i=0;}

		myTime = setTimeout("headPhoto("+i+",1)",5500);
	}
}

function headPhotoTrs(i){
	
	if(document.getElementById("hdphoto"))
	{
		document.getElementById("hdphoto").style.backgroundImage = 'url('+headphotos[i]+')';
		opacityin('hdphoto', 0, 100, 500);

		i=i+1;
		if(i>=headphotos.length){i=0;}

		myTimePhoto = setTimeout("opacityin('hdphoto', 100, 0, 500)",4900);
		myTimes = setTimeout("headPhoto("+i+",2)",5000);
	}
}


function contentPreloader(){

imga = new Image(24,15);
imga.src = "/gfx/mif-on.gif";
imgb = new Image(102,35);
imgb.src = "/gfx/top-menu-on.png";
imgc = new Image(347,179);
imgc.src = "/gfx/service-icon-bg.png";

imgd = new Image(1000,233);
imgd.src = "/gfx/contracting.jpg";
imge = new Image(1000,233);
imge.src = "/gfx/hire-haulage.jpg";
imgf = new Image(1000,233);
imgf.src = "/gfx/plant-hire.jpg";
imgg = new Image(1000,233);
imgg.src = "/gfx/ready-mix-concrete.jpg";
imgh = new Image(1000,233);
imgh.src = "/gfx/recycling.jpg";

	if(screen.availWidth < "1024")
	{
		document.getElementById("footnote").innerHTML = 'This website is best viewed on a screen resolution of <a href="http://en.wikipedia.org/wiki/Display_resolution" target="_blank" title="View more detailed information on screen resolutions at Wikipedia [opens new window]" class="whtlink">1024x768</a> or higher.';
	}

}


var photoList = new Array();
var photoDesc = new Array();

var gWidths;
var gHeights;


function showGallery(){

	if(!document.getElementById("galleryCover"))
	{
		var eBody = document.getElementsByTagName("body")[0];
		var eDiv = document.createElement("div");
		eBody.appendChild(eDiv);
		eDiv.setAttribute("id","galleryCover");
	}
	
	if (self.pageYOffset) 
	{
		var eqscrolling = self.pageYOffset;
	} 
	else
	{
		var eqscrolling = document.documentElement.scrollTop;
	}

	var eqheight = screen.availHeight;
	
	eqTotalHeight = eqscrolling+eqheight;

	mygallerycontainer = '<div id="photoContainer" onmouseover="galleryMenu(event,\'show\')" onmouseout="galleryMenu(event,\'hide\')">';
	mygallerycontainer += '<img src="/gfx/gControls/tl-sdw.png" alt="photo" width="5" height="5" id="tlShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/tc-sdw.png" alt="photo" width="690" height="5" id="tcShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/tr-sdw.png" alt="photo" width="5" height="5" id="trShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/rc-sdw.png" alt="photo" width="5" height="690" id="rcShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/br-sdw.png" alt="photo" width="5" height="5" id="brShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/bc-sdw.png" alt="photo" width="690" height="5" id="bcShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/bl-sdw.png" alt="photo" width="5" height="5" id="blShadow" />';
	mygallerycontainer += '<img src="/gfx/gControls/lc-sdw.png" alt="photo" width="5" height="690" id="lcShadow" />';
	mygallerycontainer += '<div id="mainPhoto"></div>';
	mygallerycontainer += '<span id="photoLoading">Loading Photograph...</span>';
	mygallerycontainer += '</div>';
	mygallerycontainer += '<div id="photoCover"></div>';
	mygallerycontainer += '<div id="photoControls"></div>';

	document.getElementById("galleryCover").style.height = eqTotalHeight+"px";
	document.getElementById("galleryCover").innerHTML = '<div id="jgBackground"></div><div id="galleryContainer"></div>';
	document.getElementById("galleryContainer").innerHTML = mygallerycontainer;
	document.getElementById("galleryCover").style.display = "block";

	opacityin('galleryCover', 0, 100, 200);
	startGallery(0);
	
}

function startGallery(photoID){

	if(document.getElementById("galleryPhoto"))
	{
		opacityin('galleryPhoto','100','0',600);
	}

	document.getElementById("photoLoading").style.display = 'block';
	galintime = setTimeout("displayPhoto("+photoID+")",400);

}


function displayPhoto(photoID){

photoNow = photoID+1;
photoTotal = photoList.length;
jsTotal = photoList.length-1;



if(photoID >= jsTotal)
{
	nxtPhoto = 0;
	prvPhoto = jsTotal-1;
}
else if(photoID <= 0)
{
	nxtPhoto = 1;
	prvPhoto = jsTotal;
}
else
{
	nxtPhoto = photoID+1;
	prvPhoto = photoID-1;
}



curPhoto = new Image();

curPhoto.onload = function(){

if (self.pageYOffset) 
{
	var jgscrolling = self.pageYOffset;
} 
else
{
	var jgscrolling = document.documentElement.scrollTop;
}

gWidths = curPhoto.width;
gHeights = curPhoto.height;

document.getElementById("galleryContainer").style.top = (jgscrolling+120)+"px";	
document.getElementById("galleryContainer").style.width = (gWidths+10)+"px";
document.getElementById("galleryContainer").style.height = (gHeights+10)+"px";
document.getElementById("galleryContainer").style.marginLeft = "-"+(gWidths/2)+"px";

document.getElementById("photoContainer").style.width = (gWidths+10)+"px";
document.getElementById("photoContainer").style.height = (gHeights+10)+"px";

document.getElementById("mainPhoto").style.width = gWidths+"px";
document.getElementById("mainPhoto").style.height = gHeights+"px";
document.getElementById("photoControls").style.width = (gWidths-30)+"px";
document.getElementById("photoCover").style.width = gWidths+"px";
document.getElementById("photoCover").style.height = gHeights+"px";

document.getElementById("tcShadow").style.width = gWidths+"px";
document.getElementById("rcShadow").style.height = gHeights+"px";
document.getElementById("bcShadow").style.width = gWidths+"px";
document.getElementById("lcShadow").style.height = gHeights+"px";

document.getElementById("photoLoading").style.display = 'none';

document.getElementById("mainPhoto").innerHTML = '<img id="galleryPhoto" src="'+photoList[photoID]+'" alt="'+photoDesc[photoID]+'" width="'+gWidths+'" height="'+gHeights+'" />';

document.getElementById("photoControls").innerHTML = '<span id="photoDesc">'+photoDesc[photoID]+'</span><span id="photoNumb">Photo '+photoNow+'/'+photoTotal+'</span><span id="photoNav"><a onclick="startGallery('+prvPhoto+')"><img src="/gfx/gControls/prev.png" alt="Previous Photo" width="12" alt="12" /> Prev</a> &nbsp;&nbsp;.&nbsp;&nbsp; <a onclick="startGallery('+nxtPhoto+')">Next <img src="/gfx/gControls/next.png" alt="Next Photo" width="12" alt="12" /></a></span><span id="closeGall" onclick="closeGallery()">Close <img src="/gfx/gControls/close.png" alt="Close Photo" width="12" alt="12" /></span>';

document.getElementById("galleryContainer").style.display = "block";

opacityin('galleryPhoto','0','100',600);

}

curPhoto.src = photoList[photoID];

}


function closeGallery(){

document.getElementById("galleryCover").style.display = "none";
document.getElementById("galleryCover").innerHTML = "";
opacityin('galleryCover','100','0',200);
}


function gposTop(stTop,enTop,Tid){

var topStart = stTop;
var topEnd = enTop;
var millisec = 200;

var speed = Math.round(millisec / 100);
var timer = 10;

	 if(topStart > topEnd) {
		 for(i = topStart; i >= topEnd; i--) {
			 setTimeout("gchangeposTop(" + i + ",'" + Tid + "')",(timer * speed));
			 timer++;
		 }
	 } else if(topStart < topEnd) {
		 for(i = topStart; i <= topEnd; i++)
			 {
			 setTimeout("gchangeposTop(" + i + ",'" + Tid + "')",(timer * speed));
			 timer++;
		 }
	 }
 }

 function gchangeposTop(itop, Tid) {

		document.getElementById(Tid).style.bottom = itop+"px";
}


function galleryMenu(event,galDir){

	galObject = document.getElementById("galleryContainer");
	parentCo = zxcPos(galObject);

	hoverLeft = parentCo[0]+(gWidths);
	hoverTop = parentCo[1]+(gHeights);

	curLeft = event.clientX;
	curTop = event.clientY;
	
	//alert(parentCo[0]);

	if(galDir == "show")
	{
		if(document.getElementById("photoControls").style.bottom != "5px")
		{
			gposTop("-70","5","photoControls");
		}
	}
	else if(galDir == "hide")
	{

		if(document.getElementById("photoControls").style.bottom != "-70px")
		{
			if(curLeft >= hoverLeft || curTop >= hoverTop)
			{
				gposTop("5","-70","photoControls");
			}

			if(curLeft <= parentCo[0] || curTop <= parentCo[1])
			{
				gposTop("5","-70","photoControls");
			}
		}
	}
}

function zxcPos(zxcobj){
 zxclft=zxcobj.offsetLeft;
 zxctop=zxcobj.offsetTop;
 while(zxcobj.offsetParent!=null){
  zxcpar=zxcobj.offsetParent;
  zxclft+=zxcpar.offsetLeft;
  zxctop+=zxcpar.offsetTop;
  zxcobj=zxcpar;
 }
 return [zxclft,zxctop];
}

function sideGallery(imgId,gSize){

	if(gSize == "l")
	{
		thisGalleryId = "sideGalleryCont";
	}
	else
	{
		thisGalleryId = "sideGalleryContSml";
	}
	
	if(!document.getElementById(thisGalleryId))
	{
		var eBody = document.getElementById("contentleft");
		var eDiv = document.createElement("div");
		eBody.appendChild(eDiv);
		eDiv.setAttribute("id",thisGalleryId);
	}

	totalPhoto = photoList.length;
	currentPhoto = parseInt(imgId)+1;
	galleryCont = document.getElementById(thisGalleryId);
	
	galleryCont.style.background = "url('/gfx/loadingr.gif') no-repeat center center";
	//galleryCont.innerHTML = '';
	
	curPhoto = new Image();
	curPhoto.onload = function(){

		gWidths = curPhoto.width;
		gHeights = curPhoto.height;
		
		galleryCont.innerHTML = '<span id="sidenumber">'+currentPhoto+' / '+totalPhoto+'</span>';
		galleryCont.innerHTML += '<img src="'+photoList[imgId]+'" alt="'+photoDesc[imgId]+'" />';
		galleryCont.innerHTML += '<span id="sidedesc">'+photoDesc[imgId]+'</span>';
		document.getElementById("sidedesc").style.marginRight = "-"+(gWidths/2)+"px";
		document.getElementById("sidedesc").style.marginLeft = (gWidths/2)+"px";
		document.getElementById("sidenumber").style.marginLeft = (gWidths/2+50)+"px";
		document.getElementById("sidenumber").style.marginRight = "-"+(gWidths/2)+"px";
		galleryCont.style.background = "";

		if(gSize == "s")
		{
			galleryCont.style.width = (gWidths+12)+"px";

			while(galleryCont.previousSibling.nodeType != 1)
			{
				galleryCont = galleryCont.previousSibling;
			}
			
			pSibStyle = "width:"+(645-(gWidths+12))+"px;display:inline;float:left;";
			galleryCont.previousSibling.setAttribute("style",pSibStyle);
				
			//galleryCont.previousSibling.style.width = (645-(gWidths+12))+"px";
			//galleryCont.previousSibling.style.display = "inline";
			//galleryCont.previousSibling.style.float = "left";
		}
	}
	
	curPhoto.src = photoList[imgId];
}


var mywbc="1";
function buildConcreteCalculator(wbc){

	buildCalc = "0";
	if(wbc){mywbc = wbc;}
	
	if(document.getElementById("mycalculator"))
	{
		buildCalc = "1";
	}
	else
	{
		ckspans = document.getElementsByTagName("p");
		for(i=0;i<ckspans.length;i++)
		{
			ckspan = ckspans[i];
			
			if(bName == "Explorer" && (bVer == "6" || bVer == "7"))
			{
				ckClass = ckspan.getAttribute("className");
			}
			else
			{
				ckClass = ckspan.getAttribute("class");
			}
			
			if(ckClass == "concretecalculator")
			{
				var cDiv = document.createElement("div");
				cDiv.setAttribute("id","mycalculator");
				cDiv.setAttribute("class","concretecalculator");
				calcParent = ckspans.item(i).parentNode;
				oldDiv = ckspans.item(i);

				calcParent.replaceChild(cDiv,oldDiv);
				buildCalc = "1";
			}
		}
	}

	if(buildCalc == "1")
	{
		if(mywbc == "1")
		{
			document.getElementById("mycalculator").innerHTML = '<form name="concreteCalc" method="post" action="#" id="conccalcform"><span>Units</span> <input type="radio" id="ccmeters" name="units" value="meters" checked="checked" onclick="buildConcreteCalculator(\'1\')" /> <label for="ccmeters" class="short">Meters</label> <input type="radio" id="ccinches" name="units" value="inches" onclick="buildConcreteCalculator(\'2\')" /> <label for="ccinches" class="short">Feet/Inches</label> <span>Measurements</span><label for="ccwidth">Width:</label><input type="text" id="ccwidth" name="width" value="0" /> <label for="ccheight">Length:</label><input type="text" id="ccheight" name="height" value="0" /> <label for="ccdepth">Depth:</label><input type="text" id="ccdepth" name="depth" value="0" /> <div id="concreteCalcTotal"><span>Total: </span><span class="total">0.00 m<sup>3</sup></span></div> <button type="button" onclick="concreteCalculator()">Calculate</button></form>';
		}
		else if(mywbc == "2")
		{
			document.getElementById("mycalculator").innerHTML = '<form name="concreteCalc" method="post" action="#" id="conccalcform"><span>Units</span> <input type="radio" id="ccmeters" name="units" value="meters" onclick="buildConcreteCalculator(\'1\')" /> <label for="ccmeters" class="short">Meters</label> <input type="radio" id="ccinches" name="units" value="inches" checked="checked" onclick="buildConcreteCalculator(\'2\')" /> <label for="ccinches" class="short">Feet/Inches</label> <span>Measurements</span><label for="ccwidth">Width:</label><input type="text" id="ccwidth" name="widthf" value="0" class="smlinput" /><span class="tylabel"> ft</span>  <input type="text" id="ccwidth" name="widthi" value="0" class="smlinput" /><span class="tylabel"> inch</span> <label for="ccheight">Length:</label><input type="text" id="ccheight" name="heightf" value="0" class="smlinput" /><span class="tylabel"> ft</span> <input type="text" id="ccheight" name="heighti" value="0" class="smlinput" /><span class="tylabel"> inch</span> <label for="ccdepth">Depth:</label><input type="text" id="ccdepth" name="depth" value="0" class="smlinput" /><span class="tylabel"> inch</span> <div id="concreteCalcTotal"><span>Total: </span><span class="total">0.00 m<sup>3</sup></span></div> <button type="button" onclick="concreteCalculator()">Calculate</button></form>';
		}
	}
}

function concreteCalculator(){

	allowCalc = "0";
	alertMssg = "Please fill in all required fields\n\n";

	if(document.concreteCalc.units[0].checked)
	{
		thisWidth = document.concreteCalc.width.value;
		thisHeight = document.concreteCalc.height.value;
		thisDepth = document.concreteCalc.depth.value;

		ckWidth = thisWidth.replace(" ","");
		ckHeight = thisHeight.replace(" ","");
		ckDepth = thisDepth.replace(" ","");
		
		if(ckWidth == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Width\n";}
		if(ckHeight == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Length\n";}
		if(ckDepth == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Depth\n";}
	}

	if(document.concreteCalc.units[1].checked)
	{
		thisWidthf = document.concreteCalc.widthf.value;
		thisWidthi = document.concreteCalc.widthi.value;
		thisHeightf = document.concreteCalc.heightf.value;
		thisHeighti = document.concreteCalc.heighti.value;
		thisDepth = document.concreteCalc.depth.value;

		ckWidthf = thisWidthf.replace(" ","");
		ckWidthi = thisWidthi.replace(" ","");
		ckHeightf = thisHeightf.replace(" ","");
		ckHeighti = thisHeighti.replace(" ","");
		ckDepth = thisDepth.replace(" ","");
		
		if(ckWidthf == "" || ckWidthi == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Width\n";}
		if(ckHeightf == "" || ckHeighti == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Length\n";}
		if(ckDepth == ""){allowCalc = allowCalc+1;alertMssg += "Please enter a Depth\n";}
	}


	ccTotal = "";

	if(document.concreteCalc.units[0].checked)
	{
		ccTotal = thisWidth*thisHeight*thisDepth;
	}
	else if(document.concreteCalc.units[1].checked)
	{
		thisWidthfa = thisWidthf*12;
		thisWidthfb = parseInt(thisWidthfa)+parseInt(thisWidthi);
		thisWidth = thisWidthfb/40;
		
		thisHeightfa = thisHeightf*12;
		thisHeightfb = parseInt(thisHeightfa)+parseInt(thisHeighti);
		thisHeight = thisHeightfb/40;
		
		thisDepth = thisDepth/40;
		
		ccTotal = thisWidth*thisHeight*thisDepth;
	}
	else
	{
		allowCalc = allowCalc+1;
		alertMssg += "Please select a Unit\n";
	}


	if(allowCalc == "0")
	{
		document.getElementById("concreteCalcTotal").innerHTML = "<span>Total: </span><span class=\"total\">"+ccTotal.toFixed(2)+" m<sup>3</sup></span>";
	}
	else
	{
		alert(alertMssg);
	}
}


function adjForm(wAdj,wId){

	adjFields = new Array();
	adjFields[0] = "idname";
	adjFields[1] = "idemail";
	adjFields[2] = "idphone";
	adjFields[3] = "idenquiry";

	if(wAdj == "1")
	{
		for(i=0;i<adjFields.length;i++)
		{
			document.getElementById(adjFields[i]).value = "Required Field";
			document.getElementById(adjFields[i]).style.fontStyle = "italic";
			document.getElementById(adjFields[i]).style.color = "#d0d0d0";
		}
	}
	else
	{
		if(document.getElementById(wId).value == "" || document.getElementById(wId).value == "Required Field"){document.getElementById(wId).value = "";}
		document.getElementById(wId).style.fontStyle = "normal";
		document.getElementById(wId).style.color = "#000000";
	}
}


function loadSideContent(divid){

	if(document.getElementById(divid))
	{
		if(divid == "diggerdancecontent")
		{
			newHTML = '<p class="morelink"><a href="/special_events.jcb">Visit our Special Events page for more</a></p>';
			document.getElementById(divid).innerHTML = newHTML;
		}
	}
}


function startMap(){

var thisPage = location.href; 
mapLinks = document.getElementsByTagName("a");

	for(i=0;i<mapLinks.length;i++)
	{
		mapLink = mapLinks[i];

		mapRel = mapLink.getAttribute("rel");
		mapHref = mapLink.getAttribute("href");
		mapHref2 = mapLink.getAttribute("href")+"?";

		var location_page = location.protocol + "//" + location.hostname + mapHref;
		var location_page2 = location.protocol + "//" + location.hostname + mapHref2;

		if(((mapHref == thisPage || mapHref2 == thisPage) && mapRel == "sitemap") || ((location_page == thisPage || location_page2 == thisPage) && mapRel == "sitemap"))
		{ 
			mapLinks.item(i).className ="current";
			
			//var mdiv = mapLinks.item(i).parentNode;
			var mdiv = mapLinks.item(i);
			var divadd = document.createElement("span");
			mdiv.appendChild(divadd);
			divadd.setAttribute("id", "youarehere");
			divadd.innerHTML = '&lt;&nbsp;&nbsp; You Are Here';
			goPos = mapLinks.item(i).offsetTop;
			document.getElementById("showSitemap").scrollTop = goPos;
			return;  
		} 
	}
}

var sitemapHTML;
function showSitemap(){

	if(!document.getElementById("showSitemap"))
	{
		var checksmap = document.getElementsByTagName("body")[0];
		var sndiv = document.createElement("div");
		checksmap.appendChild(sndiv);
		sndiv.setAttribute("id", "showSitemap");
	}
	
	
	//sitemapPos = document.getElementById("page").offsetHeight-762;
	
	if (self.pageYOffset) 
	{
		var sitemapPos = self.pageYOffset+80;
	} 
	else
	{
		var sitemapPos = document.documentElement.scrollTop+80;
	}

	sitemapDiv = document.getElementById("showSitemap");
	sitemapDiv.style.top = sitemapPos+"px";
	sitemapDiv.innerHTML = sitemapHTML;
	sitemapDiv.style.display = "block";
	startMap();
}

function closeSitemap(){

	document.getElementById("showSitemap").style.display = "none";
	document.getElementById("showSitemap").innerHTML = "";
}



function addstyles(){

	//** Build js rendered stylesheet that css validators fail on **
	var jstyle = document.getElementsByTagName("head")[0];
	var lk = document.createElement("link");
	jstyle.appendChild(lk);
	lk.setAttribute("rel", "stylesheet");
	lk.setAttribute("type", "text/css");
	lk.setAttribute("href", "/js-vl.css");
}



/** Added from quirksmode to replace old detect method **/
/** http://www.quirksmode.org/js/detect.html           **/
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


var bName = BrowserDetect.browser;
var bVer = BrowserDetect.version;


window.onload = function(){headPhoto(0,3);contentPreloader();}