/******************************************************************************* jquery.mb.components Copyright (c) 2001-2010. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy email: info@pupunzi.com site: http://pupunzi.com Licences: MIT, GPL ******************************************************************************/ /* * Name:jquery.mb.scrollable * Version: 1.5.7 */ (function($) { $.mbScrollable= { plugin:"mb.scroller", author:"MB", version:"1.5.7", defaults:{ dir:"horizontal", width:950, elementsInPage:4, elementMargin:2, shadow:false, height:"auto", controls:"#controls", slideTimer:600, autoscroll:false, scrollTimer:6000, nextCallback:function(){}, prevCallback:function(){} }, buildMbScrollable: function(options){ return this.each (function (){ this.options = {}; $.extend (this.options, $.mbScrollable.defaults); $.extend (this.options, options); var mbScrollable=this; mbScrollable.isVertical= mbScrollable.options.dir!="horizontal"; var controls=$(mbScrollable.options.controls); mbScrollable.idx=1; mbScrollable.scrollTo=0; mbScrollable.elements= $(mbScrollable).children(); mbScrollable.elements.addClass("scrollEl"); controls.hide(); $(mbScrollable).children().each(function(){$(this).wrap("
");}); if (mbScrollable.options.shadow){ $(mbScrollable.elements).css("-moz-box-shadow",mbScrollable.options.shadow); $(mbScrollable.elements).css("-webkit-box-shadow",mbScrollable.options.shadow); } mbScrollable.elements= $(mbScrollable).children(); var eip= mbScrollable.options.elementsInPage2?mbScrollable.options.elementMargin/(mbScrollable.options.elementsInPage):0; if(mbScrollable.isVertical) $(mbScrollable).css({overflow:"hidden", height:mbScrollable.options.height-adj,width:mbScrollable.options.width, paddingRight:5, position:"relative"}); else $(mbScrollable).css({overflow:"hidden", width:mbScrollable.options.width-adj,height:mbScrollable.options.height,paddingBottom:5, position:"relative"}); var mbscrollableStrip=$("
").css({width:mbScrollable.elementsDim, position:"relative"}); $(mbScrollable.elements).wrapAll(mbscrollableStrip); mbScrollable.mbscrollableStrip=$(mbScrollable).find(".scrollableStrip"); $(mbScrollable.elements).hover( function(){ // console.debug(mbScrollable.autoScrollActive); if(mbScrollable.autoScrollActive) $(mbScrollable).mbStopAutoscroll(); }, function(){ if(mbScrollable.autoScrollActive) $(mbScrollable).mbAutoscroll(); }); if(mbScrollable.options.autoscroll && mbScrollable.elements.size()>mbScrollable.options.elementsInPage){ mbScrollable.autoScrollActive=true; $(mbScrollable).mbAutoscroll(); } $(mbScrollable).mbPageIndex(); $(mbScrollable).mbActivateControls(); setTimeout(function(){ $(".scrollEl").fadeIn(); },1000); $(mbScrollable).mbManageControls(); }); }, mbNextPage: function(auto){ var mbScrollable= $(this).get(0); if (!auto) mbScrollable.autoScrollActive=false; if(mbScrollable.idx==mbScrollable.totalPages){ $(mbScrollable).mbManageControls(); return; } if (mbScrollable.options.nextCallback) mbScrollable.options.nextCallback(); var adj= $.browser.safari && mbScrollable.options.elementsInPage>2?mbScrollable.options.elementMargin/mbScrollable.options.elementsInPage:0; mbScrollable.scrollTo-=((mbScrollable.singleElDim+mbScrollable.options.elementMargin)*mbScrollable.options.elementsInPage)-adj; if (mbScrollable.isVertical){ if ((mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.height)) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.height; $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},mbScrollable.options.slideTimer); }else{ if ((mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.width)) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.width; $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},mbScrollable.options.slideTimer); } mbScrollable.idx+=1; $(this).mbManageControls(); }, mbPrevPage: function(auto){ var mbScrollable= $(this).get(0); if (!auto) mbScrollable.autoScrollActive=false; if(mbScrollable.idx==1){ $(mbScrollable).mbManageControls(); return; } if (mbScrollable.options.prevCallback) mbScrollable.options.prevCallback(); var adj= $.browser.safari && mbScrollable.options.elementsInPage>2?mbScrollable.options.elementMargin/mbScrollable.options.elementsInPage:0; mbScrollable.scrollTo+=((mbScrollable.singleElDim+mbScrollable.options.elementMargin)*mbScrollable.options.elementsInPage)+adj; if (mbScrollable.isVertical){ if (mbScrollable.scrollTo>=0) mbScrollable.scrollTo=0; $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},mbScrollable.options.slideTimer); }else{ if (mbScrollable.scrollTo>=0) mbScrollable.scrollTo=0; $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},mbScrollable.options.slideTimer); } mbScrollable.idx-=1; $(this).mbManageControls(); }, mbFirstPage: function(){ var mbScrollable= $(this).get(0); mbScrollable.autoScrollActive=false; mbScrollable.scrollTo=0; if (mbScrollable.isVertical){ $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},mbScrollable.options.slideTimer); }else{ $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},mbScrollable.options.slideTimer); } mbScrollable.idx=1; $(this).mbManageControls(); $(mbScrollable).mbStopAutoscroll(); }, mbLastPage: function(){ var mbScrollable= $(this).get(0); mbScrollable.autoScrollActive=false; if (mbScrollable.isVertical){ mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.height; $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},mbScrollable.options.slideTimer); }else{ mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.width; $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},mbScrollable.options.slideTimer); } mbScrollable.idx=mbScrollable.totalPages; $(mbScrollable).mbManageControls(); $(mbScrollable).mbStopAutoscroll(); }, mbPageIndex: function(){ var mbScrollable= $(this).get(0); var controls=$(mbScrollable.options.controls); var pages=controls.find(".pageIndex"); if (pages){ function getPage(i){ mbScrollable.scrollTo=-((mbScrollable.singleElDim+mbScrollable.options.elementMargin)*(mbScrollable.options.elementsInPage*(i-1))); if(mbScrollable.isVertical){ if (mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.height) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.height; $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},mbScrollable.options.slideTimer); }else{ if (mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.width) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.width; $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},mbScrollable.options.slideTimer); } mbScrollable.idx = Math.floor(i); $(mbScrollable).mbManageControls(); } var n=0; for(var i=1;i<=mbScrollable.totalPages;i++){ n++; var paging = ''; if (mbScrollable.totalPages>1) { if (i==1) paging = " "; else if (i==mbScrollable.totalPages) paging = " "; else paging = " "; }else{ paging = " "; } var p=$(paging+n+" <\/span>").bind("click",function(){ getPage($(this).html()); $(mbScrollable).mbStopAutoscroll(); mbScrollable.autoScrollActive=false; }); pages.append(p); }; } }, mbAutoscroll:function(){ var dir= "next"; var mbScrollable= $(this).get(0); mbScrollable.autoScrollActive=true; if(mbScrollable.autoscroll) return; var timer=mbScrollable.options.scrollTimer+mbScrollable.options.slideTimer; mbScrollable.autoscroll = true; mbScrollable.auto = setInterval(function(){ dir= mbScrollable.idx==1?"next":mbScrollable.idx==mbScrollable.totalPages?"prev":dir; if(dir=="next") $(mbScrollable).mbNextPage(true); else $(mbScrollable).mbPrevPage(true); },timer); $(mbScrollable).mbManageControls(); }, mbStopAutoscroll: function(){ var mbScrollable= $(this).get(0); mbScrollable.autoscroll = false; clearInterval(mbScrollable.auto); $(mbScrollable).mbManageControls(); }, mbActivateControls: function(){ var mbScrollable=$(this).get(0); var controls=$(mbScrollable.options.controls); controls.find(".first").bind("click",function(){$(mbScrollable).mbFirstPage();}); controls.find(".prev").bind("click",function(){$(mbScrollable).mbStopAutoscroll();$(mbScrollable).mbPrevPage();}); controls.find(".next").bind("click",function(){$(mbScrollable).mbStopAutoscroll();$(mbScrollable).mbNextPage();}); controls.find(".last").bind("click",function(){$(mbScrollable).mbLastPage();}); controls.find(".start").bind("click",function(){$(mbScrollable).mbAutoscroll();}); controls.find(".stop").bind("click",function(){$(mbScrollable).mbStopAutoscroll();mbScrollable.autoScrollActive=false;}); }, mbManageControls: function(){ var mbScrollable=$(this).get(0); var controls=$(mbScrollable.options.controls); if (mbScrollable.elements.size()<=mbScrollable.options.elementsInPage){ controls.hide(); }else{ controls.fadeIn(); } if (mbScrollable.idx==mbScrollable.totalPages){ controls.find(".last").addClass("disabled"); controls.find(".next").addClass("disabled"); }else{ controls.find(".last").removeClass("disabled"); controls.find(".next").removeClass("disabled"); } if (mbScrollable.idx==1){ controls.find(".first").addClass("disabled"); controls.find(".prev").addClass("disabled"); }else{ controls.find(".first").removeClass("disabled"); controls.find(".prev").removeClass("disabled"); } if (mbScrollable.autoscroll){ controls.find(".start").addClass("sel"); controls.find(".stop").removeClass("sel"); }else{ controls.find(".start").removeClass("sel"); controls.find(".stop").addClass("sel"); } controls.find(".page").removeClass("sel"); controls.find(".page").eq(mbScrollable.idx-1).addClass("sel"); controls.find(".idx").html(mbScrollable.idx+" / "+mbScrollable.totalPages); }, goToPage: function(i,noAnim) { var mbScrollable= $(this).get(0); var anim= noAnim?0:mbScrollable.options.slideTimer; if (i>mbScrollable.totalPages) i=mbScrollable.totalPages; mbScrollable.scrollTo=-((mbScrollable.singleElDim+mbScrollable.options.elementMargin)*(mbScrollable.options.elementsInPage*(i-1))); if(mbScrollable.isVertical){ if (mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.height) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.height; $(mbScrollable.mbscrollableStrip).animate({marginTop:mbScrollable.scrollTo},anim); }else{ if (mbScrollable.scrollTo<-mbScrollable.elementsDim+mbScrollable.options.width) mbScrollable.scrollTo=-mbScrollable.elementsDim+mbScrollable.options.width; $(mbScrollable.mbscrollableStrip).animate({marginLeft:mbScrollable.scrollTo},anim); } mbScrollable.idx = Math.floor(i); $(mbScrollable).mbManageControls(); $(mbScrollable).mbStopAutoscroll(); mbScrollable.autoScrollActive=false; } /* //WIP 1.6.0 mbAddElement: function(n){ var mbScrollable=$(this).get(0); var newEl=$(n); newEl.addClass("scrollEl"); $(mbScrollable).find(".scrollableStrip").append(newEl); newEl.wrap("
"); newEl.css({marginRight:mbScrollable.options.elementMargin, width:mbScrollable.singleElDim}); } */ }; $.fn.mbScrollable=$.mbScrollable.buildMbScrollable; $.fn.mbNextPage=$.mbScrollable.mbNextPage; $.fn.mbPrevPage=$.mbScrollable.mbPrevPage; $.fn.mbFirstPage=$.mbScrollable.mbFirstPage; $.fn.mbLastPage=$.mbScrollable.mbLastPage; $.fn.mbPageIndex=$.mbScrollable.mbPageIndex; $.fn.mbgotoPage=$.mbScrollable.gotoPage; $.fn.mbAutoscroll=$.mbScrollable.mbAutoscroll; $.fn.mbStopAutoscroll=$.mbScrollable.mbStopAutoscroll; $.fn.mbActivateControls=$.mbScrollable.mbActivateControls; $.fn.mbManageControls=$.mbScrollable.mbManageControls; $.fn.goToPage=$.mbScrollable.goToPage; // $.fn.mbAddElement=$.mbScrollable.mbAddElement; })(jQuery);var timeout = 500; var closetimer= 0; var ddmenuitem = 0; function jsddm_open() { jsddm_canceltimer(); jsddm_close(); ddmenuitem = $(this).find('ul').eq(0).css('display', 'block'); } function jsddm_close() {if(ddmenuitem) ddmenuitem.css('display', 'none');} function jsddm_timer() {closetimer = window.setTimeout(jsddm_close, timeout);} function jsddm_canceltimer() {if(closetimer) {window.clearTimeout(closetimer); closetimer = null;}} $(document).ready(function(){ $('#jsddm > li').bind('mouseover', jsddm_open); $('#jsddm > li').bind('mouseout', jsddm_timer); }); document.onclick = jsddm_close;function CookieManager() {} CookieManager.setCookie = function (sName, sValue, nDays) { var expires = ""; if (typeof nDays == "number") { var d = new Date(); d.setTime(d.getTime() + nDays * 24 * 60 * 60 * 1000); expires = "; expires=" + d.toGMTString(); } document.cookie = sName + "=" + escape(sValue) + expires + "; path=/"; }; CookieManager.getCookie = function (sName) { var re = new RegExp("(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)"); var res = re.exec(document.cookie); return res != null ? unescape(res[3]) : null; }; CookieManager.removeCookie = function (name) { CookieManager.setCookie(name, "", -1); }; /*function changeFont(newFontSize){ $('html').css('font-size', newFontSize); CookieManager.setCookie('font-size',newFontSize,999); return false; }*/ $(document).ready(function(){ // Reset Font Size var smallFontSize = 10; var originalFontSize = 11; var bigFontSize = 12; var cookiefontsize=CookieManager.getCookie('font-size'); var cookieFontSizeNum = parseFloat(cookiefontsize, 11); if ((cookieFontSizeNum>10)&&(cookieFontSizeNum<16)){ $('html').css('font-size', cookieFontSizeNum); if(cookieFontSizeNum==10) $('.smallFont').addClass('active'); if(cookieFontSizeNum==11) $('.resetFont').addClass('active'); if(cookieFontSizeNum==12) $('.bigFont').addClass('active'); CookieManager.setCookie('font-size',cookieFontSizeNum,999); }else{ $('html').css('font-size', originalFontSize); $('.resetFont').addClass('active'); CookieManager.setCookie('font-size',originalFontSize,999); } $(".resetFont").click(function(){ $('html').css('font-size', originalFontSize); $('.font-resize a').removeClass('active'); $(this).addClass('active'); CookieManager.setCookie('font-size',originalFontSize,999); return false; }); $(".smallFont").click(function(){ $('html').css('font-size', smallFontSize); $('.font-resize a').removeClass('active'); $(this).addClass('active'); CookieManager.setCookie('font-size',smallFontSize,999); return false; }); $(".bigFont").click(function(){ $('html').css('font-size', bigFontSize); $('.font-resize a').removeClass('active'); $(this).addClass('active'); CookieManager.setCookie('font-size',bigFontSize,999); return false; }); // Increase Font Size $(".increaseFont").click(function(){ var currentFontSize = $('html').css('font-size'); var currentFontSizeNum = parseFloat(currentFontSize, 11); $('.font-resize a').removeClass('active'); if (currentFontSizeNum<16) var newFontSize = currentFontSizeNum+1; else var newFontSize = currentFontSizeNum; $('html').css('font-size', newFontSize); if(newFontSize==10) $('.smallFont').addClass('active'); if(newFontSize==11) $('.resetFont').addClass('active'); if(newFontSize==12) $('.bigFont').addClass('active'); CookieManager.setCookie('font-size',newFontSize,999); return false; }); // Decrease Font Size $(".decreaseFont").click(function(){ var currentFontSize = $('html').css('font-size'); var currentFontSizeNum = parseFloat(currentFontSize, 11); $('.font-resize a').removeClass('active'); if (currentFontSizeNum>10) var newFontSize = currentFontSizeNum-1; else var newFontSize = currentFontSizeNum; $('html').css('font-size', newFontSize); if(newFontSize==10) $('.smallFont').addClass('active'); if(newFontSize==11) $('.resetFont').addClass('active'); if(newFontSize==12) $('.bigFont').addClass('active'); CookieManager.setCookie('font-size',newFontSize,999); return false; }); });/* * FancyBox - jQuery Plugin * Simple and fancy lightbox alternative * * Copyright (c) 20010 Janis Skarnelis * Examples and documentation at: http://fancybox.net * * Version: 1.3.0 (02/02/2010) * Requires: jQuery v1.3+ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ ;(function(b){function H(){v.hide();r.onerror=r.onload=null;F&&F.abort();l.empty()}function Q(){b.fancybox('

The requested content cannot be loaded.
Please try again later.

',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}function B(){H();var a=q[s];e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));var d,f,o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length? b(a).children("img:first"):b(a);if(o==""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(I))f="image";else if(d.match(T))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!== "swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,s,e)===false){h=false;return}l.css("padding",t+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":l.html(e.content);G();break;case "inline":b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup", function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(l.children())});b(a).appendTo(l);G();break;case "image":h=false;b.fancybox.showActivity();r=new Image;r.onerror=function(){Q()};r.onload=function(){r.onerror=null;r.onload=null;U()};r.src=d;break;case "swf":var u="",w="";u+='';b.each(e.swf,function(p,R){u+= '';w+=" "+p+'="'+R+'"'});u+='";l.html(u);G();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];typeof f=="string"?(f+="&selector="+a[1]):(f.selector=a[1])}h=false;b.fancybox.showActivity();F=b.ajax(b.extend(e.ajax,{url:d,data:f,error:Q,success:function(p){if(F.status==200){l.html(p);G()}}}));break;case "iframe":b('').appendTo(l);J();break}}function U(){h=true;e.width=r.width;e.height=r.height;b("").attr({id:"fancybox-img",src:r.src,alt:e.title}).appendTo(l);J()}function G(){l.width(e.width);l.height(e.height);if(e.width=="auto")e.width=l.width();if(e.height=="auto")e.height=l.height();J()}function J(){v.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel"); h=false;return}j=q;n=s;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){K&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});y.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}m=V();W();if(g.is(":visible")){b(z.add(C).add(D)).hide();var a=g.position();k={top:a.top,left:a.left,width:g.width(),height:g.height()}; var d=k.width==m.width&&k.height==m.height;i.fadeOut(c.changeFade,function(){function f(){i.html(l.contents()).fadeIn(c.changeFade,L)}b.event.trigger("fancybox-change");i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).empty().css("overflow","hidden");A.prop=0;b(A).animate({prop:1},{duration:d?0:c.changeSpeed,easing:c.easingChange,step:M,complete:f})})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=S();i.css({top:c.padding, left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(l.contents());g.css(k).show();if(c.opacity)m.opacity=0;A.prop=0;b(A).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(m.width-c.padding*2,1),height:Math.max(m.height-c.padding*2-x,1)}).html(l.contents());g.css(m).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}}function M(a){var d=Math.round(k.width+(m.width-k.width)*a), f=Math.round(k.height+(m.height-k.height)*a),o=Math.round(k.top+(m.top-k.top)*a),u=Math.round(k.left+(m.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:u+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+x*a),0);i.css({width:d+"px",height:f+"px"});if(typeof m.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)}function L(){i.css("overflow",overflow=c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible"); if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&y.one("click",b.fancybox.close);c.showCloseButton&&z.show();X();b(window).bind("resize.fb",b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;Y()}function V(){var a=N(),d={},f= c.margin,o=c.autoScale,u=(t+f)*2,w=(t+f)*2,p=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-t*2;o=false}else d.width=c.width+p;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-t*2;o=false}else d.height=c.height+p;if(o&&(d.width>a[0]-u||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){u+=p;w+=p;o=Math.min(Math.min(a[0]-u,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-p))+p;d.height=Math.round(o* (d.height-p))+p}else{d.width=Math.min(d.width,a[0]-u);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+t*2))*0.5;d.left=a[2]+(a[0]-(d.width+t*2))*0.5;if(c.autoScale==false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d}function S(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Z(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-t,left:a.left-c.padding-t}}else{a=N();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d} function X(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d==0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!=0)C.show(); if(c.cyclic&&j.length>1||n!=j.length-1)D.show()}}function Y(){if(j.length-1>n){var a=j[n+1].href;if(typeof a!=="undefined"&&a.match(I)){var d=new Image;d.src=a}}if(n>0){a=j[n-1].href;if(typeof a!=="undefined"&&a.match(I)){d=new Image;d.src=a}}}function $(){if(v.is(":visible")){b("div",v).css("top",O*-40+"px");O=(O+1)%12}else clearInterval(P)}function N(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]}function Z(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))|| 0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d}function W(){b("#fancybox-title").remove();x=0;if(c.titleShow!=false){var a=c.title;a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):aa(a);if(!(!a||a=="")){var d=m.width-c.padding*2;b('
').css({width:d,paddingLeft:c.padding,paddingRight:c.padding}).html(a).appendTo("body"); switch(c.titlePosition){case "inside":x=b("#fancybox-title").outerHeight(true)-c.padding;m.height+=x;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(E).hide();K&&b("#fancybox-title span").fixPNG()}}}function aa(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return''+a+"";default:return''+ a+''}return false}function ba(){if(!b("#fancybox-wrap").length){b("body").append(l=b('
'),v=b('
'),y=b('
'),g=b('
'));E=b('
').append('
').appendTo(g); E.append(i=b('
'),z=b(''),C=b(''),D=b(''));z.click(b.fancybox.close);v.click(b.fancybox.cancel);C.click(function(a){a.preventDefault();b.fancybox.prev()});D.click(function(a){a.preventDefault();b.fancybox.next()});b.support.opacity||E.find(".fancy-bg").fixPNG(); if(K){b(z.add(".fancy-ico").add("div",v)).fixPNG();y.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");v.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");E.prepend('')}}} var l,v,y,g,E,i,z,C,D,s=0,e={},q=[],n=0,c={},j=[],F=null,r=new Image,I=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,T=/[^\.]\.(swf)\s*$/i,P,O=1,k,m,h=false,t=20,A=b.extend(b("
")[0],{prop:0}),x=0,K=!b.support.opacity&&!window.XMLHttpRequest;b.fn.fixPNG=function(){return this.each(function(){var a=b(this).css("backgroundImage");if(a.match(/^url\(["']?(.*\.png)["']?\)$/i)){a=RegExp.$1;b(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+ (b(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+a+"')"}).each(function(){var d=b(this).css("position");d!="absolute"&&d!="relative"&&b(this).css("position","relative")}).css("zoom",1)}})};b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a));b(this).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];s=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");s= q.index(this)}B();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;q=[];s=0;if(b.isArray(a)){for(var f=0,o=a.length;f-1&&j.length>a){s=a;B()}if(c.cyclic&&j.length>1&&a<0){s=j.length-1;B()}if(c.cyclic&&j.length>1&&a>=j.length){s=0;B()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");H();e&&b.isFunction(e.onCancel)&&e.onCancel(q,s,e);h=false}};b.fancybox.close=function(){function a(){y.fadeOut("fast"); g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=s=0;c=e={};h=false}if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}H();b(z.add(C).add(D)).hide();b("#fancybox-title").remove();g.add(i).add(y).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=S();var d=g.position();m={top:d.top,left:d.left, width:g.width(),height:g.height()};if(c.opacity)m.opacity=1;A.prop=1;b(A).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){if(!(h||g.is(":hidden"))){h=true;var a=i.wrapInner("
").children(),d=a.height();g.css({height:d+c.padding*2+x});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=N(),d=c.margin, f={};f.top=a[3]+(a[1]-(g.height()-x+t*2))*0.5;f.left=a[2]+(a[0]-(g.width()+t*2))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside", titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){ba()})})(jQuery); var timer = null; function ScrollStart( dir , div ) { stopScroller(); timer = window.setInterval( function() { scrollIt( dir , div ) }, 10); document.onmouseup=stopScroller; } function scrollIt( dir , div ) { var obj = document.getElementById(div); switch( dir ){ case 'left': obj.scrollLeft-=3; break; case 'up': obj.scrollTop-=3; break; case 'down': obj.scrollTop+=3; break; default: obj.scrollLeft+=3; break; } } function stopScroller() { window.clearInterval( timer ); } function popitup(url) { window.open('http://'+url,'test','height=500,width=977,scrollbars=yes'); return false; } function jspaging(url){ $("#div_paging").hide(); $("#div_paging").load(url); setTimeout(function(){ $("#div_paging").fadeIn("slow"); }, 100); } $(function() { ////// menu search $("#keyword").click(function() { $(this).parent().find("ul.subnav").slideDown('fast').show(); $("li.s_o").parent().click(function() { $(this).parent().find("ul.subnav").slideUp('slow'); }, function(){ $(this).parent().find("ul.subnav").slideUp('slow'); }); }).hover(function() { $(this).addClass("subhover"); }, function(){ $(this).removeClass("subhover"); }); $(".s_o").click(function() { $("#type").val($(this).find("img").attr("id")); $("#show_option").html(''); //$('#search_form').removeAttr("disabled"); $('#keyword').focus(); }); $("#search-close").click(function() { $(".subnav").slideUp('slow'); }); ///////////////////// //// submit search form $(".search_form").click(function(){ $("#msgsearch_back").html(''); $("#msgsearch").removeClass().addClass('white').text('Валидиране').fadeIn(1000); $.post("/%D0%A2%D1%8A%D1%80%D1%81%D0%B8/1/YdK3clavcReXMNKLc9ivclefIVKbYpOPYFKfYteXIteLcV",{ type:$('#type').val(),keyword:$('#keyword').val(),rand:Math.random() } ,function(response) { if(response == 'no'){ $("#msgsearch").fadeTo(200,0.1,function(){ $(this).html('Няма намерени резултати').addClass('white').fadeTo(900,1); }); } else { $(".subnav").slideUp('slow'); $("#msgsearch").fadeTo(200,0.1,function(){ $(this).html('Зареждане').addClass('white').fadeTo(900,1, function(){ $(this).text(''); $(".forum-menu").css("display", "none"); $(".forum-path").css("display", "none"); $("#forum_main").css("display", "none"); $(".forum_main").css("display", "none"); $(".dlib-menu").remove(); $(".dlib-path").remove(); $("#dlib_main").remove(); $('.dlib_main').remove(); $("#container").html(''); $("#container").html(response); }); }); } }); return false; }); /////////////////////// if($("ul#leftmenu")){ $("ul#leftmenu ul").hide(); $('ul#leftmenu li:has(ul) ul').each(function(i) { $(this).slideUp(400); }); $('ul#leftmenu li.clicked ul').show(); $('ul#leftmenu li:has(ul) a').click(function(){ if ($(this).parent().hasClass ("clicked")){ $(this).parent().removeClass("clicked"); $(this).parent().children("ul").slideUp(400); }else{ if ($(this).parent().parent().hasClass('leftmenu')){ $('ul#leftmenu li:has(ul)').removeClass("clicked"); $('ul#leftmenu li:has(ul) ul').slideUp(400); $(this).parent().addClass("clicked"); $(this).parent().children("ul").slideDown(400); } } }); } $('ul#forum_path li:has(ul) a.drop').click(function(){ if ( $(this).parent().hasClass ("clicked")){ $(this).parent().removeClass("clicked"); $(this).parent().children("ul").slideUp(400); }else{ $('ul#forum_path li:has(ul)').removeClass("clicked"); $('ul#forum_path li:has(ul) ul').slideUp(400); $(this).parent().addClass("clicked"); $(this).parent().children("ul").slideDown(400); } }); $(document).click(function(event) { if($(event.target).parents().index($('#forum_path')) == -1) { if($('#forum_path li:has(ul)').hasClass ("clicked")) { $('#forum_path li:has(ul)').removeClass("clicked"); //$('#forum_path li:has(ul) ul').slideUp(400); $('#forum_path li:has(ul) ul').css({'display' : 'none'}); } } if($(event.target).parents().index($('#search_box')) == -1) { $(".subnav").css({'display' : 'none'}); } }); if($("#gallery_news")){ $("#gallery_news").mbScrollable({ dir: 'vertical', width:550, elementsInPage:1, height:150, controls:"#paging_news", slideTimer:600, autoscroll:false, scrollTimer:4000 }); } if($("#external_news")){ $("#external_news").mbScrollable({ dir: 'vertical', width:382, elementsInPage:2, height:220, controls:"#paging_news2", slideTimer:600, autoscroll:false, scrollTimer:4000 }); } if($("#gallery_links")){ $("#gallery_links").mbScrollable({ dir:'vertical', width:355, height:182, elementsInPage:7, elementMargin:0, controls:"#paging_links", slideTimer:600, autoscroll:false, scrollTimer:6000 }); } $("a[rel=gallery_img]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'titleFormat' : function(title) { return ''; } }); /* bulletin_register */ $("#bulletin_register").click(function(){ $("#newsletter_message").removeClass().addClass('messagebox new').text('Валидиране ....').fadeIn(1000); $.post("/%D0%A0%D0%B5%D0%B3%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%86%D0%B8%D1%8F+%D0%B2+%D0%B1%D1%8E%D0%BB%D0%B5%D1%82%D0%B8%D0%BD/1/YdK3clerYRejI1KTYNe3c5ibMNKbcVezYROLcxOfMBabcNabcZK7IBe7",{ email:$('#mail_register').val(),rand:Math.random() } ,function(data) { if(data=='yes'){ $("#newsletter_message").fadeTo(200,0.1,function(){ $(this).html('На посочения mail адрес са Ви изпратени инструкции за завършването на абонамента').addClass('messageboxok').fadeTo(900,1); }); } else if(data=='error'){ $("#newsletter_message").fadeTo(200,0.1,function(){ $(this).html('Има абонамент с този mail адрес').addClass('messageboxerror').fadeTo(900,1); }); } else { $("#newsletter_message").fadeTo(200,0.1,function(){ $(this).html('Моля въведете email адрес.').addClass('messageboxerror red').fadeTo(900,1); setTimeout(function(){ $("#newsletter_message").fadeOut(400); }, 3000); }); } }); return false; }); /* bulletin_register */ });