
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - input-label.js - */
// http://www.treasury.govt.nz/portal_javascripts/input-label.js?original=1
var ploneInputLabel={focus: function(){var t=jq(this);if(t.hasClass('inputLabelActive')&&t.val()==t.attr('title'))
t.val('').removeClass('inputLabelActive');if(t.hasClass('inputLabelPassword'))
ploneInputLabel._setInputType(t.removeClass('inputLabelPassword'),'password').focus().bind('blur.ploneInputLabel',ploneInputLabel.blur)},blur: function(){var t=jq(this);if(t.is(':password[value=""]')){t=ploneInputLabel._setInputType(this,'text').addClass('inputLabelPassword').bind('focus.ploneInputLabel',ploneInputLabel.focus);if(e.originalEvent&&e.originalEvent.explicitOriginalTarget)
jq(e.originalEvent.explicitOriginalTarget).trigger('focus!')}
if(!t.val())
t.addClass('inputLabelActive').val(t.attr('title'))},submit: function(){jq('input[title].inputLabelActive').trigger('focus.ploneInputLabel')},_setInputType: function(elem,ntype){var otype=new RegExp('type="?'+jq(elem).attr('type')+'"?')
var nelem=jq(jq('<div></div>').append(jq(elem).clone()).html().replace(otype,'').replace(/\/?>/,'type="'+ntype+'" />'));jq(elem).replaceWith(nelem);return nelem}};jq(function(){jq('form:has(input[title].inputLabel)').submit(ploneInputLabel.submit);jq('input[title].inputLabel').bind('focus.ploneInputLabel',ploneInputLabel.focus).bind('blur.ploneInputLabel',ploneInputLabel.blur).trigger('blur.ploneInputLabel')});

/* - show_menu.js - */
// http://www.treasury.govt.nz/portal_javascripts/show_menu.js?original=1
var current_menu=null;var current_sub=null;
function show_menu(el,is_sub,far_right){var menu=el.parentNode.getElementsByTagName('ul');if(menu.length>0){menu=menu[0];if(!is_sub){if(current_menu)
current_menu.style.display='none';var top=el.offsetTop+el.offsetHeight;var left=el.offsetLeft;var temp_el=el;while(temp_el=temp_el.offsetParent){top+=temp_el.offsetTop;left+=temp_el.offsetLeft}
subs=menu.getElementsByTagName('ul');for(var i=0;i<subs.length;i++){subs[i].style.visibility='hidden';subs[i].style.display='none'}
if(far_right){menu.style.display='block';left-=menu.offsetWidth-el.offsetWidth}
current_menu=menu} else{left=0;if(current_sub)
current_sub.style.display='none';current_sub=menu;lis=document.getElementById('navGlobal').getElementsByTagName('li');for(var i=0;i<lis.length;i++){if(lis[i].className=='more'){lis[i].style.zIndex='0'}}}
menu.style.position='absolute';menu.style.visibility='visible';menu.parentNode.style.zIndex='9';menu.style.left=parseInt(left)+'px';if(!is_sub)
menu.style.top=parseInt(top)+'px';menu.style.display='block'} else{if(current_sub)
current_sub.style.display='none';if(current_menu&&!is_sub){current_menu.style.display='none';current_menu=null}
current_sub=null}}
function hide_menu(e,el,top_level){var inside=false;(e.relatedTarget)?temp_el=e.relatedTarget:temp_el=e.toElement;while(temp_el.parentNode){if(temp_el.id=="navGlobal"){inside=true;break}
temp_el=temp_el.parentNode}
if(!inside){if(top_level){uls=el.getElementsByTagName('ul');for(var i=0;i<uls.length;i++){uls[i].style.display='none'}} else{el.style.display='none'}}}


