/*
 * Thickbox 3 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/

var tb_pathToImage = "./images/loadingAnimation.gif";

$(document).ready(function () {tb_init("a.thickbox, area.thickbox, input.thickbox");imgLoader = new Image;imgLoader.src = tb_pathToImage;});

    function tb_init(b) {
        $(b).click(function () {var t = this.title || this.name || null;var a = this.href || this.alt;var g = this.rel || false;tb_show(t, a, g);this.blur();return false;});
    }


    function tb_show(d, f, g) {
        try {
            if (typeof document.body.style.maxHeight === "undefined") {
                $("body", "html").css({height: "100%", width: "100%"});
                $("html").css("overflow", "hidden");
                if (document.getElementById("TB_HideSelect") === null) {
                    $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
                    $("#TB_overlay").click(tb_remove);
                }
            } else {
                if (document.getElementById("TB_overlay") === null) {
                    $("body").append("<div id='TB_overlay'></div><div id='TB_window'>");
                    $("#TB_overlay").click(tb_remove);
                }
            }
            if (d === null) {
                d = "";
            }
            $("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' /></div>");
            $("#TB_load").show();
            var h;
            if (f.indexOf("?") !== -1) {
                h = f.substr(0, f.indexOf("?"));
            } else {
                h = f;
            }
            var i = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
            var j = h.toLowerCase().match(i);
            if (j == ".jpg" ||
                j == ".jpeg" || j == ".png" || j == ".gif" || j == ".bmp") {
                TB_PrevCaption = "";
                TB_PrevURL = "";
                TB_PrevHTML = "";
                TB_NextCaption = "";
                TB_NextURL = "";
                TB_NextHTML = "";
                TB_imageCount = "";
                TB_FoundURL = false;
                if (g) {
                    TB_TempArray = $("a[@rel=" + g + "]").get();
                    for (TB_Counter = 0; TB_Counter < TB_TempArray.length &&
                        TB_NextHTML === ""; TB_Counter++) {
                        var k = TB_TempArray[TB_Counter].href.toLowerCase().match(i);
                        if (!(TB_TempArray[TB_Counter].href == f)) {
                            if (TB_FoundURL) {
                                TB_NextCaption = TB_TempArray[TB_Counter].title;
                                TB_NextURL = TB_TempArray[TB_Counter].href;
                                TB_NextHTML = "<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
                            } else {
                                TB_PrevCaption = TB_TempArray[TB_Counter].title;
                                TB_PrevURL = TB_TempArray[TB_Counter].href;
                                TB_PrevHTML = "<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
                            }
                        } else {
                            TB_FoundURL = true;
                            TB_imageCount = "Image " + TB_Counter + 1 + " of " + TB_TempArray.length;
                        }
                    }
                }
                imgPreloader = new Image;
                imgPreloader.onload = function () {imgPreloader.onload = null;var a = tb_getPageSize();var x = a[0] - 150;var y = a[1] - 150;var b = imgPreloader.width;var c = imgPreloader.height;if (b > x) {c = c * (x / b);b = x;if (c > y) {b = b * (y / c);c = y;}} else if (c > y) {b = b * (y / c);c = y;if (b > x) {c = c * (x / b);b = x;}}TB_WIDTH = b + 30;TB_HEIGHT = c + 60;$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='" + f + "' width='" + b + "' height='" + c + "' alt='" + d + "'/></a>" + "<div id='TB_caption'>" + d + "<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");$("#TB_closeWindowButton").click(tb_remove);if (!(TB_PrevHTML === "")) {
function goPrev() {if ($(document).unbind("click", goPrev)) {$(document).unbind("click", goPrev);}$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_PrevCaption, TB_PrevURL, g);return false;}

$("#TB_prev").click(goPrev);}if (!(TB_NextHTML === "")) {
function goNext() {$("#TB_window").remove();$("body").append("<div id='TB_window'></div>");tb_show(TB_NextCaption, TB_NextURL, g);return false;}

$("#TB_next").click(goNext);}document.onkeydown = function (e) {if (e == null) {keycode = event.keyCode;} else {keycode = e.which;}if (keycode == 27) {tb_remove();} else if (keycode == 190) {if (!(TB_NextHTML == "")) {document.onkeydown = "";goNext();}} else if (keycode == 188) {if (!(TB_PrevHTML == "")) {document.onkeydown = "";goPrev();}}};tb_position();$("#TB_load").remove();$("#TB_ImageOff").click(tb_remove);$("#TB_window").css({display: "block"});};
                imgPreloader.src = f;
            } else {
                var l = f.replace(/^[^\?]+\??/, "");
                var m = tb_parseQuery(l);
                TB_WIDTH = m.width * 1 + 30 || 630;
                TB_HEIGHT = m.height * 1 + 40 || 440;
                ajaxContentW = TB_WIDTH - 30;
                ajaxContentH = TB_HEIGHT - 45;
                if (f.indexOf("TB_iframe") != -1) {
                    urlNoQuery = f.split("TB_");
                    $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + d + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent' style='width:" + ajaxContentW + 29 + "px;height:" + ajaxContentH + 17 + "px;' onload='tb_showIframe()'> </iframe>");
                } else {
                    if ($("#TB_window").css("display") != "block") {
                        if (m.modal != "true") {
                            $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + d + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>");
                        } else {
                            $("#TB_overlay").unbind();
                            $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px;'></div>");
                        }
                    } else {
                        $("#TB_ajaxContent")[0].style.width = ajaxContentW + "px";
                        $("#TB_ajaxContent")[0].style.height = ajaxContentH + "px";
                        $("#TB_ajaxContent")[0].scrollTop = 0;
                        $("#TB_ajaxWindowTitle").html(d);
                    }
                }
                $("#TB_closeWindowButton").click(tb_remove);
                if (f.indexOf("TB_inline") != -1) {
                    $("#TB_ajaxContent").html($("#" + m.inlineId).html());
                    tb_position();
                    $("#TB_load").remove();
                    $("#TB_window").css({display: "block"});
                } else if (f.indexOf("TB_iframe") != -1) {
                    tb_position();
                    if (frames.TB_iframeContent === undefined) {
                        $("#TB_load").remove();
                        $("#TB_window").css({display: "block"});
                        $(document).keyup(function (e) {var a = e.keyCode;if (a == 27) {tb_remove();}});
                    }
                } else {
                    $("#TB_ajaxContent").load(f += "&random=" + (new Date).getTime(), function () {tb_position();$("#TB_load").remove();tb_init("#TB_ajaxContent a.thickbox");$("#TB_window").css({display: "block"});});
                }
            }
            if (!m.modal) {
                document.onkeyup = function (e) {if (e == null) {keycode = event.keyCode;} else {keycode = e.which;}if (keycode == 27) {tb_remove();}};
            }
        } catch (e) {
        }
    }


    function tb_showIframe() {
        $("#TB_load").remove();
        $("#TB_window").css({display: "block"});
    }


    function tb_remove() {
        $("#TB_imageOff").unbind("click");
        $("#TB_overlay").unbind("click");
        $("#TB_closeWindowButton").unbind("click");
        $("#TB_window").fadeOut("fast", function () {$("#TB_window,#TB_overlay,#TB_HideSelect").remove();});
        $("#TB_load").remove();
        if (typeof document.body.style.maxHeight == "undefined") {
            $("body", "html").css({height: "auto", width: "auto"});
            $("html").css("overflow", "");
        }
        document.onkeydown = "";
        return false;
    }


    function tb_position() {
        $("#TB_window").css({marginLeft: "-" + parseInt(TB_WIDTH / 2, 10) + "px", width: TB_WIDTH + "px"});
        if (!(jQuery.browser.msie && typeof XMLHttpRequest == "function")) {
            $("#TB_window").css({marginTop: "-" + parseInt(TB_HEIGHT / 2, 10) + "px"});
        }
    }


    function tb_parseQuery(a) {
        var b = {};
        if (!a) {
            return b;
        }
        var c = a.split(/[;&]/);
        for (var i = 0; i < c.length; i++) {
            var d = c[i].split("=");
            if (!d || d.length != 2) {
                continue;
            }
            var e = unescape(d[0]);
            var f = unescape(d[1]);
            f = f.replace(/\+/g, " ");
            b[e] = f;
        }
        return b;
    }


    function tb_getPageSize() {
        var a = document.documentElement;
        var w = window.innerWidth ||
            self.innerWidth ||
            a && a.clientWidth || document.body.clientWidth;
        var h = window.innerHeight ||
            self.innerHeight ||
            a && a.clientHeight || document.body.clientHeight;
        arrayPageSize = [w, h];
        return arrayPageSize;
    }


//// JQUERY PLUGIN - HISTORY REMOTE
(function($){$.ajaxHistory=new function(){var RESET_EVENT='historyReset';var _currentHash=location.hash;var _intervalId=null;var _observeHistory;this.update=function(){};var _defaultReset=function(){$('.remote-output').empty();};$(document).bind(RESET_EVENT,_defaultReset);if($.browser.msie){var _historyIframe,initialized=false;$(function(){_historyIframe=$('<iframe style="display: none;"></iframe>').appendTo(document.body).get(0);var iframe=_historyIframe.contentWindow.document;iframe.open();iframe.close();if(_currentHash&&_currentHash!='#'){iframe.location.hash=_currentHash.replace('#','');}});this.update=function(hash){_currentHash=hash;var iframe=_historyIframe.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=hash.replace('#','');};_observeHistory=function(){var iframe=_historyIframe.contentWindow.document;var iframeHash=iframe.location.hash;if(iframeHash!=_currentHash){_currentHash=iframeHash;if(iframeHash&&iframeHash!='#'){$('a[@href$="'+iframeHash+'"]').click();location.hash=iframeHash;}else if(initialized){location.hash='';$(document).trigger(RESET_EVENT);}}initialized=true;};}else if($.browser.mozilla||$.browser.opera){this.update=function(hash){_currentHash=hash;};_observeHistory=function(){if(location.hash){if(_currentHash!=location.hash){_currentHash=location.hash;$('a[@href$="'+_currentHash+'"]').click();}}else if(_currentHash){_currentHash='';$(document).trigger(RESET_EVENT);}};}else if($.browser.safari){var _backStack,_forwardStack,_addHistory;$(function(){_backStack=[];_backStack.length=history.length;_forwardStack=[];});var isFirst=false,initialized=false;_addHistory=function(hash){_backStack.push(hash);_forwardStack.length=0;isFirst=false;};this.update=function(hash){_currentHash=hash;_addHistory(_currentHash);};_observeHistory=function(){var historyDelta=history.length-_backStack.length;if(historyDelta){isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)_forwardStack.unshift(_backStack.pop());}else{for(var i=0;i<historyDelta;i++)_backStack.push(_forwardStack.shift());}var cachedHash=_backStack[_backStack.length-1];$('a[@href$="'+cachedHash+'"]').click();_currentHash=location.hash;}else if(_backStack[_backStack.length-1]==undefined&&!isFirst){if(document.URL.indexOf('#')>=0){$('a[@href$="'+'#'+document.URL.split('#')[1]+'"]').click();}else if(initialized){$(document).trigger(RESET_EVENT);}isFirst=true;}initialized=true;};}this.initialize=function(callback){if(typeof callback=='function'){$(document).unbind(RESET_EVENT,_defaultReset).bind(RESET_EVENT,callback);}if(location.hash&&typeof _addHistory=='undefined'){$('a[@href$="'+location.hash+'"]').trigger('click');}if(_observeHistory&&_intervalId==null){_intervalId=setInterval(_observeHistory,200);}};};$.fn.remote=function(output,settings,callback){callback=callback||function(){};if(typeof settings=='function'){callback=settings;}settings=$.extend({hashPrefix:'remote-'},settings||{});var target=$(output).size()&&$(output)||$('<div></div>').appendTo('body');target.addClass('remote-output');return this.each(function(i){var href=this.href;var hash='#'+(this.title&&this.title.replace(/\s/g,'_')||settings.hashPrefix+(i+1));this.href=hash;$(this).click(function(e){if(!target['locked']){if(e.clientX){$.ajaxHistory.update(hash);}target.load(href,function(){target['locked']=null;callback();});}});});};$.fn.history=function(callback){return this.click(function(e){if(e.clientX){$.ajaxHistory.update(this.hash);}typeof callback=='function'&&callback();});};})(jQuery);

//// JQUERY PLUGIN - TABS
(function($){$.extend({tabs:{remoteCount:0}});$.fn.tabs=function(initial,settings){if(typeof initial=='object')settings=initial;settings=$.extend({initial:(initial&&typeof initial=='number'&&initial>0)?--initial:0,disabled:null,bookmarkable:$.ajaxHistory?true:false,remote:false,spinner:'Loading&#8230;',hashPrefix:'remote-tab-',fxFade:null,fxSlide:null,fxShow:null,fxHide:null,fxSpeed:'normal',fxShowSpeed:null,fxHideSpeed:null,fxAutoHeight:false,onClick:null,onHide:null,onShow:null,navClass:'tabs-nav',selectedClass:'tabs-selected',disabledClass:'tabs-disabled',containerClass:'tabs-container',hideClass:'tabs-hide',loadingClass:'tabs-loading',tabStruct:'div'},settings||{});$.browser.msie6=$.browser.msie6||$.browser.msie&&typeof XMLHttpRequest=='function';function unFocus(){scrollTo(0,0);}return this.each(function(){var container=this;var nav=$('ul.'+settings.navClass,container);nav=nav.size()&&nav||$('>ul:eq(0)',container);var tabs=$('a',nav);if(settings.remote){tabs.each(function(){var id=settings.hashPrefix+(++$.tabs.remoteCount),hash='#'+id,url=this.href;this.href=hash;$('<div id="'+id+'" class="'+settings.containerClass+'"></div>').appendTo(container);$(this).bind('loadRemoteTab',function(e,callback){var $$=$(this).addClass(settings.loadingClass),span=$('span',this)[0],tabTitle=span.innerHTML;if(settings.spinner){span.innerHTML='<em>'+settings.spinner+'</em>';}setTimeout(function(){$(hash).load(url,function(){if(settings.spinner){span.innerHTML=tabTitle;}$$.removeClass(settings.loadingClass);callback&&callback();});},0);});});}var containers=$('div.'+settings.containerClass,container);containers=containers.size()&&containers||$('>'+settings.tabStruct,container);nav.is('.'+settings.navClass)||nav.addClass(settings.navClass);containers.each(function(){var $$=$(this);$$.is('.'+settings.containerClass)||$$.addClass(settings.containerClass);});var hasSelectedClass=$('li',nav).index($('li.'+settings.selectedClass,nav)[0]);if(hasSelectedClass>=0){settings.initial=hasSelectedClass;}if(location.hash){tabs.each(function(i){if(this.hash==location.hash){settings.initial=i;if(($.browser.msie||$.browser.opera)&&!settings.remote){var toShow=$(location.hash);var toShowId=toShow.attr('id');toShow.attr('id','');setTimeout(function(){toShow.attr('id',toShowId);},500);}unFocus();return false;}});}if($.browser.msie){unFocus();}containers.filter(':eq('+settings.initial+')').show().end().not(':eq('+settings.initial+')').addClass(settings.hideClass);$('li',nav).removeClass(settings.selectedClass).eq(settings.initial).addClass(settings.selectedClass);tabs.eq(settings.initial).trigger('loadRemoteTab').end();if(settings.fxAutoHeight){var _setAutoHeight=function(reset){var heights=$.map(containers.get(),function(el){var h,jq=$(el);if(reset){if($.browser.msie6){el.style.removeExpression('behaviour');el.style.height='';el.minHeight=null;}h=jq.css({'min-height':''}).height();}else{h=jq.height();}return h;}).sort(function(a,b){return b-a;});if($.browser.msie6){containers.each(function(){this.minHeight=heights[0]+'px';this.style.setExpression('behaviour','this.style.height = this.minHeight ? this.minHeight : "1px"');});}else{containers.css({'min-height':heights[0]+'px'});}};_setAutoHeight();var cachedWidth=container.offsetWidth;var cachedHeight=container.offsetHeight;var watchFontSize=$('#tabs-watch-font-size').get(0)||$('<span id="tabs-watch-font-size">M</span>').css({display:'block',position:'absolute',visibility:'hidden'}).appendTo(document.body).get(0);var cachedFontSize=watchFontSize.offsetHeight;setInterval(function(){var currentWidth=container.offsetWidth;var currentHeight=container.offsetHeight;var currentFontSize=watchFontSize.offsetHeight;if(currentHeight>cachedHeight||currentWidth!=cachedWidth||currentFontSize!=cachedFontSize){_setAutoHeight((currentWidth>cachedWidth||currentFontSize<cachedFontSize));cachedWidth=currentWidth;cachedHeight=currentHeight;cachedFontSize=currentFontSize;}},50);}var showAnim={},hideAnim={},showSpeed=settings.fxShowSpeed||settings.fxSpeed,hideSpeed=settings.fxHideSpeed||settings.fxSpeed;if(settings.fxSlide||settings.fxFade){if(settings.fxSlide){showAnim['height']='show';hideAnim['height']='hide';}if(settings.fxFade){showAnim['opacity']='show';hideAnim['opacity']='hide';}}else{if(settings.fxShow){showAnim=settings.fxShow;}else{showAnim['min-width']=0;showSpeed=settings.bookmarkable?50:1;}if(settings.fxHide){hideAnim=settings.fxHide;}else{hideAnim['min-width']=0;hideSpeed=settings.bookmarkable?50:1;}}var onClick=settings.onClick,onHide=settings.onHide,onShow=settings.onShow;tabs.bind('triggerTab',function(){var li=$(this).parents('li:eq(0)');if(container.locked||li.is('.'+settings.selectedClass)||li.is('.'+settings.disabledClass)){return false;}var hash=this.hash;if($.browser.msie){$(this).trigger('click');if(settings.bookmarkable){$.ajaxHistory.update(hash);location.hash=hash.replace('#','');}}else if($.browser.safari){var tempForm=$('<form action="'+hash+'"><div><input type="submit" value="h" /></div></form>').get(0);tempForm.submit();$(this).trigger('click');if(settings.bookmarkable){$.ajaxHistory.update(hash);}}else{if(settings.bookmarkable){location.hash=hash.replace('#','');}else{$(this).trigger('click');}}});tabs.bind('disableTab',function(){var li=$(this).parents('li:eq(0)');if($.browser.safari){li.animate({opacity:0},1,function(){li.css({opacity:''});});}li.addClass(settings.disabledClass);});if(settings.disabled&&settings.disabled.length){for(var i=0,k=settings.disabled.length;i<k;i++){tabs.eq(--settings.disabled[i]).trigger('disableTab').end();}};tabs.bind('enableTab',function(){var li=$(this).parents('li:eq(0)');li.removeClass(settings.disabledClass);if($.browser.safari){li.animate({opacity:1},1,function(){li.css({opacity:''});});}});tabs.bind('click',function(e){var trueClick=e.clientX;var clicked=this,li=$(this).parents('li:eq(0)'),toShow=$(this.hash),toHide=containers.filter(':visible');if(container['locked']||li.is('.'+settings.selectedClass)||li.is('.'+settings.disabledClass)||typeof onClick=='function'&&onClick(this,toShow[0],toHide[0])===false){this.blur();return false;}container['locked']=true;if(toShow.size()){if($.browser.msie&&settings.bookmarkable){var toShowId=this.hash.replace('#','');toShow.attr('id','');setTimeout(function(){toShow.attr('id',toShowId);},0);}function switchTab(){if(settings.bookmarkable&&trueClick){$.ajaxHistory.update(clicked.hash);}toHide.animate(hideAnim,hideSpeed,function(){$(clicked).parents('li:eq(0)').addClass(settings.selectedClass).siblings().removeClass(settings.selectedClass);if(typeof onHide=='function'){onHide(clicked,toShow[0],toHide[0]);}var resetCSS={display:'',overflow:'',height:''};if(!$.browser.msie){resetCSS['opacity']='';}toHide.addClass(settings.hideClass).css(resetCSS);toShow.removeClass(settings.hideClass).animate(showAnim,showSpeed,function(){toShow.css(resetCSS);if($.browser.msie){toHide[0].style.filter='';toShow[0].style.filter='';}if(typeof onShow=='function'){onShow(clicked,toShow[0],toHide[0]);}container['locked']=null;});});}if(!settings.remote){switchTab();}else{$(clicked).trigger('loadRemoteTab',[switchTab]);}}else{alert('There is no such container.');}var scrollX=window.pageXOffset||document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft||0;var scrollY=window.pageYOffset||document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;setTimeout(function(){window.scrollTo(scrollX,scrollY);},0);this.blur();return settings.bookmarkable&&!!trueClick;});if(settings.bookmarkable){$.ajaxHistory.initialize(function(){tabs.eq(settings.initial).trigger('click').end();});}});};var tabEvents=['triggerTab','disableTab','enableTab'];for(var i=0;i<tabEvents.length;i++){$.fn[tabEvents[i]]=(function(tabEvent){return function(tab){return this.each(function(){var nav=$('ul.tabs-nav',this);nav=nav.size()&&nav||$('>ul:eq(0)',this);var a;if(!tab||typeof tab=='number'){a=$('li a',nav).eq((tab&&tab>0&&tab-1||0));}else if(typeof tab=='string'){a=$('li a[@href$="#'+tab+'"]',nav);}a.trigger(tabEvent);});};})(tabEvents[i]);}$.fn.activeTab=function(){var selectedTabs=[];this.each(function(){var nav=$('ul.tabs-nav',this);nav=nav.size()&&nav||$('>ul:eq(0)',this);var lis=$('li',nav);selectedTabs.push(lis.index(lis.filter('.tabs-selected')[0])+1);});return selectedTabs[0];};})(jQuery);

//// JQUERY PLUGIN - MOUSE WHEEL
(function($){$.fn.extend({mousewheel:function(f){if(!f.guid)f.guid=$.event.guid++;if(!$.event._mwCache)$.event._mwCache=[];return this.each(function(){if(this._mwHandlers)return this._mwHandlers.push(f);else this._mwHandlers=[];this._mwHandlers.push(f);var s=this;this._mwHandler=function(e){e=$.event.fix(e||window.event);$.extend(e,this._mwCursorPos||{});var delta=0,returnValue=true;if(e.wheelDelta)delta=e.wheelDelta/120;if(e.detail)delta=-e.detail/3;if(window.opera)delta=-e.wheelDelta;for(var i=0;i<s._mwHandlers.length;i++)if(s._mwHandlers[i])if(s._mwHandlers[i].call(s,e,delta)===false){returnValue=false;e.preventDefault();e.stopPropagation();}return returnValue;};if($.browser.mozilla&&!this._mwFixCursorPos){this._mwFixCursorPos=function(e){this._mwCursorPos={pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY};};$(this).bind('mousemove',this._mwFixCursorPos);}if(this.addEventListener)if($.browser.mozilla)this.addEventListener('DOMMouseScroll',this._mwHandler,false);else this.addEventListener('mousewheel',this._mwHandler,false);else this.onmousewheel=this._mwHandler;$.event._mwCache.push($(this));});},unmousewheel:function(f){return this.each(function(){if(f&&this._mwHandlers){for(var i=0;i<this._mwHandlers.length;i++)if(this._mwHandlers[i]&&this._mwHandlers[i].guid==f.guid)delete this._mwHandlers[i];}else{if($.browser.mozilla&&!this._mwFixCursorPos)$(this).unbind('mousemove',this._mwFixCursorPos);if(this.addEventListener)if($.browser.mozilla)this.removeEventListener('DOMMouseScroll',this._mwHandler,false);else this.removeEventListener('mousewheel',this._mwHandler,false);else this.onmousewheel=null;this._mwHandlers=this._mwHandler=this._mwFixCursorPos=this._mwCursorPos=null;}});}});$(window).one('unload',function(){var els=$.event._mwCache||[];for(var i=0;i<els.length;i++)els[i].unmousewheel();});})(jQuery);

//// JQUERY PLUGIN - SCROLL TO JOEL
(function($){eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3.R=6(e){7 l=0;7 t=0;7 w=3.a(3.X(e,\'1e\'));7 h=3.a(3.X(e,\'1f\'));7 m=e.L;7 B=e.F;1a(e.S){l+=e.T+(e.8?3.a(e.8.W):0);t+=e.V+(e.8?3.a(e.8.10):0);e=e.S}l+=e.T+(e.8?3.a(e.8.W):0);t+=e.V+(e.8?3.a(e.8.10):0);c{x:l,y:t,w:w,h:h,m:m,B:B}};3.1d=6(e){b(e){w=e.k;h=e.C}f{w=(d.Y)?d.Y:(1.4&&1.4.k)?1.4.k:1.9.L;h=(d.H)?d.H:(1.4&&1.4.C)?1.4.C:1.9.F}c{w:w,h:h}};3.U=6(e){b(e){t=e.i;l=e.A;w=e.r;h=e.D}f{b(1.4&&1.4.i){t=1.4.i;l=1.4.A;w=1.4.r;h=1.4.D}f b(1.9){t=1.9.i;l=1.9.A;w=1.9.r;h=1.9.D}}c{t:t,l:l,w:w,h:h}};3.a=6(v){v=12(v);c 14(v)?0:v};3.16.E=6(s){o=3.17(s);c u.18(6(){n 3.P.E(u,o)})};3.P.E=6(e,o){7 z=u;z.o=o;z.e=e;z.p=3.R(e);z.s=3.U();z.J=6(){1b(z.j);z.j=1c};z.t=(n N).Z();z.M=6(){7 t=(n N).Z();7 p=(t-z.t)/z.o.I;b(t>=z.o.I+z.t){z.J();11(6(){z.q(z.p.y,z.p.x)},13)}f{G=((-g.O(p*g.Q)/2)+0.5)*(z.p.y-z.s.t)+z.s.t;K=((-g.O(p*g.Q)/2)+0.5)*(z.p.x-z.s.l)+z.s.l;z.q(G,K)}};z.q=6(t,l){d.19(l,t)};z.j=15(6(){z.M()},13)};',62,78,'|document||jQuery|documentElement||function|var|currentStyle|body|intval|if|return|window||else|Math||scrollTop|timer|clientWidth||wb|new|||scroll|scrollWidth|||this||||||scrollLeft|hb|clientHeight|scrollHeight|ScrollTo|offsetHeight|st|innerHeight|duration|clear|sl|offsetWidth|step|Date|cos|fx|PI|getPos|offsetParent|offsetLeft|getScroll|offsetTop|borderLeftWidth|css|innerWidth|getTime|borderTopWidth|setTimeout|parseInt||isNaN|setInterval|fn|speed|each|scrollTo|while|clearInterval|null|getClient|width|height'.split('|'),0,{}));})(jQuery);


//// GANESH PLUGIN - JCAROUSELLITE
(function($){$.fn.jCarouselLite=function(o){o=$.extend({btnPrev:null,btnNext:null,btnGo:null,mouseWheel:false,auto:null,speed:200,easing:null,vertical:false,circular:true,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null},o||{});return this.each(function(){var b=false,animCss=o.vertical?"top":"left",sizeCss=o.vertical?"height":"width";var c=$(this),ul=$("ul",c),tLi=$("li",ul),tl=tLi.size(),v=o.visible;if(o.circular){ul.prepend(tLi.slice(tl-v-1+1).clone()).append(tLi.slice(0,v).clone());o.start+=v}var f=$("li",ul),itemLength=f.size(),curr=o.start;c.css("visibility","visible");f.css({overflow:"hidden",float:o.vertical?"none":"left"});ul.css({margin:"0",padding:"0",position:"relative","list-style-type":"none","z-index":"1"});c.css({overflow:"hidden",position:"relative","z-index":"2",left:"0px"});var g=o.vertical?height(f):width(f);var h=g*itemLength;var j=g*v;f.css({width:f.width(),height:f.height()});ul.css(sizeCss,h+"px").css(animCss,-(curr*g));c.css(sizeCss,j+"px");if(o.btnPrev)$(o.btnPrev).click(function(){return go(curr-o.scroll)});if(o.btnNext)$(o.btnNext).click(function(){return go(curr+o.scroll)});if(o.btnGo)$.each(o.btnGo,function(i,a){$(a).click(function(){return go(o.circular?o.visible+i:i)})});if(o.mouseWheel&&c.mousewheel)c.mousewheel(function(e,d){return d>0?go(curr-o.scroll):go(curr+o.scroll)});if(o.auto)setInterval(function(){go(curr+o.scroll)},o.auto+o.speed);function vis(){return f.slice(curr).slice(0,v)};function go(a){if(!b){if(o.beforeStart)o.beforeStart.call(this,vis());if(o.circular){if(a<=o.start-v-1){ul.css(animCss,-((itemLength-(v*2))*g)+"px");curr=a==o.start-v-1?itemLength-(v*2)-1:itemLength-(v*2)-o.scroll}else if(a>=itemLength-v+1){ul.css(animCss,-((v)*g)+"px");curr=a==itemLength-v+1?v+1:v+o.scroll}else curr=a}else{if(a<0||a>itemLength-v)return;else curr=a}b=true;ul.animate(animCss=="left"?{left:-(curr*g)}:{top:-(curr*g)},o.speed,function(){if(o.afterEnd)o.afterEnd.call(this,vis());b=false});if(!o.circular){$(o.btnPrev+","+o.btnNext).removeClass("disabled");$((curr-o.scroll<0&&o.btnPrev)||(curr+o.scroll>itemLength-v&&o.btnNext)||[]).addClass("disabled")}}return false}})};function css(a,b){return parseInt($.css(a[0],b))||0};function width(a){return a[0].offsetWidth+css(a,'marginLeft')+css(a,'marginRight')};function height(a){return a[0].offsetHeight+css(a,'marginTop')+css(a,'marginBottom')}})(jQuery);

//// GANESH PLUGIN - LAVALAMP
(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);



/// Tab Functions

$.tabs = function(selector, start) {
	$(selector).each(function(i, element) {
		$($(element).attr('rel')).css('display', 'none');
	});
};
$('#browser ul ul a').live('click', function() {
	$(this).parents('ul').stop(true, true).show();
	//setTimeout(function() {$.fx.off=true}, 1)
})

/*
 * Superfish v1.4.8 - jQuery menu widget
 * Copyright (c) 2008 Joel Birch
 *
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 *
 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
 */

