﻿//anchor fix for safari
//for services.html

var targBox = "right_col";


function gotoLink(page, myLink) {

if (navigator.userAgent.indexOf("Safari") > -1) {
	if(String(window.location).indexOf(page) > -1){
		scrollDivToAnchor(myLink);
	}
	else {
		window.location = page;
		scrollDivToAnchor(myLink);
	}
	}
else {
	window.location = page+"#"+myLink;
	}
}
	


function scrollDivToAnchor(a) {

	var b = document.getElementById(targBox);
	b.scrollTop = document.getElementById(a).offsetTop - b.offsetTop;
}


function toggleLayer(whichLayer)
{

if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}
}




// COPYRIGHT HEADCHANNEL LTD 2006

function notLive() {
alert ("Sorry, this site is not yet live. Please click on the 'CASE STUDY' button for more details.")
}

function privateSite() {
alert ("Sorry, this site is private and not viewable to the general public. Please click on the 'CASE STUDY' button for more details.") }

function embedFlash(width, height, src) {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="' + height + '" width="' + width + '">\n');
document.write('<param name="movie" value="'+ src + '">\n');
document.write('<param name="quality" value="best">\n');
document.write('<param name="play" value="true">\n');
document.write('<embed height="' + height + '" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ src + '" type="application/x-shockwave-flash" width="' + width + '" quality="best" play="true">\n');
document.write('</object>\n');
}

//create non-crawlable email addresses
var bongle = "mail";

function sendmail(myVariable, domain, suffix) {
var myLink = myVariable + '@' + domain + '.' + suffix;
document.write('<a href=\"' + bongle + 'to:' + myLink + '\">' + myLink + '</a>');
}
function sendmail_fullstop(myVariable, domain, suffix) {
var myLink = myVariable + '@' + domain + '.' + suffix;
document.write('<a href=\"' + bongle + 'to:' + myLink + '\">' + myLink + '</a>.');
}
