﻿/****************************************************************************************	
[GLOBAL JQUERY FUNCTIONS]
*****************************************************************************************/
$(document).ready(function () {
    // Superfish dropdown menu
    $("ul#nav-main").superfish({ delay: 400, animation: { height: "show" }, speed: "fast", autoArrows: false, dropShadows: false });

    // Home Page Hero Banners
    $('#h-carousel ul').cycle({ speed: 2000, timeout: 8000, height: '369px', next: '#next', prev: '#previous' });

    // Home Page News
    $('#news ul').cycle({ speed: '1000', timeout: 4000, height: '30px' });

    // Home Page Team
    $('#team ul').cycle({ speed: '1000', timeout: 4000 });

    // Carousel
    // Make scriptable
    $('#carousel').addClass('js');
    //Append an element to contain the descriptions
    $('<div class="carousel-data"></div>').appendTo('#content-main');
    // Handle carousel
    $('#carousel .thumbs').carousel(250, '#previous', '#next', false, 5000);
    $('#carousel li a').click(function (e) {
        e.preventDefault();
        // Change Image
        $('#carousel .l-img').attr('src', $(this).attr('href'));
        // Add active class
        $('#carousel li').removeClass('active');
        $(this).parent().addClass('active');
        //Handle WYSIWYG data
        $('.carousel-data').html($('li.active div').html());
    });
    // First WYSIWYG data
    $('.carousel-data').html($('li.active div').html());

    // Prev/Next buttons
    $('#previous, #next').css('display', 'block');
    // Property Carousel: Disable if less that 6 images exisit
    if ($('#carousel li').length < 6) $('#carousel #previous, #carousel #next').css('display', 'none');

    // Clear text input values
    var swap_text_boxes = [];
    jQuery.each($("input[type='text'].autoclear"), function () {
        swap_text_boxes[$(this).attr('id')] = $(this).attr('value');
        $(this).bind('focus', function () {
            if ($(this).val() == swap_text_boxes[$(this).attr('id')]) {
                $(this).val('');
            }
        });
        $(this).bind('blur', function () {
            if ($(this).val() == '') {
                $(this).val(swap_text_boxes[$(this).attr('id')]);
            }
        });
    });

    // Enable forms to be submitted via ENTER key
    var AreaSelector = "#content-wrapper, .search";
    var ButtonSelector = "input[type='submit'],input[type='image'],button";
    jQuery.each($(AreaSelector), function () {
        $(this).keypress(function (e) {
            if (e.which == 13 && e.target.type != 'textarea') {
                var arrItems = $(this).find(ButtonSelector);
                if (arrItems.length > 0) {
                    $(this).find(ButtonSelector)[0].click();
                }
                return false;
            }
        });
    });

});
/****************************************************************************************	
[JQUERY PLUG-INS]
*****************************************************************************************/
// 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
eval(function (p, a, c, k, e, r) { 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--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[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 } (';(2($){$.k.z=2(d){4 e=$.k.z,c=e.c,$N=$([\'<O 1k="\',c.P,\'"> &#1l;</O>\'].g(\'\')),q=2(){4 a=$(3),l=A(a);Q(l.B);a.R().1m().r()},C=2(){4 a=$(3),l=A(a),o=e.9;Q(l.B);l.B=1n(2(){o.D=($.1o(a[0],o.$m)>-1);a.r();t(o.$m.E&&a.F([\'h.\',o.j].g(\'\')).E<1){q.8(o.$m)}},o.S)},A=2(a){4 b=a.F([\'5.\',c.G,\':T\'].g(\'\'))[0];e.9=e.o[b.U];u b},V=2(a){a.v(c.W).1p($N.1q())};u 3.n(2(){4 s=3.U=e.o.E;4 o=$.X({},e.Y,d);o.$m=$(\'h.\'+o.H,3).1r(0,o.Z).n(2(){$(3).v([o.j,c.I].g(\' \')).1s(\'h:10(5)\').11(o.H)});e.o[s]=e.9=o;$(\'h:10(5)\',3)[($.k.12&&!o.13)?\'12\':\'1t\'](q,C).n(2(){t(o.14)V($(\'>a:T-1u\',3))}).w(\'.\'+c.I).r();4 b=$(\'a\',3);b.n(2(i){4 a=b.15(i).F(\'h\');b.15(i).1v(2(){q.8(a)}).1w(2(){C.8(a)})});o.16.8(3)}).n(2(){4 a=[c.G];t(e.9.J&&!($.x.17&&$.x.18<7))a.1x(c.y);$(3).v(a.g(\' \'))})};4 f=$.k.z;f.o=[];f.9={};f.K=2(){4 o=f.9;t($.x.17&&$.x.18>6&&o.J&&o.L.19!=1y)3.1z(f.c.y+\'-1a\')};f.c={I:\'p-1A\',G:\'p-1B-1C\',W:\'p-1D-5\',P:\'p-1E-1F\',y:\'p-1G\'};f.Y={j:\'1H\',H:\'1I\',Z:1,S:1J,L:{19:\'1K\'},1b:\'1L\',14:M,J:M,13:1c,16:2(){},1d:2(){},1e:2(){},1f:2(){}};$.k.X({r:2(){4 o=f.9,w=(o.D===M)?o.$m:\'\';o.D=1c;4 a=$([\'h.\',o.j].g(\'\'),3).1M(3).w(w).11(o.j).1g(\'>5\').1N().1h(\'1i\',\'1j\');o.1f.8(a);u 3},R:2(){4 o=f.9,1O=f.c.y+\'-1a\',$5=3.v(o.j).1g(\'>5:1j\').1h(\'1i\',\'1P\');f.K.8($5);o.1d.8($5);$5.1Q(o.L,o.1b,2(){f.K.8($5);o.1e.8($5)});u 3}})})(1R);', 62, 116, '||function|this|var|ul|||call|op|||||||join|li||hoverClass|fn|menu|path|each||sf|over|hideSuperfishUl||if|return|addClass|not|browser|shadowClass|superfish|getMenu|sfTimer|out|retainPath|length|parents|menuClass|pathClass|bcClass|dropShadows|IE7fix|animation|true|arrow|span|arrowClass|clearTimeout|showSuperfishUl|delay|first|serial|addArrow|anchorClass|extend|defaults|pathLevels|has|removeClass|hoverIntent|disableHI|autoArrows|eq|onInit|msie|version|opacity|off|speed|false|onBeforeShow|onShow|onHide|find|css|visibility|hidden|class|187|siblings|setTimeout|inArray|append|clone|slice|filter|hover|child|focus|blur|push|undefined|toggleClass|breadcrumb|js|enabled|with|sub|indicator|shadow|sfHover|overideThisToUse|800|show|normal|add|hide|sh|visible|animate|jQuery'.split('|'), 0, {}))
//jQuery Infinite Carousel - Copyright 2009 Stéphane Roucheray
jQuery.fn.carousel = function (speed, previous, next, autoscroll, duration, options) { var sliderList = jQuery(this).children("ul")[0]; if (sliderList) { var increment = jQuery(sliderList).children().outerWidth("true"), elmnts = jQuery(sliderList).children(), numElmts = elmnts.length, sizeFirstElmnt = increment, shownInViewport = Math.round(jQuery(this).width() / sizeFirstElmnt), firstElementOnViewPort = 1, isAnimating = false; if (numElmts <= shownInViewport) { jQuery(previous).hide(); jQuery(next).hide(); jQuery(sliderList).css('width', (numElmts + shownInViewport) * increment + increment + "px"); } else { for (i = 0; i < shownInViewport; i++) { jQuery(sliderList).css('width', (numElmts + shownInViewport) * increment + increment + "px"); if (i < numElmts) { jQuery(sliderList).append(jQuery(elmnts[i]).clone()); }; } }; jQuery(previous).click(function (event) { event.preventDefault(); if (!isAnimating) { if (firstElementOnViewPort == 1) { jQuery(sliderList).css('left', "-" + numElmts * sizeFirstElmnt + "px"); firstElementOnViewPort = numElmts; } else { firstElementOnViewPort--; } jQuery(sliderList).animate({ left: "+=" + increment, y: 0, queue: false }, speed, "swing", function () { isAnimating = false; }); isAnimating = true; } }); jQuery(next).click(function (event) { event.preventDefault(); if (!isAnimating) { if (firstElementOnViewPort > numElmts) { firstElementOnViewPort = 2; jQuery(sliderList).css('left', "0px"); } else { firstElementOnViewPort++; } jQuery(sliderList).animate({ left: "-=" + increment, y: 0, queue: false }, speed, "swing", function () { isAnimating = false; }); isAnimating = true; } }); if (autoscroll && numElmts > shownInViewport) { var intervalId = window.setInterval(function () { jQuery(next).click(); }, duration); jQuery(this).mouseenter(function () { window.clearInterval(intervalId); }); jQuery(this).mouseleave(function () { intervalId = window.setInterval(function () { jQuery(next).click(); }, duration); }); } } };
// jQuery Cycle Plugin (lite) Examples and documentation at: http://jquery.malsup.com/cycle/ Copyright (c) 2007-2010 M. Alsup Version: 2.88 (08-JUN-2010) Dual licensed under the MIT and GPL licenses. http://jquery.malsup.com/license.html
(function (D) { var A = "Lite-1.0"; D.fn.cycle = function (E) { return this.each(function () { E = E || {}; if (this.cycleTimeout) { clearTimeout(this.cycleTimeout) } this.cycleTimeout = 0; this.cyclePause = 0; var I = D(this); var J = E.slideExpr ? D(E.slideExpr, this) : I.children(); var G = J.get(); if (G.length < 2) { if (window.console && window.console.log) { window.console.log("terminating; too few slides: " + G.length) } return } var H = D.extend({}, D.fn.cycle.defaults, E || {}, D.metadata ? I.metadata() : D.meta ? I.data() : {}); H.before = H.before ? [H.before] : []; H.after = H.after ? [H.after] : []; H.after.unshift(function () { H.busy = 0 }); var F = this.className; H.width = parseInt((F.match(/w:(\d+)/) || [])[1]) || H.width; H.height = parseInt((F.match(/h:(\d+)/) || [])[1]) || H.height; H.timeout = parseInt((F.match(/t:(\d+)/) || [])[1]) || H.timeout; if (I.css("position") == "static") { I.css("position", "relative") } if (H.width) { I.width(H.width) } if (H.height && H.height != "auto") { I.height(H.height) } var K = 0; J.css({ position: "absolute", top: 0, left: 0 }).hide().each(function (M) { D(this).css("z-index", G.length - M) }); D(G[K]).css("opacity", 1).show(); if (D.browser.msie) { G[K].style.removeAttribute("filter") } if (H.fit && H.width) { J.width(H.width) } if (H.fit && H.height && H.height != "auto") { J.height(H.height) } if (H.pause) { I.hover(function () { this.cyclePause = 1 }, function () { this.cyclePause = 0 }) } D.fn.cycle.transitions.fade(I, J, H); J.each(function () { var M = D(this); this.cycleH = (H.fit && H.height) ? H.height : M.height(); this.cycleW = (H.fit && H.width) ? H.width : M.width() }); J.not(":eq(" + K + ")").css({ opacity: 0 }); if (H.cssFirst) { D(J[K]).css(H.cssFirst) } if (H.timeout) { if (H.speed.constructor == String) { H.speed = { slow: 600, fast: 200}[H.speed] || 400 } if (!H.sync) { H.speed = H.speed / 2 } while ((H.timeout - H.speed) < 250) { H.timeout += H.speed } } H.speedIn = H.speed; H.speedOut = H.speed; H.slideCount = G.length; H.currSlide = K; H.nextSlide = 1; var L = J[K]; if (H.before.length) { H.before[0].apply(L, [L, L, H, true]) } if (H.after.length > 1) { H.after[1].apply(L, [L, L, H, true]) } if (H.click && !H.next) { H.next = H.click } if (H.next) { D(H.next).bind("click", function () { return C(G, H, H.rev ? -1 : 1) }) } if (H.prev) { D(H.prev).bind("click", function () { return C(G, H, H.rev ? 1 : -1) }) } if (H.timeout) { this.cycleTimeout = setTimeout(function () { B(G, H, 0, !H.rev) }, H.timeout + (H.delay || 0)) } }) }; function B(J, E, I, K) { if (E.busy) { return } var H = J[0].parentNode, M = J[E.currSlide], L = J[E.nextSlide]; if (H.cycleTimeout === 0 && !I) { return } if (I || !H.cyclePause) { if (E.before.length) { D.each(E.before, function (N, O) { O.apply(L, [M, L, E, K]) }) } var F = function () { if (D.browser.msie) { this.style.removeAttribute("filter") } D.each(E.after, function (N, O) { O.apply(L, [M, L, E, K]) }) }; if (E.nextSlide != E.currSlide) { E.busy = 1; D.fn.cycle.custom(M, L, E, F) } var G = (E.nextSlide + 1) == J.length; E.nextSlide = G ? 0 : E.nextSlide + 1; E.currSlide = G ? J.length - 1 : E.nextSlide - 1 } if (E.timeout) { H.cycleTimeout = setTimeout(function () { B(J, E, 0, !E.rev) }, E.timeout) } } function C(E, F, I) { var H = E[0].parentNode, G = H.cycleTimeout; if (G) { clearTimeout(G); H.cycleTimeout = 0 } F.nextSlide = F.currSlide + I; if (F.nextSlide < 0) { F.nextSlide = E.length - 1 } else { if (F.nextSlide >= E.length) { F.nextSlide = 0 } } B(E, F, 1, I >= 0); return false } D.fn.cycle.custom = function (K, H, I, E) { var J = D(K), G = D(H); G.css({ opacity: 0 }); var F = function () { G.animate({ opacity: 1 }, I.speedIn, I.easeIn, E) }; J.animate({ opacity: 0 }, I.speedOut, I.easeOut, function () { J.css({ display: "none" }); if (!I.sync) { F() } }); if (I.sync) { F() } }; D.fn.cycle.transitions = { fade: function (F, G, E) { G.not(":eq(0)").css("opacity", 0); E.before.push(function () { D(this).show() }) } }; D.fn.cycle.ver = function () { return A }; D.fn.cycle.defaults = { timeout: 4000, speed: 1000, next: null, prev: null, before: null, after: null, height: "auto", sync: 1, fit: 0, pause: 0, delay: 0, slideExpr: null} })(jQuery)
// Thickbox 3 - One Box To Rule Them All
var tb_pathToImage = "/images/pre-loaders/loader2.gif";
$(document).ready(function () { tb_init('a.thickbox, area.thickbox, input.thickbox'); imgLoader = new Image(); imgLoader.src = tb_pathToImage; }); function tb_init(domChunk) { $(domChunk).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(caption, url, imageGroup) { 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' role='dialog' aria-live='assertive' aria-relevant='additions'></div>"); } } else { if (document.getElementById("TB_overlay") === null) { $("body").append("<div id='TB_overlay'></div><div id='TB_window' role='dialog' aria-live='assertive' aria-relevant='additions'></div>"); $("#TB_overlay").click(tb_remove); } } if (tb_detectMacXFF()) { $("#TB_overlay").addClass("TB_overlayMacFFBGHack"); } else { $("#TB_overlay").addClass("TB_overlayBG"); } if (caption === null) { caption = ""; } $("body").append("<div id='TB_load'><img src='" + imgLoader.src + "' alt='Loading...' /></div>"); $('#TB_load').show(); var baseURL; if (url.indexOf("?") !== -1) { baseURL = url.substr(0, url.indexOf("?")); } else { baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') { TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if (imageGroup) { TB_TempArray = $("a[rel=" + imageGroup + "]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "<a href='#' id='TB_next'><img src='/images/template/tbox-nxt.gif' width='32' height='32' alt='Next' /></a>"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "<a href='#' id='TB_prev'><img src='/images/template/tbox-prev.gif' width='32' height='32' alt='Previous' /></a>"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) + " of " + (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function () { imgPreloader.onload = null; var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; $("#TB_window").append("<a href='#' id='TB_ImageOff' title='Close'><img id='TB_Image' src='" + url + "' width='" + imageWidth + "' height='" + imageHeight + "' alt='" + caption + "' /></a>" + "<p id='TB_footer'>" + TB_PrevHTML + TB_NextHTML + "<span>" + TB_imageCount + " | <em>" + caption + "</em></span></p><a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a>"); $("#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, imageGroup); 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, imageGroup); 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({ position: "fixed", top: "50%", left: "50%", height: "auto", overflow: "auto" }); if (typeof document.body.style.maxHeight === "undefined") { $("#TB_window").css({ position: "absolute" }); }; }; imgPreloader.src = url; } else { var queryString = url.replace(/^[^\?]+\??/, ''); var params = tb_parseQuery(queryString); TB_WIDTH = (params['width'] * 1) + 30 || 630; TB_HEIGHT = (params['height'] * 1) + 40 || 440; ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if (url.indexOf('TB_iframe') != -1) { urlNoQuery = url.split('TB_'); $("#TB_iframeContent").remove(); if (params['modal'] != "true") { $("#TB_window").css({ padding: "15px 15px 48px" }).append("<a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a><iframe allowtransparency='true' frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' > </iframe>"); } else { $("#TB_overlay").unbind(); $("#TB_window").css({ padding: "15px" }).append("<iframe allowtransparency='true' frameborder='0' hspace='0' src='" + urlNoQuery[0] + "' id='TB_iframeContent' name='TB_iframeContent" + Math.round(Math.random() * 1000) + "' onload='tb_showIframe()' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;'> </iframe>"); } } else { if ($("#TB_window").css("overflow") != "visible") { if (params['modal'] != "true") { $("#TB_window").css({ padding: "15px 15px 48px" }).append("<a href='#' id='TB_closeWindowButton'><img src='/images/template/tbox-close.gif' width='32' height='32' alt='Close' /></a><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px'></div>"); } else { $("#TB_overlay").unbind(); $("#TB_window").css({ padding: "15px" }).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(caption); } } $("#TB_closeWindowButton").click(tb_remove); if (url.indexOf('TB_inline') != -1) { $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); $("#TB_window").unload(function () { $('#' + params['inlineId']).append($("#TB_ajaxContent").children()); }); tb_position(); $("#TB_load").remove(); $("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", width: "auto", overflow: "visible" }); if (typeof document.body.style.maxHeight === "undefined") { $("#TB_window").css({ position: "absolute" }); }; } else if (url.indexOf('TB_iframe') != -1) { tb_position(); if ($.browser.safari) { $("#TB_load").remove(); $("#TB_window").css({ display: "block" }); } } else { $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()), function () { tb_position(); $("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); $("#TB_window").css({ position: "fixed", top: "50%", left: "50%", height: "auto", width: "auto", overflow: "visible" }); if (typeof document.body.style.maxHeight === "undefined") { $("#TB_window").css({ position: "absolute" }); }; }); } } if (!params['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({ position: "fixed", top: "50%", left: "50%", height: "auto", overflow: "visible" }); if (typeof document.body.style.maxHeight === "undefined") { $("#TB_window").css({ position: "absolute" }); }; } function tb_remove() { $("#TB_imageOff").unbind("click"); $("#TB_closeWindowButton").unbind("click"); $("#TB_window,#TB_overlay").fadeOut("fast", function () { $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); }); $("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") { $("body", "html").css({ height: "auto", width: "auto" }); $("html").css("overflow", ""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { $("#TB_window").css({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px' }); if (!(jQuery.browser.msie && jQuery.browser.version < 7)) { $("#TB_window").css({ marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' }); } } function tb_parseQuery(query) { var Params = {}; if (!query) { return Params; } var Pairs = query.split(/[;&]/); for (var i = 0; i < Pairs.length; i++) { var KeyVal = Pairs[i].split('='); if (!KeyVal || KeyVal.length != 2) { continue; } var key = unescape(KeyVal[0]); var val = unescape(KeyVal[1]); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize() { var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight; arrayPageSize = [w, h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) { return true; } }
