﻿/* UI scripts that appear on all or almost every page */

// Uses http://jQuery.com

$(function(){
//	$("body").addClass("js");

    $('ul.root li ul').slideUp();

    $('ul.root li:has(ul)').find('>a').click(function() {
        $(this).toggleClass('open').parent().find('>ul').slideToggle();
    });
	
	$('div.mod-search,.shareholding-miniform').fieldfocus().find('label.overlabel').overlabel();

});


function NewWindow(u,n,w,h,f,p,x,y)
	{
		var	ws=window.screen?1:0,m=Math,C='center',R='random',M='custom',
		sw=screen.availWidth,sh=screen.availHeight,T=(p==C&&ws)?(sh-h)/2:(p==R&&ws)?(m.floor(m.random()*(sh-h))):(p==M)?y:100,
		L=(p==C&&ws)?(sw-w)/2:(p==R&&ws)?(m.floor(m.random()*(sw-w))):(p==M)?x:100,
		s='width='+w+',height='+h+',top='+T+',left='+L;s+=(!f||f=='')?'':','+f;
		win=window.open(u,n,s);if(win.focus)win.focus();
	}