;(function($){
	$.fn.superfish = function(op){

		var sf = $.fn.superfish,
			c = sf.c,
			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
			over = function(){
				var $$ = $(this), menu = getMenu($$);
				clearTimeout(menu.sfTimer);
				$$.showSuperfishUl().siblings().hideSuperfishUl();
			},
			out = function(){
				var $$ = $(this), menu = getMenu($$), o = sf.op;
				clearTimeout(menu.sfTimer);
				menu.sfTimer=setTimeout(function(){
					o.retainPath=($.inArray($$[0],o.$path)>-1);
					$$.hideSuperfishUl();
					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
				},o.delay);	
			},
			getMenu = function($menu){
				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
				sf.op = sf.o[menu.serial];
				return menu;
			},
			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
			
		return this.each(function() {
			var s = this.serial = sf.o.length;
			var o = $.extend({},sf.defaults,op);
			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
					.filter('li:has(ul)').removeClass(o.pathClass);
			});
			sf.o[s] = sf.op = o;
			
			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
				if (o.autoArrows) addArrow( $('>a:first-child',this) );
			})
			.not('.'+c.bcClass)
				.hideSuperfishUl();
			
			var $a = $('a',this);
			$a.each(function(i){
				var $li = $a.eq(i).parents('li');
				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
			});
			o.onInit.call(this);
			
		}).each(function() {
			menuClasses = [c.menuClass];
			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
			$(this).addClass(menuClasses.join(' '));
		});
	};

	var sf = $.fn.superfish;
	sf.o = [];
	sf.op = {};
	sf.IE7fix = function(){
		var o = sf.op;
		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
			this.toggleClass(sf.c.shadowClass+'-off');
		};
	sf.c = {
		bcClass     : 'sf-breadcrumb',
		menuClass   : 'sf-js-enabled',
		anchorClass : 'sf-with-ul',
		arrowClass  : 'sf-sub-indicator',
		shadowClass : 'sf-shadow'
	};
	sf.defaults = {
		hoverClass	: 'sfHover',
		pathClass	: 'overideThisToUse',
		pathLevels	: 1,
		delay		: 800,
		animation	: {opacity:'show'},
		speed		: 'normal',
		autoArrows	: true,
		dropShadows : true,
		disableHI	: false,		// true disables hoverIntent detection
		onInit		: function(){}, // callback functions
		onBeforeShow: function(){},
		onShow		: function(){},
		onHide		: function(){}
	};
	$.fn.extend({
		hideSuperfishUl : function(){
			var o = sf.op,
				not = (o.retainPath===true) ? o.$path : '';
			o.retainPath = false;
			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
					.find('>ul').hide().css('visibility','hidden');
			o.onHide.call($ul);
			return this;
		},
		showSuperfishUl : function(){
			var o = sf.op,
				sh = sf.c.shadowClass+'-off',
				$ul = this.addClass(o.hoverClass)
					.find('>ul:hidden').css('visibility','visible');
			sf.IE7fix.call($ul);
			o.onBeforeShow.call($ul);
			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
			return this;
		}
	});

})(jQuery);


