$(document).ready(function(){

$("#auto").hover(

		function() {$(this).css("margin-top","-17px")},function() {$(this).css("margin-top","0px")}

	);
$("#back").hide();

$(".switch").hover(

		function() {$(this).css("margin-top","-17px")},function() {$(this).css("margin-top","0px")}

	);
$(".back").hover(

		function() {$(this).css("margin-top","-17px")},function() {$(this).css("margin-top","0px")}

	);

$("#tmpSlideshowControls").hide();

//index image animation

var c = 0;	

$(".switch").click(

		function(){

			if(c == 0){

				$("#img_l").attr("src","images/sum.jpg");

				$("#mainslide").animate({height:"540px"},1000);

				$(".banner_feature").animate({top:"495px"},1000);

				$(this).css("margin-left","-67px");

				$(this).attr("id","up");

				c = 1;

			} else {

				$("#mainslide").animate({height:"270px"},1000, function(){$("#img_l").attr("src","images/sum_s.jpg")});

				$(".banner_feature").animate({top:"225px"},1000);

				$(this).css("margin-left","0px");

				$(this).attr("id","down");

				c = 0;

		}

	});

		

$("#auto").click(

	function(){$(".banner_feature").animate({top:"225px"},1000);$("#mainslide").animate({height:"270px"},1000,function(){$("#mainslide").load("slide.html")})}

);



$("#n1").css("background", "url(images/left_on.png) repeat-x");



$("#l1").css("border-bottom", "none");



//tab-slide animation

$(".slider > li a").hover(function(e){

	switch(e.target.id){

		case "n1":

			$(".slider > li a").css("background", "");

			$(this).css("background", "url(images/left_on.png) repeat-x");

			$(".slider > li").css("border-bottom", "1px solid #ccc");

			$("#l1").css("border-bottom", "none");

			$(".tab").hide();

			$("#t1").fadeIn();

		break;

		case "n2":

			$(".slider > li a").css("background", "");

			$(this).css("background", "url(images/left_on.png) repeat-x");

			$(".slider > li").css("border-bottom", "1px solid #ccc");

			$("#l2").css("border-bottom", "none");

			$(".tab").hide();

			$("#t2").fadeIn();

		break;

		case "n3":

			$(".slider > li a").css("background", "");

			$(this).css("background", "url(images/left_on.png) repeat-x");

			$(".slider > li").css("border-bottom", "1px solid #ccc");

			$("#l3").css("border-bottom", "none");

			$(".tab").hide();

			$("#t3").fadeIn();

		break;

	}

	return false;

});

$(".lev1 > li a").hover(
		function(){$(this).css("background","#FFF")},
		function(){$(this).css("background","#F8F8F8")}
	);
$(".lev2 > li a").hover(
		function(){$(this).css("background","#F8F8F8 url(images/ullev2bac.png) top right repeat-y")},
		function(){$(this).css("background","#FFF url(images/ullev2bac.png) top right repeat-y")}
	);
	
	
$("#auto6").hover(

		function() {$(this).css("margin-top","-17px")},function() {$(this).css("margin-top","0px")}

	);
	
var cc = 1;	

$("#auto6").click(
		function(){
		$("#down").hide();
		$("#up").hide();
		$("#back").show();
		$("#tmpSlideshowControls").show();
		$(".banner_feature").animate({top:"215px"},50);
		$("#mainslide").animate({height:"270px"},50,function(){
		if(cc == 13){
				$("#img_l").attr("src","images/01.jpg").fadeIn();
				cc = 1;
				$(".c2").hide();$(".c1").show();
				$("li.item").css("color","white");$("#s"+cc).css("color","#006f6a");
				cc = 2;
			} else {
				$("#img_l").attr("src","images/0"+cc+".jpg").fadeIn();	
				$("li.item").css("color","white");$("#s"+cc).css("color","#006f6a");	
				if(cc == 7){$(".c1").hide();$(".c2").show();};
				cc = cc+1;
		}
		});	
	});
});
