$jq132(function() {
	
	$jq132('input.aqq').
    focus(function() {
        if(this.title==this.value) {
            this.value = '';
        }
    }).
    blur(function(){
        if(this.value=='') {
            this.value = this.title;
        }
    });
	
	var currentPage = 1;
    $jq132('#slider .buttons span').live('click', function() {
        var timeout = setTimeout(function() {$jq132("img").trigger("slidermove")}, 300);
        var fragments_count = $jq132(this).parents('#slider:eq(0)').find('.fragment').length;
        var fragmet_width = $jq132(this).parents('#slider:eq(0)').find('.fragment').width();
        var perPage = 1;
        var numPages = Math.ceil(fragments_count/perPage);
        var stepMove = fragmet_width*perPage;
        var container = $jq132(this).parents('#slider:eq(0)').find('.content');
        var firstPosition = 0;
        var lastPosition = -((numPages-1)*stepMove);
        
        if ($jq132(this).hasClass('next')) {
            currentPage ++;
            if (currentPage > numPages) {
                currentPage = 1;
                container.animate({'left': firstPosition});
                return;
            };
            container.animate({'left': -((currentPage - 1)*stepMove)});
        };
        if ($jq132(this).hasClass('prev')) {
            currentPage --;
            if (currentPage < 1) {
                currentPage = numPages;
                container.animate({'left': lastPosition});
                return;
            };
            container.animate({'left': -((currentPage-1)*stepMove)});
        };
    });
		
		
	var currentPage = 1;
    $jq132('#slider_gallery .buttons span').live('click', function() {
        var timeout = setTimeout(function() {$jq132("img").trigger("slidermove")}, 300);
        var fragments_count = $jq132(this).parents('#slider_gallery:eq(0)').find('.fragment').length;
        var fragmet_width = $jq132(this).parents('#slider_gallery:eq(0)').find('.fragment').width();
        var perPage = 1;
        var numPages = Math.ceil(fragments_count/perPage);
        var stepMove = fragmet_width*perPage;
        var container = $jq132(this).parents('#slider_gallery:eq(0)').find('.content');
        var firstPosition = 0;
        var lastPosition = -((numPages-1)*stepMove);
        
        if ($jq132(this).hasClass('next')) {
            currentPage ++;
            if (currentPage > numPages) {
                currentPage = 1;
                container.animate({'left': firstPosition});
                return;
            };
            container.animate({'left': -((currentPage - 1)*stepMove)});
        };
        if ($jq132(this).hasClass('prev')) {
            currentPage --;
            if (currentPage < 1) {
                currentPage = numPages;
                container.animate({'left': lastPosition});
                return;
            };
            container.animate({'left': -((currentPage-1)*stepMove)});
        };
    });
		
		
	var currentPage = 1;
    $jq132('#slider_news_multi .buttons span').live('click', function() {
        var timeout = setTimeout(function() {$jq132("img").trigger("slidermove")}, 300);
        var fragments_count = $jq132(this).parents('#slider_news_multi:eq(0)').find('.fragment').length;
        var fragmet_width = $jq132(this).parents('#slider_news_multi:eq(0)').find('.fragment').width();
        var perPage = 1;
        var numPages = Math.ceil(fragments_count/perPage);
        var stepMove = fragmet_width*perPage;
        var container = $jq132(this).parents('#slider_news_multi:eq(0)').find('.content');
        var firstPosition = 0;
        var lastPosition = -((numPages-1)*stepMove);
        
        if ($jq132(this).hasClass('next')) {
            currentPage ++;
            if (currentPage > numPages) {
                currentPage = 1;
                container.animate({'left': firstPosition});
                return;
            };
            container.animate({'left': -((currentPage - 1)*stepMove)});
        };
        if ($jq132(this).hasClass('prev')) {
            currentPage --;
            if (currentPage < 1) {
                currentPage = numPages;
                container.animate({'left': lastPosition});
                return;
            };
            container.animate({'left': -((currentPage-1)*stepMove)});
        };
    });
		
});
