
function showsas() { 
	sasobj=document.getElementById('sasexpand');
	sasobj.style.display='block';
}

function showactivate() { 
	activate=document.getElementById('activate');
	activate.style.display='block';
}


function popup(page,wname,xvalue,yvalue){
        window.open(page,wname,"height="+yvalue+",width="+xvalue+",directories=no,location=no,menubar=no,scrollbars=yes")
}

function openSub(x,y) {
	var x1 = document.getElementById(x+y);
	var y1 = document.getElementById(x+'_'+y);
	var sol = 4;
	for(i=1;i<sol+1;i++) {
		document.getElementById(x+i).className = 'ddSub';
		document.getElementById(x+'_'+i).className = '';
	}
	x1.className = x1.className + ' selected';
	y1.className = 'selected';
}

var timer;

function closeSub2(x) {
	document.getElementById('subNav' + x).style.display = 'none';
}

function dropSub(x) {
	clearTimeout(timer);
	var y = 1;
	for(i = 1; i < y; i ++) {
		document.getElementById('subNav' + i).style.display = 'none';
	}
	document.getElementById('subNav' + x).style.display = 'block';
}
function closeSub(x) {
	timer = setTimeout('closeSub2(' + x + ')',3000);
}

function changeTab(x) {
	var z = 4
	for(i = 1; i < z; i ++) {
		var tab1 = document.getElementById('bTab' + i).style;
		var tp1 = document.getElementById('topic' + i).style;
//		tab1.backgroundImage = 'url(/images/bottom-tab.jpg)';
		tab1.borderColor = '#C7C7C7';
		tab1.color = '#666666';
		tp1.display = 'none';
	}
	var tab2 = document.getElementById('bTab' + x).style;
	var tp1 = document.getElementById('topic' + x).style;
//	tab2.backgroundImage = 'url(/images/bottom-tab-over.jpg)';
	tab2.borderColor = '#FFFFFF';
	tab2.color = '#ED5D00';
	tp1.display = 'block';
}

var tabTimer;

function tabIt(x) {
	clearTimeout(tabTimer);
	tabTimer = setTimeout('changeTab(' + x + ')',300);
}

function unTabit() {
	clearTimeout(tabTimer);
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("ulNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
  				}
  				node.onmouseout=function() {
  					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function timeZones() {
	var offSet = (new Date().getTimezoneOffset()/60)*(-1)-1;
	if (offSet == 11 || offSet == 12) {
		document.getElementById('phoneNum').innerHTML = "+64 (0) 9 984 5700";
	}
	if (offSet == 0) {
		document.getElementById('phoneNum').innerHTML = "+44 (0) 1256 848 080";
	}
	if (offSet == 8 || offSet == 9 || offSet == 10) {
		document.getElementById('phoneNum').innerHTML = "+61 (0) 2 9466 5800";
		document.getElementById('maasMain').style.display = "list-item";
		if(document.getElementById('maasLeft')){
			document.getElementById('maasLeft').style.display = "list-item";
		}
	}
}

loadFunctions = function() {
	startList();
//	timeZones();
	jquery();
}

window.onload=loadFunctions;

function jquery() {

	$("a#dropSub").click(
		function () {
			$("a#dropSub").fadeOut(500,
				function () {
					$("ul.searchIt").fadeIn(500);
				}
			);
			return false;
		}
	);

}
