$(document).ready(function(){	

	// Tooltip
	$("a").easyTooltip();
	$("img").easyTooltip();
	$("input").easyTooltip();
	$("h6").delayedTooltip();


	// Toggle (Infobox)
	$(".toggle_container").hide();

	$("h6").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$("h6").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});



// Hover Styles btnBox
$(".btnBox").hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);



});





/* Tablesorter */
function sorttableschadstoffmob() {
	
// add new widget called repeatHeaders 
$.tablesorter.addWidget({ 
    // give the widget a id 
    id: "repeatHeaders", 
    // format is called when the on init and when a sorting has finished 
    format: function(table) { 
        // cache and collect all TH headers 
        if(!this.headers) { 
            var h = this.headers = [];  
            $("thead th",table).each(function() { 
                h.push( 
                    "" + $(this).text() + "" 
                ); 
                 
            }); 
        } 
         
        // remove appended headers by classname. 
        $("tr.repated-header",table).remove(); 
         
        // loop all tr elements and insert a copy of the "headers"     
        for(var i=0; i < table.tBodies[0].rows.length; i++) { 
            // insert a copy of the table head every 10th row 
            if((i%5) == 4) { 
                $("tbody tr:eq(" + i + ")",table).before( 
                    $("").html(this.headers.join("")) 
                 
                );     
            } 
        } 
    } 
}); 
	
	
        $.tablesorter.addParser({
              id: 'germandate',
              is: function(s) {
                      return false;
              },
              format: function(s) {
                var a = s.split('.');
                a[1] = a[1].replace(/^[0]+/g,"");
                return new Date(a.reverse().join("/")).getTime();
              },
              type: 'numeric'
            });
        $("table").tablesorter({
			    widgets: ['zebra'],
                headers: { 1: { sorter:'germandate' }}, sortList: [[0,0]]
        });
};




/* Tablesorter no date*/
function sorttable() {
	
// add new widget called repeatHeaders 
$.tablesorter.addWidget({ 
    // give the widget a id 
    id: "repeatHeaders", 
    // format is called when the on init and when a sorting has finished 
    format: function(table) { 
        // cache and collect all TH headers 
        if(!this.headers) { 
            var h = this.headers = [];  
            $("thead th",table).each(function() { 
                h.push( 
                    "" + $(this).text() + "" 
                ); 
                 
            }); 
        } 
         
        // remove appended headers by classname. 
        $("tr.repated-header",table).remove(); 
         
        // loop all tr elements and insert a copy of the "headers"     
        for(var i=0; i < table.tBodies[0].rows.length; i++) { 
            // insert a copy of the table head every 10th row 
            if((i%5) == 4) { 
                $("tbody tr:eq(" + i + ")",table).before( 
                    $("").html(this.headers.join("")) 
                 
                );     
            } 
        } 
    } 
}); 
	
	
      
        $("table").tablesorter({
			    widgets: ['zebra'], sortList: [[0,0]]
        });
};





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




