var menu={

    buildmenu:function(menuid,highlight){
	jQuery(document).ready(function($){
            var $mainmenu=$("#"+menuid+">ul")
            var $headers=$mainmenu.find("ul").parent()
            $headers.each(function(i){
                var $curobj=$(this)
               
                $curobj.find("a:first").css({backgroundRepeat:'no-repeat', backgroundPosition:'3px 8px',
                paddingLeft:'16px', backgroundImage:'url(pics/collapsed.gif)'})
                
                $curobj.click(function(e){
                    var $targetul=$(this).children("ul:eq(0)")
                    if($targetul[0].style.display == 'none') {
                        $(this).find('a:first').css({backgroundImage:'url(pics/expanded.gif)',paddingLeft:'16px',backgroundPosition:'2px 10px'})
                        $targetul.show()
                    } else {
                        $(this).find('a:first').css({backgroundImage:'url(pics/collapsed.gif)',paddingLeft:'16px',backgroundPosition:'3px 8px'})
                        $targetul.hide()
                    }
                    return false;
                    } // end click
                
                )    
                $(this).find("li").click(function(e) {
                    window.location.href=$(this).find('a:first').attr('href');
                    return false
                })
            })
            $mainmenu.find("ul").css({display:'none', visibility:'visible'})
            $mainmenu.find("li").each(function(e) {
                if($(this).attr('id') == highlight) {
                    $(this).parent().parent().click();
                }
            });
	}) //end document.ready
    }
}

jQuery(document).ready(function($){
    var inputs=$(this).find("input");
    inputs.each(function(e){
        if(($(this).attr('type')=='text') || ($(this).attr('type')=='password')) {
            $(this).focus();
            return false;
        }
    });
    $("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal',
				padding: 40,
				opacity: 0.35,
				showTitle: false,
				allowresize: false,
				theme: 'light_rounded',
				hideflash: true
	});
})
