$(function(){
	
	var url = location.href;
    var href = url.split('/')[url.split('/').length - 1].split('.')[0].substr(0, 3).toLowerCase();
    if (href.length > 0) {
        $(".abnav li a").removeClass();
        $(".menu li a").removeClass();

        $(".abnav li a[href^=" + href + "]").addClass("hover")

        //if (href == "abo" || href == "vie" || href == "coo" || href == "eve") {
        //    $(".menu li a[href^=abo]").addClass("hover")
        //} else {
        //    $(".menu li a[href^=" + href + "]").addClass("hover")
        //}
    }
	
	$(".ysc div").scrollable({size:4,loop:true,items:".ysc div ul",prev:".prev",next:".next"});
	
	$(".showsrc div").scrollable({size:4,loop:true,items:".showsrc div ul",prev:".prev",next:".next"});
	
	$(".sbs").scrollable({size:1,loop:true,items:".sbs ul",prev:".prev",next:".next",item:"li",hoverClass:"hover"});
	
	$(".showbox2 ins.num b").text( $(".sbs ul li").size() );
	
	$(".showbox2 a.pn").click(function(){
		setTimeout(function(){
		if( Math.ceil(Math.abs(parseInt($(".sbs ul").css("left"))/500))<1 )
		{
			$(".showbox2 ins i").text(1);
		}
		else if( Math.ceil(Math.abs(parseInt($(".sbs ul").css("left"))/500))==1 )
		{
			$(".showbox2 ins i").text(2);
		}
		else
		{
			$(".showbox2 ins i").text(Math.ceil(Math.abs(parseInt($(".sbs ul").css("left"))/500))+1);
		}
		},400);
		
	});
	
	$(".showsrc div ul li a").click(function(){
		$(".bigpic img").attr("src",$(this).attr("href"));
		return false;
	});
	
	if( parseInt($(window).height())> parseInt($(".main").height()) )
	{
	    var wh = $(window).height();

	    if (parseInt(wh) > parseInt($(".main").height())) {
	        $("body").css({ "padding-top": (parseInt(wh) - parseInt($(".main").height())) / 2 });
	    }
		
		$(window).resize(function(){
		    var wh = $(window).height();

		    if (parseInt(wh) > parseInt($(".main").height())) {
		        $("body").css({ "padding-top": (parseInt(wh) - parseInt($(".main").height())) / 2 });
		    }
		});
	}
	
});

function height(){
	
	var wh=$(window).height();
	
	if( parseInt(wh)>parseInt($(".main").height()))
	{
		$("body").css({"padding-top": (parseInt(wh)-parseInt($(".main").height()))/2 });
	}
}
