// JavaScript Document

// Side nav areas back link
var areasBackToLink = "#";
var areasBackToLinkText = "";
var popupWin = "";

// funtion to check side navigation back to areas link.
// If the variables above are not blank then insert an anchor link with the text and link
// The variable above are set in the product listing code inside Actinic
function initSideNav() {
	obj = document.getElementById("areasBackToLink");
	if 	(areasBackToLinkText !="") {
		obj.innerHTML = '<a href="'+areasBackToLink+'">'+areasBackToLinkText+'</a>';
		obj.className ="";
	}
}

// Window handler for popup T and Cs.
function popup2(url,width,height) {
	var needToOpen = false;
	
	if (!popupWin) needToOpen = true;
	else {
		if (popupWin.closed) needToOpen = true;
		else popupWin.focus();		
	}
	
	if (needToOpen) popupWin = window.open(url,'ACTINICPOPUP','width='+width+',height='+height+',location=no,toolbar=no,status=no,menubar=no,resizable=yes,scrollbars=yes');
}
