var addr_ar = document.location.toString().split('/');

Cufon.replace('#sub .box h5, #info h5', { fontFamily: 'Calibri', hover: true });


function goToByScroll(id){
		$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}

$(document).ready(function () {

$("#top-menu li a").each(function(){
    if($(this).attr("href") == addr_ar[addr_ar.length - 1]){
        $(this).addClass("current");
    }
});
$(".MojeSubmenu li a").each(function(){
    if($(this).attr("href") == addr_ar[addr_ar.length - 1]){
        $(this).addClass("current");
    }
});

	// Expand Panel
	$("#open").click(function(){
		$("div#panel").slideDown("slow");
	
	});	
	
	// Collapse Panel
	$("#close").click(function(){
		$("div#panel").slideUp("slow");	
	});		
	
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle a").click(function () {
		$("#toggle a").toggle();
	});

    $('a[href=#scrollme]').click(function(){
        $('html, body').animate({scrollTop:0}, 'slow');
        return false;
    });


    $("#data-nav li a").click(function() {
        var curList = $("#data-nav li a.current").attr("rel");
        var curListHeight = $("#data-rotate").height();
        $("#data-nav li a").removeClass("current");
        $(this).addClass("current");
        var listID = $(this).attr("rel");
        if (listID != curList) {
            $("#"+curList).fadeOut(0, function() {
                $("#"+listID).fadeIn();
                var newHeight = $("#"+listID).height();
            });
        }        
        return false;
    });


});


