/*created with JScript-it MX*/
//version 7.2
//NS still need Width,Height etc, attributes to render for these offsets to work
var version = navigator.appVersion;
var disappeardelay=290 //menu fadeout
var enableanchorlink=0
var hidemenu_onclick=1
var horizontaloffset=14
var ie5=document.all
var ns6=document.getElementById&&!document.all
var ff1=document.getElementById&&!document.all/*opacity handler*/

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
tainuimenuobj.style.left=tainuimenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
} //IE

function clearbrowserside(obj, whichside){
var sideoffset=0
if (whichside=="rightside"){
var windowside=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
tainuimenuobj.contentmeasure=tainuimenuobj.offsetWidth
if (windowside-tainuimenuobj.x-obj.offsetWidth < tainuimenuobj.contentmeasure)
sideoffset=tainuimenuobj.contentmeasure+obj.offsetWidth+(horizontaloffset*2)
}
else{
var topside=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowside=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
tainuimenuobj.contentmeasure=tainuimenuobj.offsetHeight
if (windowside-tainuimenuobj.y < tainuimenuobj.contentmeasure){
sideoffset=tainuimenuobj.contentmeasure-obj.offsetHeight
if ((tainuimenuobj.y-topside)<tainuimenuobj.contentmeasure)
sideoffset=tainuimenuobj.y
}
}
return sideoffset
}

function dropdownmenu(obj, e, tainuimenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof tainuimenuobj!="undefined") //hide last menu on mouseoff
tainuimenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
tainuimenuobj=document.getElementById(tainuimenuID)
if (hidemenu_onclick) tainuimenuobj.onclick=function(){tainuimenuobj.style.visibility='hidden'}
tainuimenuobj.onmouseover=clearhidemenu
tainuimenuobj.onmouseout=ie5? function(){ hide(event)} : function(event){ hide(event)}
showhide(tainuimenuobj.style, e, "visible", "hidden") //places sublinx
tainuimenuobj.x=getposOffset(obj, "left")
tainuimenuobj.y=getposOffset(obj, "top")
tainuimenuobj.style.left=tainuimenuobj.x-clearbrowserside(obj, "rightside")+obj.offsetWidth+horizontaloffset+"px"
tainuimenuobj.style.top=tainuimenuobj.y-clearbrowserside(obj, "bottomside")+"px"
}
return clickreturnvalue()
}
//w3 compliance old browser compatiility
function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}
//firefox fix
function contains_ff(a, f) {
while (f.parentNode)
if ((f = f.parentNode) == a)
return true;
return false;
}
//old browser compatiility (NS)
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
//old browser compatiility (IE)
function hide(e){
if (ie5&&!tainuimenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("tainuimenuobj.style.visibility='hidden'",disappeardelay)/*menu fadeout on mouseout*/
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
//expand/hide functions
if (version.indexOf("Windows") != -1) {
  document.write('<link rel=stylesheet href="t_layout.css" TYPE=\"text/css\">');
}
else {
  document.write('<link rel=stylesheet href="t_layout.css" TYPE=\"text/css\">');                         
}

function toggleKorero(currShow) {
	if (version.indexOf("Windows") != -1) {
		thisKorero = document.getElementById("Korero"+currShow).style;
		thisTake = document.getElementById("Take"+currShow);
		if (thisKorero.display == "block") {
			thisKorero.display = "none";
			thisTake.src = "images/showhide_arrowdwn.gif";
		}
		else {
			thisKorero.display = "block";
			thisTake.src = "images/showhide_arrowup.gif";
		}
	}
	return false
}