$(document).ready(function(){
	
	$('#regular_header ul#subhome_menu a').click(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		$(this).parent().parent().next('').children('.current').fadeOut('fast',function() {
			$(this).removeClass('current');
			$(this).parent().children('div:nth-child('+curChildIndex+')').fadeIn('fast',function() {
				$(this).addClass('current');
			});
		});
		return false;
	});


function minimize(dude1,dude2,dude3) {
	$(dude1+' ul img').stop().animate({width: "140px", height: "117px", padding: "17px"}, 400);
	/*$(dude1+' ul .style_img_0 img').removeClass('inTheShadow');*/
	$(dude2+' ul img').stop().animate({width: "140px", height: "117px", padding: "17px"}, 400);
	/*$(dude2+' ul .style_img_0 img').removeClass('inTheShadow');*/
	$(dude3+' ul img').stop().animate({width: "140px", height: "117px", padding: "17px"}, 400);
	/*$(dude3+' ul .style_img_0 img').removeClass('inTheShadow');*/
}
function normalize(dude1,dude2,dude3) {
	$(dude1+' ul img').stop().animate({width: "174px", height: "145px", padding: "0"},{queue:true, duration:400});
	/*$(dude1+' ul .style_img_0 img').addClass('inTheShadow');*/
	$(dude2+' ul img').stop().animate({width: "174px", height: "145px", padding: "0"},{queue:true, duration:400});
	/*$(dude2+' ul .style_img_0 img').addClass('inTheShadow');*/
	$(dude3+' ul img').stop().animate({width: "174px", height: "145px", padding: "0"},{queue:true, duration:400});
	/*$(dude3+' ul .style_img_0 img').addClass('inTheShadow');*/
}

 
    $(".style_1").hover(function() {				 
			minimize(".style_2",".style_3",".style_4");			 
			$(".style_cursor").removeClass('nonvisible');
			$(".style_cursor").stop().animate({"left": "62px"}, "400");
			$(".style_2 h2").removeClass('style_hl');
			$(".style_3 h2").removeClass('style_hl');
			$(".style_4 h2").removeClass('style_hl');
			$(".style_1 h2").addClass('style_hl');
		$(".style_2").removeClass('focuson');
		$(".style_3").removeClass('focuson');
		$(".style_4").removeClass('focuson');
		$(this).addClass('focuson');
		$(".style_1 .style_img_1").stop().animate({ marginLeft: "-20px" }, 200);
        $(".style_1 .style_img_2").stop().animate({ marginLeft: "60px" }, 200);
		$(".style_1 .style_img_3").stop().animate({ marginLeft: "140px" }, 200);
    },function(){
		normalize(".style_2",".style_3",".style_4");
		$(".style_1 .style_img_1").stop().animate({ marginLeft: "0px" }, 400);
        $(".style_1 .style_img_2").stop().animate({ marginLeft: "0px" }, 400);
		$(".style_1 .style_img_3").stop().animate({ marginLeft: "0px" }, 400);	
    });
	
	$(".style_2").hover(function() {
			minimize(".style_1",".style_3",".style_4");		
			$(".style_cursor").removeClass('nonvisible');
			$(".style_cursor").stop().animate({"left": "314px"}, "400");
			$(".style_1 h2").removeClass('style_hl');
			$(".style_3 h2").removeClass('style_hl');
			$(".style_4 h2").removeClass('style_hl');
			$(".style_2 h2").addClass('style_hl');
		$(".style_1").removeClass('focuson');
		$(".style_3").removeClass('focuson');
		$(".style_4").removeClass('focuson');
		$(this).addClass('focuson');				 
        $(".style_2 .style_img_1").stop().animate({ marginLeft: "-80px" }, 200);
		$(".style_2 .style_img_3").stop().animate({ marginLeft: "80px" }, 200);
    },function(){
		normalize(".style_1",".style_3",".style_4");	
        $(".style_2 .style_img_1").stop().animate({ marginLeft: "0px" }, 400);
		$(".style_2 .style_img_3").stop().animate({ marginLeft: "0px" }, 400);
    });
	
	$(".style_3").hover(function() {
			minimize(".style_1",".style_2",".style_4");		
			$(".style_cursor").removeClass('nonvisible');
			$(".style_cursor").stop().animate({"left": "565px"}, "400");
			$(".style_1 h2").removeClass('style_hl');
			$(".style_2 h2").removeClass('style_hl');
			$(".style_4 h2").removeClass('style_hl');
			$(".style_3 h2").addClass('style_hl');
		$(".style_1").removeClass('focuson');
		$(".style_2").removeClass('focuson');
		$(".style_4").removeClass('focuson');
		$(this).addClass('focuson');				 
        $(".style_3 .style_img_1").stop().animate({ marginLeft: "-80px" }, 200);
		$(".style_3 .style_img_3").stop().animate({ marginLeft: "80px" }, 200);
    },function(){
		normalize(".style_1",".style_2",".style_4");	
        $(".style_3 .style_img_1").stop().animate({ marginLeft: "0px" }, 400);
		$(".style_3 .style_img_3").stop().animate({ marginLeft: "0px" }, 400);
    });
	
	$(".style_4").hover(function() {
			minimize(".style_1",".style_2",".style_3");		
			$(".style_cursor").removeClass('nonvisible');
			$(".style_cursor").stop().animate({"left": "817px"}, "400");
			$(".style_1 h2").removeClass('style_hl');
			$(".style_2 h2").removeClass('style_hl');
			$(".style_3 h2").removeClass('style_hl');
			$(".style_4 h2").addClass('style_hl');
		$(".style_1").removeClass('focuson');
		$(".style_2").removeClass('focuson');
		$(".style_3").removeClass('focuson');
		$(this).addClass('focuson');
		$(".style_4 .style_img_1").stop().animate({ marginLeft: "-140px" }, 200);
        $(".style_4 .style_img_2").stop().animate({ marginLeft: "-60px" }, 200);
		$(".style_4 .style_img_3").stop().animate({ marginLeft: "20px" }, 200);
    },function(){
		normalize(".style_1",".style_2",".style_3");	
		$(".style_4 .style_img_1").stop().animate({ marginLeft: "0px" }, 400);
        $(".style_4 .style_img_2").stop().animate({ marginLeft: "0px" }, 400);
		$(".style_4 .style_img_3").stop().animate({ marginLeft: "0px" }, 400);
    });
	
/*---------headers---------*/
	
	  $(".style_1b").hover(function() {	 
		$(".style_cursor2").stop().animate({"left": "8px"}, "400");
		$(".style_2b").removeClass('focuson');
		$(".style_3b").removeClass('focuson');
		$(".style_4b").removeClass('focuson');
		$(this).addClass('focuson');
    },function(){
		
    });
	
	$(".style_2b").hover(function() {
		$(".style_cursor2").stop().animate({"left": "148px"}, "400");
		$(".style_1b").removeClass('focuson');
		$(".style_3b").removeClass('focuson');
		$(".style_4b").removeClass('focuson');
		$(this).addClass('focuson');				 
 
    },function(){

    });
	
	$(".style_3b").hover(function() {	
		$(".style_cursor2").stop().animate({"left": "288px"}, "400");
		$(".style_1b").removeClass('focuson');
		$(".style_2b").removeClass('focuson');
		$(".style_4b").removeClass('focuson');
		$(this).addClass('focuson');				 

    },function(){

    });
	
	$(".style_4b").hover(function() {
		$(".style_cursor2").stop().animate({"left": "425px"}, "400");
		$(".style_1b").removeClass('focuson');
		$(".style_2b").removeClass('focuson');
		$(".style_3b").removeClass('focuson');
		$(this).addClass('focuson');
    },function(){
		
    });
	
});
