$(document).ready(function(){

	$('#logo').pngFix(); 

	
	
	//$(".panel-col-first ul li").css({cursor:'pointer'})
//	.click(function(){
	//	$(this).parent('ul').find('ul').animate({opacity:'hide', height:'hide'},'slow'); 
		//$(this).find('ul').animate({opacity:'show', height:'show'},'slow'); 
	//	$(".panel-col-first ul").accordion();
	//	$(".panel-col-first ul li").css({backgroundPosition:'-184px 4px'});
	//	$(this).css({backgroundPosition:'300px 4px'})
//	});	
	
	/*
	$(".panel-col-first ul li ul").css({display:'none'})
	
	$(".panel-col-last ul li").css({cursor:'pointer'})
	.click(function(){
		$(this).parent('ul').find('ul').animate({opacity:'hide', height:'hide'},'slow'); 
		$(this).find('ul').animate({opacity:'show', height:'show'},'slow'); 
		$(".panel-col-last ul li").css({backgroundPosition:'-228px 4px'});
		$(this).css({backgroundPosition:'256px 4px'})
	});	
	$(".panel-col-last ul li ul").css({display:'none'})*/
	
	
	$(".panel-col-first ul h3").css({cursor:'pointer'});
	$(".panel-col-first ul li ul li").wrapInner("<div>");


	$('.panel-col-first ul').each(function(){ $(this).Accordion({
			active: false,
			header: 'h3',
			showSpeed: 400,
			hideSpeed: 400,
			navigation: true,
			event: 'click',
			fillSpace: true,
			alwaysOpen: false, 
			animated: 'easeslide'
		})
	});
	

	$(".panel-col-last ul h3").css({cursor:'pointer'});
	$(".panel-col-last ul li ul li").wrapInner("<div>");

$('.panel-col-last ul').each(function(){ $(this).Accordion({
		active: false,
		header: 'h3',
		showSpeed: 400,
		hideSpeed: 400,
		navigation: true,
		event: 'click',
		fillSpace: true,
		alwaysOpen: false, 
		animated: 'easeslide'
	})
});
	
/*
	$('.panel-col-last ul').Accordion({
		active: false,
		header: 'h3',
		showSpeed: 400,
		hideSpeed: 400,
		navigation: true,
		event: 'click',
		fillSpace: true,
		alwaysOpen: false, 
		animated: 'easeslide'
	});
*/
	
	
	
		var resizeBg = function(){ 
		
			var h = $(window).height();
			var w = $(window).width();
	
	/*
	var h = 879;
	var w = 1485;
	
	*/
	
			//var prop = $("#bg img").width() / $("#bg img").height();
			var prop = 1485 / 879;
			//alert($("#bg img").height());
		//	alert(prop);
			
			/*
			
			var headerHeight = 218;
			var footerHeight = 103;
			
			var minHeight = 415;
			var maxHeight = 500;
			
			var tempHeight = h - (headerHeight + footerHeight);
			*/
			//alert (tempHeight);
			
			
			if(w > h){
				if((w*(879 / 1485)) > h){
					prop = 879 / 1485;
					$("#bg img").width(w);
					$("#bg img").height(w*prop);
				}else{
					$("#bg img").height(h);
					$("#bg img").width(h*prop);
				}
				
				
			}else{
	
				$("#bg img").height(h);
				$("#bg img").width(h*prop);
			}
			

			
			/*
			if(tempHeight < minHeight){
				$("#homePagecontent").height(minHeight);
				//alert ("in tempHeight lest than min: " + tempHeight)
			} else if (tempHeight > maxHeight){
				$("#homePagecontent").height(maxHeight);
				//alert ("in tempHeight greater than max: " + tempHeight)
			} else if (tempHeight > minHeight && tempHeight < maxHeight) {
				$("#homePagecontent").height(tempHeight);
				//alert ("in between: " + tempHeight)
			}
	*/
		}
		if($.browser.msie){
			resizeBg();
		}
			

		
		$(window).resize(function(){
			if($.browser.msie){
				resizeBg();
			}
		});
			






	
});
/*
$(document).ready(function() {
	var $winwidth = $(window).width();
	$("#bg img").attr({
		width: $winwidth
	});
	$(window).bind("resize", function(){
		var $winwidth = $(window).width();
		$("#bg imge").attr({
			width: $winwidth
		});
	 });
});
*/