	// Attach class to HTML tag to allow hiding of elements via css 
    $('HTML').addClass('JS'); 

$(document).ready(function(){
	

    
	$("#flash-holder").flashembed("/fatheroftheyear/swf/foty-slider.swf");

	$(":text").labelify();

	$("#newsletter").click(function () { 
		$("#newsletter-form").slideToggle("slow");
		return false;
	});
	
	$('#sub-nav li a')
		.css( {backgroundPosition: "0px -160px"} )
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-150px 0px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-100px -160px)"}, {duration:400, complete:function(){
				$(this).css({backgroundPosition: "0px -160px"})
			}})
		})

	

    
	// The default axis is 'y', but in this demo, I want to scroll both
	// You can modify any default like this

	if($(".pane-holder").length > 0 ){
    $.localScroll.defaults.axis = 'x';
	
	
	$.localScroll({
		target: '.pane-holder', // could be a selector or a jQuery object too.
		queue:true,
		duration:1000,
		hash:true,
		onBefore:function( e, anchor, $target ){
			// The 'this' is the settings object, can be modified
		},
		onAfter:function( anchor, settings ){
			// The 'this' contains the scrolled element (#content)
		}
	});
    }

     if($("#map1").length > 0 ){
    $('#map1').jmap('init', {mapCenter:[-33.86723,151.213051], mapZoom: 16});
       	
	$('#map1').jmap('AddMarker', {
			'pointLatLng': [-33.86723, 151.213051],
			'pointHTML': '<strong>Parliament House</strong>'
		});

	}



    

    
    // Convert presss release dates
    
    $(".press-release").each(function (i) {
			var newDate = Date.parse($(this).find(".date").text());
            var newDay = newDate.toString('dd');
            var newMonth = newDate.toString('MMM');
            var newYear = newDate.toString('yyyy');

            $(this).find(".date").html('<span class="day">'+newDay+'</span> <span class="month">'+newMonth+'</span> <span class="year">'+newYear+'</span>')
      });

	
    	$("a.popup").fancybox(); 	


});

