$(document).ready(function(){

	$('#header_photo').jqFancyTransitions({ width: 1100, height: 249, strips: 40 });
	if($.browser.msie) $('#menu').show(); else $('#menu').fadeTo("slow",0.9); 
	$('#header_text_wrapper').delay(500).fadeTo("slow",0.8,function() { if($.browser.msie) $('#header_logo img').show(); else  $('#header_logo img').fadeIn(); });
	$('#rightcol').show();
	
	var deviceAgent = navigator.userAgent.toLowerCase();
	var agentID = deviceAgent.match(/(iphone|ipod|ipad)/);
	if (!agentID) {
        $('#header_stamp').delay(2000).fadeTo("slow",0.3).animate({top:'-=50'},1000);
		$('#header_stamp').mouseenter(function() { $(this).animate({opacity:1, width:'100'},100); }).mouseleave(function() { $(this).animate({opacity:0.3, width:'90'},100); });
	}
	
	/*
	$(".section_left")
		.mouseover(function() {
			$(this).animate({height:'200', width:'320'},1000,'easeInOutElastic');
		})
		.mouseout(function() {
			$(this).animate({height:'50', width:'315'},1000,'easeInOutElastic');
		});
		
	$(".section_right")
		.mouseover(function() {
			$(this).animate({height:'200', width:'320', marginLeft:'0'},1000,'easeInOutElastic');
		})
		.mouseout(function() {
			$(this).animate({height:'50', width:'315', marginLeft:'5'},1000,'easeInOutElastic');
		});
	*/
		
	$(".section_left")
		.click(function() {
			if ($(this).hasClass("section_on"))
			{
				$(this).animate({height:'50', width:'315'},1000,'easeInOutElastic');
				$(this).removeClass("section_on");	
			}
			else
			{
				$(this).animate({height:'210', width:'320'},1000,'easeInOutElastic');	
				$(this).addClass("section_on");
			}
		});
		
	$(".section_right")
		.click(function() {
			if ($(this).hasClass("section_on"))
			{
				$(this).animate({height:'50', width:'315', marginLeft:'5'},1000,'easeInOutElastic');
				$(this).removeClass("section_on");	
			}
			else
			{
				$(this).animate({height:'210', width:'320', marginLeft:'0'},1000,'easeInOutElastic');	
				$(this).addClass("section_on");
			}
		});
		
	$(".collapse")
		.click(function() {
			if ($(this).hasClass("collapse_on"))
			{
				$(this).animate({height:'40'},300,'easeInOutSine');
				$(this).removeClass("collapse_on");	
			}
			else
			{
				var child_height = $(this).find(".collapse-container").height() + 20;
				$(this).animate({height:child_height},300,'easeInOutSine');	
				$(this).addClass("collapse_on");
			}
	});
	

	$("a[title]").tooltip({ effect: 'slide'});
	$("div.section[title]").tooltip({ effect: 'slide'});
	
});
