//function tabberObj(B) { var A; this.div = null; this.classMain = "tabber"; this.classMainLive = "tabberlive"; this.classTab = "tabbertab"; this.classTabDefault = "tabbertabdefault"; this.classNav = "tabbernav"; this.classTabHide = "tabbertabhide"; this.classNavActive = "tabberactive intel"; this.titleElements = ["h2", "h3", "h4", "h5", "h6"]; this.titleElementsStripHTML = true; this.removeTitle = true; this.addLinkId = false; this.linkIdFormat = "<tabberid>nav<tabnumberone>"; for (A in B) { this[A] = B[A] } this.REclassMain = new RegExp("\\b" + this.classMain + "\\b", "gi"); this.REclassMainLive = new RegExp("\\b" + this.classMainLive + "\\b", "gi"); this.REclassTab = new RegExp("\\b" + this.classTab + "\\b", "gi"); this.REclassTabDefault = new RegExp("\\b" + this.classTabDefault + "\\b", "gi"); this.REclassTabHide = new RegExp("\\b" + this.classTabHide + "\\b", "gi"); this.tabs = new Array(); if (this.div) { this.init(this.div); this.div = null } } tabberObj.prototype.init = function(E) { var H, D, B, J, F = 0, K, A, I, C, G; if (!document.getElementsByTagName) { return false } if (E.id) { this.id = E.id } this.tabs.length = 0; H = E.childNodes; for (D = 0; D < H.length; D++) { if (H[D].className && H[D].className.match(this.REclassTab)) { J = new Object(); J.div = H[D]; this.tabs[this.tabs.length] = J; if (H[D].className.match(this.REclassTabDefault)) { F = this.tabs.length - 1 } } } K = document.createElement("ul"); K.className = this.classNav; for (D = 0; D < this.tabs.length; D++) { J = this.tabs[D]; J.headingText = J.div.title; if (this.removeTitle) { J.div.title = "" } if (!J.headingText) { for (B = 0; B < this.titleElements.length; B++) { G = J.div.getElementsByTagName(this.titleElements[B])[0]; if (G) { J.headingText = G.innerHTML; if (this.titleElementsStripHTML) { J.headingText.replace(/<br>/gi, " "); J.headingText = J.headingText.replace(/<[^>]+>/g, "") } break } } } if (!J.headingText) { J.headingText = D + 1 } A = document.createElement("li"); J.li = A; I = document.createElement("a"); I.appendChild(document.createTextNode(J.headingText)); I.href = "javascript:void(null);"; I.title = J.headingText; I.onclick = this.navClick; I.tabber = this; I.tabberIndex = D; if (this.addLinkId && this.linkIdFormat) { C = this.linkIdFormat; C = C.replace(/<tabberid>/gi, this.id); C = C.replace(/<tabnumberzero>/gi, D); C = C.replace(/<tabnumberone>/gi, D + 1); C = C.replace(/<tabtitle>/gi, J.headingText.replace(/[^a-zA-Z0-9\-]/gi, "")); I.id = C } A.appendChild(I); K.appendChild(A) } E.insertBefore(K, E.firstChild); E.className = E.className.replace(this.REclassMain, this.classMainLive); this.tabShow(F); if (typeof this.onLoad == "function") { this.onLoad({ tabber: this }) } return this }; tabberObj.prototype.navClick = function(F) { var C, A, B, E, D; A = this; if (!A.tabber) { return false } B = A.tabber; E = A.tabberIndex; A.blur(); if (typeof B.onClick == "function") { D = { "tabber": B, "index": E, "event": F }; if (!F) { D.event = window.event } C = B.onClick(D); if (C === false) { return false } } B.tabShow(E); return false }; tabberObj.prototype.tabHideAll = function() { var A; for (A = 0; A < this.tabs.length; A++) { this.tabHide(A) } }; tabberObj.prototype.tabHide = function(A) { var B; if (!this.tabs[A]) { return false } B = this.tabs[A].div; if (!B.className.match(this.REclassTabHide)) { B.className += " " + this.classTabHide } this.navClearActive(A); return this }; tabberObj.prototype.tabShow = function(A) { var B; if (!this.tabs[A]) { return false } this.tabHideAll(); B = this.tabs[A].div; B.className = B.className.replace(this.REclassTabHide, ""); this.navSetActive(A); if (typeof this.onTabDisplay == "function") { this.onTabDisplay({ "tabber": this, "index": A }) } return this }; tabberObj.prototype.navSetActive = function(A) { this.tabs[A].li.className = this.classNavActive; return this }; tabberObj.prototype.navClearActive = function(A) { this.tabs[A].li.className = ""; return this }; function tabberAutomatic(D) { var A, C, B; if (!D) { D = {} } A = new tabberObj(D); C = document.getElementsByTagName("div"); for (B = 0; B < C.length; B++) { if (C[B].className && C[B].className.match(A.REclassMain)) { D.div = C[B]; C[B].tabber = new tabberObj(D) } } return this } function tabberAutomaticOnLoad(B) { var A; if (!B) { B = {} } A = window.onload; if (typeof window.onload != "function") { window.onload = function() { tabberAutomatic(B) } } else { window.onload = function() { A(); tabberAutomatic(B) } } } if (typeof tabberOptions == "undefined") { tabberAutomaticOnLoad() } else { if (!tabberOptions["manualStartup"]) { tabberAutomaticOnLoad(tabberOptions) } }