/*
w3tabcontrol - скрипт для создания вкладок
версия: 1.0 от 01.02.2008
разработчики: http://w3box.ru
тип лицензии: freeware
w3box.ru © 2008
*/

function w3tabcontrol(obj_name, table_id)
{
	this.obj_name=obj_name;
	this.selected_tab=0;	
	this.tab_nav_nodes=new Array();
	this.tab_nodes=new Array();
	var t=document.getElementById(table_id);	
	var arr=t.getElementsByTagName('THEAD');
	this.tab_nav_nodes=arr[0].getElementsByTagName('A');
	for (var i=0; i<this.tab_nav_nodes.length; i++)
	{
		this.tab_nav_nodes[i].w3tabcontrol_object=this;
		this.tab_nav_nodes[i].w3tabcontrol_count=i;
		this.tab_nav_nodes[i].onclick=function () { this.w3tabcontrol_object.activate(this.w3tabcontrol_count); };
		if (this.tab_nav_nodes[i].hash==document.location.hash) this.selected_tab=i;
	}	
	arr=t.getElementsByTagName('TBODY');
	var tbody=arr[0];	
	arr=arr[0].getElementsByTagName('TD');
	var elements=arr[0].childNodes;	
	for (var i=0; i<elements.length; i++) if (elements[i].tagName==='DIV') this.tab_nodes[this.tab_nodes.length]=elements[i];	
	this.activate(this.selected_tab);
}

