/* Browser check */
IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);

// preload rollovers
var aNavigation = new Array();
aNavigation = ["", "company", "consulting", "products", "training", "support", "literature", "news-events", "blogs"];
for (i = 1; i <= aNavigation.length; i++) { 
	eval("A"+i+"on = new Image();"); eval("A"+i+"off = new Image();");
	if (sSelectedButton == aNavigation[i]) {
		eval("A"+(i)+"on.src = \"" + sFolderLevel + "img/buttons/" + aNavigation[i] + "-r.gif\";");
		eval("A"+(i)+"off.src = \"" + sFolderLevel + "img/buttons/" + aNavigation[i] + "-r.gif\";");
	} else {
		eval("A"+(i)+"on.src = \"" + sFolderLevel + "img/buttons/" + aNavigation[i] + "-r.gif\";");
		eval("A"+(i)+"off.src = \"" + sFolderLevel + "img/buttons/" + aNavigation[i] + "-0.gif\";");
	}
}

var aNavigation = new Array();
aNavigation = ["", "nigel-cheshire", "ian-smith", "scott-johnsen", "mark-dixon", "mark-collison", "craig-schumann","tamsin","suzanne-kelsall","stephanie-heit","rocky-oliver","michael-hanna"];
for (i = 1; i <= aNavigation.length; i++) { 
	eval("MT"+i+"on = new Image();");
	eval("MT"+i+"off = new Image();");
	eval("MT"+(i)+"on.src = \"" + sFolderLevel + "img/content-design/" + aNavigation[i] + "-r.jpg\";");
	eval("MT"+(i)+"off.src = \"" + sFolderLevel + "img/content-design/" + aNavigation[i] + "-0.jpg\";");
}

/* home page focus images */
if (document.images) {

focusImage1on = new Image(); focusImage1on.src = "" + sFolderLevel + "img/home/focus-image-ibm-r.gif"; 
focusImage1off = new Image(); focusImage1off.src = "" + sFolderLevel + "img/home/focus-image-ibm-0.gif";

focusImage2on = new Image(); focusImage2on.src = "" + sFolderLevel + "img/home/focus-image-contact-r.gif"; 
focusImage2off = new Image(); focusImage2off.src = "" + sFolderLevel + "img/home/focus-image-contact-0.gif";

focusImage3on = new Image(); focusImage3on.src = "" + sFolderLevel + "img/home/focus-image-downloads-r.gif"; 
focusImage3off = new Image(); focusImage3off.src = "" + sFolderLevel + "img/home/focus-image-downloads-0.gif";

focusImage4on = new Image(); focusImage4on.src = "" + sFolderLevel + "img/home/focus-image-analyzer-r.gif"; 
focusImage4off = new Image(); focusImage4off.src = "" + sFolderLevel + "img/home/focus-image-analyzer-0.gif";

focusImage5on = new Image(); focusImage5on.src = "" + sFolderLevel + "img/content-design/focus-pam-1.jpg"; 
focusImage5off = new Image(); focusImage5off.src = "" + sFolderLevel + "img/content-design/focus-pam-0.jpg";

focusImage6on = new Image(); focusImage6on.src = "" + sFolderLevel + "img/content-design/focus-pam-2.jpg"; 
focusImage6off = new Image(); focusImage6off.src = "" + sFolderLevel + "img/content-design/focus-pam-0.jpg";

focusImage7on = new Image(); focusImage7on.src = "" + sFolderLevel + "img/content-design/focus-pam-3.jpg"; 
focusImage7off = new Image(); focusImage7off.src = "" + sFolderLevel + "img/content-design/focus-pam-0.jpg";

focusImage8on = new Image(); focusImage8on.src = "" + sFolderLevel + "img/home/focus-image-career-r.gif"; 
focusImage8off = new Image(); focusImage8off.src = "" + sFolderLevel + "img/home/focus-image-career-0.gif";

focusImage9on = new Image(); focusImage9on.src = "" + sFolderLevel + "img/home/focus-image-contact-small-r.gif"; 
focusImage9off = new Image(); focusImage9off.src = "" + sFolderLevel + "img/home/focus-image-contact-small-0.gif";

focusImage10on = new Image(); focusImage10on.src = "" + sFolderLevel + "img/home/focus-image-quickview-r.gif"; 
focusImage10off = new Image(); focusImage10off.src = "" + sFolderLevel + "img/home/focus-image-quickview-0.gif";

}

// Image Swapping
function imgOn(imgName)
{
  if (IS_DOM) {
    document.getElementById(imgName).src = eval(imgName + "on.src");
  }
}
 
function imgOff(imgName)
{
  if (IS_DOM) {
    document.getElementById(imgName).src = eval(imgName + "off.src");
  }
}

function changeImages() 
{
  if (document.getElementById) {
    for (var i = 0; i < changeImages.arguments.length; i += 2) { 
  		document.getElementById(changeImages.arguments[i]).src = eval(changeImages.arguments[i + 1] + ".src"); 
	}
  }
}

// Get an ID 
function getThis(sId)
{
	var oObject;
	oObject = false;
	
	if (IS_DOM) {
		if (document.getElementById(sId)) {
			oObject = document.getElementById(sId);
		}
	}
	
	return oObject;
}
	
// accessible popup functions, this will work with or without javascript enabled
// reference like this "<a href="popup.htm" onclick="popUp(this.href,'console',400,200);return false;" target="newWin" title="This link will pop open a new window">This is my link</a>"
	function popUp(strURL,strType,strHeight,strWidth,strWindow)
	{
	  var strOptions="";
	  if (strType=="console") {
	    strOptions="resizable,height=" + strHeight + ",width=" + strWidth;
	  }
	  if (strType=="fixed") {
	    strOptions="status,height=" + strHeight + ",width=" + strWidth;
	  }
	  if (strType=="elastic") {
	    strOptions="toolbar,menubar,scrollbars,resizable,location,height=" + strHeight + ",width=" + strWidth;
	  }
	  window.open(strURL, strWindow, strOptions);
	}

function centeredPopUpWindow(mypage, myname, w, h, scroll)
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}

function choosePlatform(product)
{
	var showCtrl = document.getElementById("serverPlatforms");
	var hideCtrl = document.getElementById("serverModules");
	var platformForDiv = document.getElementById("serverPlatformFor");
	var textNode = document.createTextNode("Choose your platform for " + product);

	platformForDiv.replaceChild(textNode, platformForDiv.firstChild);
	showCtrl.style.display = "block";
	hideCtrl.style.display = "none";
}

function centeredPopUpWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