// this needs to occur after the tabber stuff has been loaded
// loads URL into the top window removing the frames (needed when session expires - otherwise loads login page into frame)
if (top.location != location) {
	top.location.href = document.location.href;
}

var offsetfrommouse=[50,-50]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 480;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="imagehover">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("imagehover").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("imagehover")
else if (document.all)
return document.all.trailimagid
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(imagename,title,description,ratingaverage,ratingnumber,showthumb,height,filetype){

	if (height > 0){
		currentimageheight = height;
	}

	document.onmousemove=followmouse;

	

	newHTML = '<div class="imghovercont">';
	newHTML = newHTML + '<table style="width:500px;"><tr><td colspan="2"><h4>' + title + '</h4></td></tr><tr><td style="width:290px; text-align:justify;" VALIGN="top">';	
	newHTML = newHTML + description + '</td>';

	if (showthumb > 0){
		newHTML = newHTML + '<td style="width:210px;" VALIGN="top"><div align="right" style="padding:2px;">';
		newHTML = newHTML + '<img src="' + imagename + '" border="0" style=" width:200px; height:275px; float:right;"></div></td></tr></table>';
	}

	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}


function hidetrail(){
	gettrailobj().innerHTML = " ";
	gettrailobj().display="none"
	document.onmousemove=""
	gettrailobj().left="-500px"

}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	//if (document.all){
	//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	//} else {
	//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	//}

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 380){
			xcoord = e.pageX - xcoord - 300; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 380){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 400; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}
var ds = .75;
var s = .75;

function change(size) {
    if( size == 0)
        s = ds;
    else
        s += size; 

	document.body.style.fontSize = s + 'em';
}


function ShowTabbers(tabbers)
{
    var loadfunc = function()
    {
		setTimeout(function() //set timeout to help ensure page is all good.
		{
			for (tab in tabbers) {
				var tabTag = document.getElementById(tabbers[tab]);
				if (tabTag != null)
					tabTag.style.display = '';
			}
			
			var selectedString = getQueryParam("selectedTabs");
			if (selectedString && tabberDivs)
			{
				var selectedTabs = selectedString.split(","); //we expect a comma delimited 'array'
				for (var j = 0; j < window.tabberDivs.length; j++)
				{
					if (!window.tabberDivs[j].tabber) continue;
					var tabberTabs = window.tabberDivs[j].tabber.tabs;
					for (var k = 0; k < tabberTabs.length; k++)
					{
						for (var i = 0; i < selectedTabs.length; i++)
						{
							if (tabberTabs[k].headingText == selectedTabs[i])
							{
								tabberTabs[k].li.children[0].onclick();
							}
						}
					}
				}
			}
		}, 100);
	}
	
	//in IE, the onload is already run by the time this is called, other browsers it isn't
	if (window.tabberDivs && window.tabberDivs.length > 0)
		loadfunc();
	else
		addLoadEvent(loadfunc);
}

function getQueryParam(key)
{
	var name = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); //escape brackets
	var regex = new RegExp( "[\\?&]"+name+"=([^&#?]*)" );
	var results = regex.exec( window.location.href );
	return (!results) ? "" : unescape(results[1]);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function()
{
	var selectChecks = getQueryParam("selectChecks").split(",");
	var unselectChecks = getQueryParam("unselectChecks").split(",");
	
	var i;
	for (i = 0; i < selectChecks.length; i++)
	{
		var elem = document.getElementById(selectChecks[i]);
		if (elem) elem.checked = "checked";
	}
	for (i = 0; i < unselectChecks.length; i++)
	{
		var elem = document.getElementById(unselectChecks[i]);
		if (elem && elem.checked) elem.removeAttribute("checked");
	}
	
});




<!--Changing link url according to enviroment-->
function fnGetDomain(){
      // fill hash table with all possible combinations
      var HashTable = {};
      HashTable['www']     = 'secure';
      HashTable['dev']     = 'dev-secure';
      HashTable['staging'] = 'staging-secure';

      // get the hostname part of this window.s location
      var Hostname = document.domain;
      // get the domain
      var LastPart = Hostname.substr(Hostname.indexOf(".")+1);
      // get the first part of the host name (www, dev or staging)
      var FirstPart = Hostname.substr(0,Hostname.indexOf("."));
      // return the matching secure login url
      return HashTable[FirstPart] + '.' + LastPart;
}

// Call function to get the correct login url
var LoginURL = fnGetDomain()


