// page load
$(function(){
	// nav interactivity
	$('#nav li:not(.active)').hover(
		function(){
			$(this).css('background-position','center');
		},
		function(){
			$(this).css('background-position','right');
		}
	);
	// fieldset interactivity
	$('fieldset').each(function(){
		legend = $(this).children('legend').text();
		$(this).before('<div class="legend-div">'+legend+'</div>');
		$(this).children('legend').remove();
	});
	$('.legend-div').each(function(){arrow = 0;}).hover(
		function(){
			$(this).css('background-color','#ddd');
		}, function(){
			$(this).css('background-color','#e5e5e5');
		}
	).click(function(){
		$(this).next('fieldset').toggle();
		arrow ++;
		if(arrow % 2 > 0){
			$(this).css('background-image','url(img/arrow-down.gif)');
		}else{
			$(this).css('background-image','url(img/arrow-right.gif)');
		}
	});
	
	// png fix
	$(document).pngFix();
});

// window load
$(window).load(function() {
	// content box radiused corners
	$('#content-box').liquidCanvas(
		"fill{color:#eee} => roundedRect{radius:5}"
	);
	$('.widget-box').liquidCanvas(
		"[border{color:#e2e2e2; width:1;} gradient{from:#fff; to:#f0f0f0;}] => roundedRect{radius:10}"
	)
	
	//preload form validation images
	
});