w3tabcontrol.prototype.activate=function(count)
{
	this.tab_nodes[this.selected_tab].style.display='none';
	this.tab_nav_nodes[this.selected_tab].className='';
	this.selected_tab=count;
	this.tab_nodes[this.selected_tab].style.display='block';
	this.tab_nav_nodes[this.selected_tab].className='selected';
}

/////////////////////////
// Tool Tip
/////////////////////////

var OP = (navigator.userAgent.indexOf('Opera') != -1);
var IE = (navigator.userAgent.indexOf('MSIE') != -1 && !OP);
var GK = (navigator.userAgent.indexOf('Gecko') != -1);
var SA = (navigator.userAgent.indexOf('Safari') != -1);
var DOM = document.getElementById;

var tooltip = null;

function TOOLTIP() {
	this.width          = 300;
	this.style          = 'tooltip';
	this.opacity        = 100;  
	this.cursorDistance = 4;
	
	// don't change
	this.text = '';
	this.height = 0;
	this.obj = null;
	this.active = false;

	this.create = function() {
    	if (!this.obj) {
			this.init();
		}
		
		var t = '<div class="' + this.style + '" style="width: ' + this.width + 'px;">' + this.text + '</div>';

		if (DOM || IE) {
			this.obj.innerHTML = t;
		}
	
		if (DOM) {
			this.height = this.obj.offsetHeight;
		} else if (IE) {
			this.height = this.obj.style.pixelHeight;
		}

		this.setOpacity();
		this.move();
		this.show();
	}

	this.init = function() {
		if (DOM) {
			this.obj = document.getElementById('toolbox');
		} else if (IE) {
			this.obj = document.all.toolbox;
		}
	}

	this.move = function() {
		var winX = getWinX() - (((GK && !SA) || OP) ? 0 : 0);
		var winY = getWinY() - (((GK && !SA) || OP) ? 0 : 0);
		var x = mouseX;
		var y = mouseY;

		if (y + this.height + this.cursorDistance > winY + getScrY()) {
			y -= this.height;
			name = 'top';
		} else {
			y += this.cursorDistance;
			name = 'bottom';
			
		}
		
		if (x + this.width + this.cursorDistance > winX + getScrX()) {
			x -= this.width + this.cursorDistance;
			name = name + '_left';
		} else {
			x += this.cursorDistance;
			name = name + '_right';
		} 		
		
		this.obj.className  = name;
		this.obj.style.left = x + 'px';
		this.obj.style.top  = y + 'px';
	}
	
	this.show = function() {
		this.obj.style.zIndex = 100;
		this.active = true;
		this.obj.style.visibility = 'visible';
	}
	
	this.hide = function() {
		this.obj.style.zIndex = -1;
		this.active = false;
		this.obj.style.visibility = 'hidden';
	}
	
	this.setOpacity = function() {
		this.obj.style.opacity      = this.opacity / 100;
		this.obj.style.MozOpacity   = this.opacity / 100;
		this.obj.style.KhtmlOpacity = this.opacity / 100;
		this.obj.style.filter       = 'alpha(opacity=' + this.opacity + ')';
	}
}

