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

	$('.rotate').mouseover(function() {
		var img = $(this);
		var arrayname = img.attr('id') + 'list';
		var thumbs = new Array();
		eval('thumbs = ' + arrayname);
		
		for(var i in thumbs) {
			setInterval(function() {
				img.attr('src', thumbs[i]);
			}, 100);			
		}
	});
	
	$('.rotate').mouseout(function() {
		var varname = $(this).id;
		eval('$(this).src = ' + varname);
	});

});*/

var animated;

function animate(obj, dir, arr) {
	var counter = 0;
	var img 	= obj;
	var server 	= dir;
	var ims 	= arr;
	
	animated = setInterval(function() {
		img.src = server+ims[counter];
		counter++;
		if(counter >= ims.length) {
			counter = 0;
		}
	}, 500);
}

function stop(obj, im) {
	clearInterval(animated);
	obj.src = im;
}



$(document).ready(function(){
    //$('p').hide();
    // note we add 'p' into the selection range
    $('a#category-link,div#category-list').mouseover(function(){
        // and we check for out timeout, clearing if needed.
        if(window.willhide) clearTimeout(window.willhide);
        $('div#category-list').show('fast');
    });
    
    // again, selecting 'p' too
    $('a#category-link,div#category-list').mouseout(function(){
        // and setting that timeout to do the work for us
        window.willhide = setTimeout(function() {
            $('div#category-list').hide('slow');
        },750); // with a 750 ms delay
    });
    
    $("a.bookmark").click(function(e){
    	e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
    	var bookmarkUrl = this.href;
    	var bookmarkTitle = this.title;
     
    	if (window.sidebar) { // For Mozilla Firefox Bookmark
    		window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"DigiPorno");
    	} else if( window.external || document.all) { // For IE Favorite
    		window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
    	} else { // for other browsers which does not support
    		 alert('Prosím stiskněte CTRL + D pro vložení do záložek');
    		 return false;
    	}
    });
});
