
// cartoon:
var galleryPos2 = 0;
var start2 = 1;
var dx2 = 621;


// covers:
var galleryPos3 = 0;
var start3 = 1;
var dx3 = 625





window.addEvent("domready",function() {

	//new SmoothScroll({ duration:700 }, window); //700 milliseconds to get there

	var mySmoothScroll = new Fx.SmoothScroll({
		wheelStops: false
	});

    $$("a.toggler").each(function(el){
    	el.addEvent("click", function() {
    		if ($("box-" + el.id).getStyle("display") == "none") {
				$("box-" + el.id).setStyle("display", "block");
			} else {
				$("box-" + el.id).setStyle("display", "none");
			}
    	});
    });



    // homepage thumb slike:
    if ($("rotator-container2")) {
        rc2 = $("rotator-container2");
        $$("img.arrow-home").each(function(el){
            el.addEvents({
                "click" : function() {
                    if (el.src.indexOf("lleft.gif") > 0) {
                        // left button:
                        if (start2 > 1) {
                            galleryPos2 += dx2;
                            rc2.tween('margin-left',  galleryPos2+"px");
                            start2 -= 1;
                        }
                    } else {
                        // right button:
                        if (start2 < total2) {
                            galleryPos2 -= dx2;
                            rc2.tween('margin-left',  galleryPos2+"px");
                            start2 += 1;
                        }
                    }
                }
            })
        })
    }




    if ($("rotator-container3")) {
        rc3 = $("rotator-container3");
        $$("img.arrow-home3").each(function(el){
            el.addEvents({
                "click" : function() {
                    if (el.src.indexOf("lleft.gif") > 0) {
                        // left button:
                        if (start3 > 1) {
                            galleryPos3 += dx2;
                            rc3.tween('margin-left',  galleryPos3+"px");
                            start3 -= 1;
                        }
                    } else {
                        // right button:
                        if (start3 < total3) {
                            galleryPos3 -= dx3;
                            rc3.tween('margin-left',  galleryPos3+"px");
                            start3 += 1;
                        }
                    }
                }
            })
        })
    }

})