function getScrX() {
	var offset = 0;
	
	if (window.pageXOffset) {
    	offset = window.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollLeft) {
    	offset = document.documentElement.scrollLeft;
	} else if (document.body && document.body.scrollLeft) {
    	offset = document.body.scrollLeft;
	}
	
	return offset;
}

function getScrY() {
	var offset = 0;
	
	if (window.pageYOffset) {
		offset = window.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {
		offset = document.documentElement.scrollTop;
	} else if(document.body && document.body.scrollTop) {
		offset = document.body.scrollTop;
	}
	
	return offset;
}

function getWinX() {
	var size = 0;
	
	if (window.innerWidth) {
		size = window.innerWidth;
	} else if(document.documentElement && document.documentElement.clientWidth) {
		size = document.documentElement.clientWidth;
	} else if(document.body && document.body.clientWidth) {
		size = document.body.clientWidth; 
	} else {
		size = screen.width;
	}
	
	return size;
}

function getWinY() {
	var size = 0;
	
	if (window.innerHeight) {
		size = window.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		size = document.documentElement.clientHeight; 
	} else if (document.body && document.body.clientHeight) {
		size = document.body.clientHeight;
	} else {
		size = screen.height;
	}
	
	return size;
}

function getMouseXY(e) {
	if (e && e.pageX != null) {
		mouseX = e.pageX;
		mouseY = e.pageY;
	} else if(event && event.clientX != null) {
		mouseX = event.clientX + getScrX();
		mouseY = event.clientY + getScrY();
	}
	
	if (mouseX < 0) {
		mouseX = 0;
	}
	
	if (mouseY < 0) {
		mouseY = 0;
	}
	
	if (tooltip && tooltip.active) {
		tooltip.move();
	}
}

function toolTip(text, width, style, opacity) {
	if (text) {
		tooltip = new TOOLTIP();
		
		tooltip.text = text;
		
		if (width) {
			tooltip.width = width;
		}

		if (style) {
			tooltip.style = style;
		}
		
    	if (opacity) {
			tooltip.opacity = opacity;
		}
    	
		tooltip.create();
	} else if (tooltip) {
		tooltip.hide();
	}
}

document.write('<div id="toolbox" style="position: absolute; visibility: hidden;"></div>');

var mouseX = mouseY = 0;
document.onmousemove = getMouseXY;



