// JavaScript Document
function externalLinks() {
 	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
			if (anchor.getAttribute("href") &&
				anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
	}
}
window.onload = externalLinks;



/*
function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
*/


/* CONFIG  */
$(document).ready(function() {
    
    
      


         $(".infotext").each(function(){
             var tt = $("#box").attr("title");
             $.facebox("<p> " + tt + " </p>");
             
                //zaverni infoboxu
                setTimeout(function(){
                   $.facebox.close();
                }, 3000);
         });
         
         
         $(".counter").click(function(){             
             var id = $(this).attr("content");             
             $.post("http://127.0.0.1/crea/dokumenty/stahnout/", {queryID: "" + id + ""}, function(data){
                 
                             
             });
         });
         
         $('a[rel*=facebox]').facebox();
         
         //$('#mycarousel').jcarousel();
         
         /*
         $('#mycarousel').jcarousel({                
                auto: 2,
                wrap: 'last',
                initCallback: mycarousel_initCallback
         });
         */
         

});


$(window).load(function() {
    $("div#makeMeScrollable").smoothDivScroll({ 
	autoScroll: "onstart" , 
	autoScrollDirection: "endlessloopright", 
	autoScrollStep: 1, 
	autoScrollInterval: 15
    });
});
