<\/p><\/a><\/li>");
});
jQuery("div#thumbSlider" + j + " a").each(function(z) {
jQuery(this).bind("click", function(){
jQuery(this).find("p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity});
jQuery(this).parent().parent().find("p.tmbrdr").not(jQuery(this).find("p.tmbrdr")).css({borderColor: settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity});
var cnt = -(pictWidth*z);
(cnt != container.find("ul").css("left").replace(/px/, "")) ? container.find("span.typo").animate({"opacity": 0}, 250) : null ;
container.find("ul").animate({ left: cnt}, settings.easeTime, settings.easeFunc, function(){container.find("span.typo").animate({"opacity": settings.typoFullOpacity}, 250)});
return false;
});
});
// shortcuts to +/- buttons
var jQuerybtl = jQuery("a#left" + j);
var jQuerybtr = jQuery("a#right" + j);
// right/left
jQuerybtr.bind("click", function(){
if (r_enabled) (pictEls-pos > settings.thumbs*2 || pictEls%settings.thumbs == 0)? pos += settings.thumbs : pos += pictEls % settings.thumbs;
r_enabled = false;
jQuery(this).prev().prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
return false;
});
jQuerybtl.bind("click", function(){
if (l_enabled && pos!=0) (pictEls-pos > settings.thumbs || pictEls%settings.thumbs == 0)? pos -= settings.thumbs : pos -= pictEls % settings.thumbs;
l_enabled = false;
jQuery(this).prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
return false;
});
function authorityMixing()
{
//right btt
(pos == pictEls-settings.thumbs) ? jQuerybtr.addClass("r_dis") : jQuerybtr.removeClass("r_dis");
(pos == pictEls-settings.thumbs) ? r_enabled = false : r_enabled = true;
//left btt
(pos == 0) ? jQuerybtl.addClass("l_dis") : jQuerybtl.removeClass("l_dis");
(pos == 0) ? l_enabled = false : l_enabled = true;
}
//CSS defs @ runtime
var tBorder = settings.thumbsBorderWidth;
var contBorder = settings.galBorderWidth
jQuery(".slideViewer a img").css({border: "0"});
if(settings.typo)
{
jQuery(this).find("span.typo").each(function(z) {
jQuery(this).css({marginTop: (pictHeight-jQuery(this).innerHeight()), opacity: settings.typoFullOpacity});
});
}
jQuery("div#svwp"+ j).css({border: settings.galBorderWidth +"px solid "+settings.galBorderColor});
jQuery("div#thumbSlider" + j).css({position: "relative", left: contBorder, top: settings.thumbsTopMargin+"px", width: settings.thumbs*thumbsWidth+((settings.thumbsRightMargin*settings.thumbs)-settings.thumbsRightMargin), height: thumbsHeight, textAlign: "center", overflow: "hidden", margin: "0 auto"});
jQuery("div#thumbSlider" + j + " ul").css({width: (thumbsWidth*pictEls)+settings.thumbsRightMargin*pictEls, position: "relative", left: "0", top: "0"});
jQuery("div#thumbSlider" + j + " ul li").css({marginRight: settings.thumbsRightMargin});
jQuery("div#thumbSlider" + j).find("p.tmbrdr").css({width: (thumbsWidth-tBorder*2)+"px", height: (thumbsHeight-tBorder*2) +"px", top: -(thumbsHeight) +"px", border: settings.thumbsBorderWidth +"px solid "+settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity});
jQuery("div#thumbSlider" + j + " a:first p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity});
var rbttLeftMargin = (pictWidth/2) + (jQuery("div#thumbSlider" + j).width()/2) + settings.thumbsRightMargin + contBorder;
var lbttLeftMargin = (pictWidth/2) - (jQuery("div#thumbSlider" + j).width()/2) - (settings.buttonsWidth + settings.thumbsRightMargin) + contBorder;
var innerLeftImg = jQuerybtl.find("img");
var innerRightImg = jQuerybtr.find("img");
if(innerLeftImg.length != 0 && innerRightImg.length != 0)
{
jQuery(innerLeftImg).load(function() {
jQuery(this).css({margin: Math.round((thumbsHeight/2)-(jQuery(this).height()/2))+"px 0 0 0"});
});
jQuery(innerRightImg).load(function() {
jQuery(this).css({margin: Math.round((thumbsHeight/2)-(jQuery(this).height()/2))+"px 0 0 0"});
});
}
jQuery("a#left" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px" , height: thumbsHeight+"px", margin: -(thumbsHeight-settings.thumbsTopMargin) +"px 0 0 "+lbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor});
jQuery("a#right" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px", height: thumbsHeight+"px" , margin: -(thumbsHeight) +"px 0 0 "+rbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor});
authorityMixing();
if(settings.autoslide){
var i = 1;
jQuery("div#thumbSlider" + j).everyTime(settings.asTimer, "asld", function() {
jQuery(this).find("a").eq(i).trigger("click");
if(i == 0)
{
pos = 0;
l_enabled = false;
jQuery("div#thumbSlider" + j).find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
}
else l_enabled = true;
(i%settings.thumbs == 0)? jQuery(this).next().next().trigger("click") : null;
(i < pictEls-1)? i++ : i=0;
});
//stops autoslidemode
jQuery("a#right" + j).bind("mouseup", function(){
jQuery(this).prev().prev().stopTime("asld");
});
jQuery("a#left" + j).bind("mouseup", function(){
jQuery(this).prev().stopTime("asld");
});
jQuery("div#thumbSlider" + j + " a").bind("mouseup", function(){
jQuery(this).parent().parent().parent().stopTime("asld");
});
}
var uiDisplay = (settings.thumbsVis)? "block":"none";
jQuery("div#thumbSlider" + j + ", a#left" + j + ", a#right" + j).wrapAll("
<\/div>");
jQuery("div#svwp" + j + ", div#ui" + j).wrapAll("
<\/div>");
});
(jQuery("div#thumbSlider" + j).width()+(settings.buttonsWidth*2) >= pictWidth)? alert("ALERT: THE THUMBNAILS SLIDER IS TOO WIDE! \nthumbsPercentReduction and/or buttonsWidth needs to be scaled down!") : null;
j++;
});
};