/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/109/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight, noadd) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
                        if (noadd == 0) {
                            $(this).height(tallest+75).css("overflow","visible");
                        } else {
                            //dla product list
                            $(this).height(tallest+15).css("overflow","visible");
                        }
			
		});
	}
})(jQuery);/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};/*
 * Style File - jQuery plugin for styling file input elements
 *
 * Copyright (c) 2007-2008 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Based on work by Shaun Inman
 *   http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom
 *
 * Revision: $Id: jquery.filestyle.js 303 2008-01-30 13:53:24Z tuupola $
 *
 */

(function($) {

    $.fn.filestyle = function(options) {

        /* TODO: This should not override CSS. */
        var settings = {
            width : 250
        };

        if(options) {
            $.extend(settings, options);
        };

        return this.each(function() {

            var self = this;
            var wrapper = $("<div>")
                            .css({
                                "width": settings.imagewidth + "px",
                                "height": settings.imageheight + "px",
                                "background": "url(" + settings.image + ") 0 0 no-repeat",
                                "background-position": "right",
                                "display": "inline",
                                "position": "absolute",
                                "overflow": "hidden",
                                "margin-top": "1px"
                            });

            var filename = $('<input class="file">')
                             .addClass($(self).attr("class"))
                             .css({
                                 "display": "inline",
                                 "width": settings.width + "px",
                                 "margin-right": "5px"
                             });

            $(self).before(filename);
            $(self).wrap(wrapper);

            $(self).css({
                        "position": "relative",
                        "height": settings.imageheight + "px",
                        "width": settings.width + "px",
                        "display": "inline",
                        "cursor": "pointer",
                        "opacity": "0.0"
                    });

            if ($.browser.mozilla) {
                if (/Win/.test(navigator.platform)) {
                    $(self).css("margin-left", "-142px");
                } else {
                    $(self).css("margin-left", "-168px");
                };
            } else {
                $(self).css("margin-left", settings.imagewidth - settings.width + "px");
            };

            $(self).bind("change", function() {
                filename.val($(self).val());
            });

        });


    };

})(jQuery);
//metoda uruchamiana na zaÅ‚adowanie strony
    var elements = 3;
    var $i = 3;
    var $loading = '';
    
function start(){
    addBrowserNameClass();
    //leftMenuHover();
    headerInfoHover();
    headerInfoHoverLinks();
    headerInfoClick();
    headerImagePositionFix();
    mainMenuHover();
    browserVersionCheck();
    //leftMenuHideElements();
    //leftMenuAddVerticalLine();
    smartGalleryStart();
    fileChooser();
    //leftMenuAddArrowDown();
    SmartHeaderEvents();
    podmianaInputFile();
    $t=setInterval('autoChange()',4000);
    window.onresize = headerImagePositionFix;

    nadawanieWysokosci();
    breadcrumbsOfertaPatch();
    $loading = new Loading();
    $loading.start($smartHeaderInterval);
    $(".titleinvalue").fieldtag();



    //ObsÅ‚uga gÅ‚Ã³wnego menu
    $(".left-menu-element.active.level1.active.active").children("a").attr("id","wcisniety");
    $(".left-menu-element.active:not(.left-menu-element.active .left-menu-element.active)").prevAll().attr("style", "margin-left: 6px;").children().attr("style", "padding-left: 18px;");
    $(".left-menu-element.active.level2:not(.left-menu-element.active.level2 .left-menu-element.active.level2)").prevAll().attr("style", "margin-left: 6px;").children().attr("style", "padding-left: 30px; background-position: -184px 0;");
    $(".left-menu-element.active.level2").children("a").attr("style", "border-top: 0");
    if (($(".left-menu-element.active.level2").length)>0) {
        $("#wcisniety").attr("style", "margin-left: 6px; padding-left: 18px;").removeAttr("id");
    }

    if ($.browser.msie && $.browser.version == "7.0") {
        $(".left-menu-element.level1:not(.left-menu-element.active.level1) ul").remove();
    }

//    $('.subpage-box-main a img').parent().lightBox({
//        fixedNavigation:true,
//        txtImage: 'Obraz',
//	txtOf: 'z'
//    });
    var elems = new Array();
    $('.subpage-box-main a img').parent().each(function(){
        
        if (!$(this).hasClass("statyczne")) {
            var tab = $(this).attr("href").toLowerCase().split(".");

            var extention = tab[tab.length-1];
            if(extention == "jpg" || extention == "jpeg" || extention == "bmp" || extention == "png" || extention == "gif" || extention == "tif" || extention == "tiff"){
                $(this).addClass("lightboximg");
            }
        }
    });
    $(".lightboximg").lightBox({
        fixedNavigation:true,
        txtImage: 'Obraz',
        txtOf: 'z'
    });
}

function breadcrumbsOfertaPatch() {
    if ($(".B_firstCrumb a").html() == 'Oferta') {
        $(".B_firstCrumb").html('<span class="B_crumb">Oferta</span>').css("font-weight", "normal");
    }
}

function podmianaInputFile() {
    $(".subpage-box-content input[type=file]").filestyle({
         image: "./images/input-file-button.gif",
         imageheight : 24,
         imagewidth : 62,
         width : 415
    });
}

function nadawanieWysokosci() {
    $(".smart_wdrozenie").each(function(index){
        if((index % 2) == 0) {
            $(".smart_wdrozenie:nth-child("+(index+1)+"), .smart_wdrozenie:nth-child("+(index+2)+")").equalHeights();

        }
    });

    if (jQuery.browser.safari || jQuery.browser.webkit) {
      $(".smart_wdrozenie").equalHeights()
    }
    //$(".opis_projektu_tresc").equalHeights(210);
    $(".product_list").equalHeights(0,0,1);
}

function fileChooser(){
    $("#file-value").change(
        function () {
            //alert($(this).attr("value"));
            $("#file-input").attr("value", $(this).attr("value"));
        });
}

function browserVersionCheck() {
    var Browser = {
        Version: function() {
            var version = 999; // we assume a sane browser
            if (navigator.appVersion.indexOf("MSIE") != -1)
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
            return version;
        }
    }
    if(Browser.Version() < 7) {
        document.write("Strona w trakcie przebudowy. UÅ¼yj przeglÄ…darki nowszej niÅ¼ Internet Explorer 6");
    }
}

function addBrowserNameClass() {
    var Browser = {
        Version: function() {
            var version = 999; // we assume a sane browser
            if (navigator.appVersion.indexOf("MSIE") != -1)
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
            return version;
        }
    }
    
    if(Browser.Version() == 7) {
        $("body").addClass("ie7");
    }else if(Browser.Version() == 8) {
        $("body").addClass("ie8");
    }
    
}

function mainMenuHover(){
    
    $(".menu-element").hover(
      function () {
          $(this).addClass("over");
      },
      function () {
          $(this).removeClass("over");
      }
    );

    if ($("body").hasClass("ie7")){

        $("#header-main-image-over").hide();
        $(".menu-element.extended-offer").css("cursor", "pointer").toggle(
          function () {

              $(this).addClass("offer");

              $top = $(this).position().top-6;
              $left = $(this).position().left+6;
              $("#main-offer").css("top", $top+"px").css("left", $left+"px").show();
              $("#main-offer").css("border-top", "6px solid #a8d601");
          },
          function () {
            if(!($("#main-offer").hasClass("asqw"))){
                $(".menu-element.extended-offer").removeClass("offer");
                $("#main-offer").hide();
			}
          }
        );
		
		$(".menu-element.extended-academy").css("cursor", "pointer").toggle(
          function () {

              $(this).addClass("academy");

              $top = $(this).position().top-6;
              $left = $(this).position().left+6;
              $("#main-academy").css("top", $top+"px").css("left", $left+"px").show();
              $("#main-academy").css("border-top", "6px solid #a8d601");
          },
          function () {
            if(!($("#main-academy").hasClass("asqw"))){
                $(".menu-element.extended-academy").removeClass("academy");
                $("#main-academy").hide();
            }
          }
        );

    }else{
        
        $(".menu-element.extended-offer").hover(
          function () {

              $(this).addClass("offer");

              $top = $(this).position().top-6;
              $left = $(this).position().left+6;
              $("#main-offer").css("top", $top+"px").css("left", $left+"px").show();
              $("#main-offer").css("border-top", "6px solid #a8d601");
          },
          function () {
              $(".menu-element.extended-offer").removeClass("offer");
			  $("#main-offer").hide();
          }
        );

        $("#main-offer").hover(

          function () {
              $(".menu-element.extended-offer").addClass("over");
              $("#main-offer").css("top", $top+"px").css("left", $left+"px").show();
          },
          function () {
              $(".menu-element.extended-offer").removeClass("over");
              $(".menu-element.extended-offer").removeClass("offer");
              $("#main-offer").hide();
          }
        );
		
		$(".menu-element.extended-academy").hover(
          function () {

              $(this).addClass("academy");

              $top = $(this).position().top-6;
              $left = $(this).position().left+6;
              $("#main-academy").css("top", $top+"px").css("left", $left+"px").show();
              $("#main-academy").css("border-top", "6px solid #a8d601");
          },
          function () {
              $(".menu-element.extended-academy").removeClass("academy");
			  $("#main-academy").hide();
          }
        );

        $("#main-academy").hover(

          function () {
              $(".menu-element.extended-academy").addClass("over");
              $("#main-academy").css("top", $top+"px").css("left", $left+"px").show();
          },
          function () {
              $(".menu-element.extended-academy").removeClass("over");
              $(".menu-element.extended-academy").removeClass("academy");
              $("#main-academy").hide();
          }
        );

    }
    
}

function tabMouseOut(){
    $(".menu-element.extended").removeClass("offer");
    $("#main-offer").fadeOut();
}

function headerInfoHover(){
    $(".header-main-info-tabs-tab").hover(
      function () {
          $(this).addClass("over");
      },
      function () {
          $(this).removeClass("over");
      }
    );
}

function headerInfoHoverLinks(){
    $(".header-main-info-tabs-tab div").hover(
      function () {
          $(this).addClass("over");
      },
      function () {
          $(this).removeClass("over");
      }
    );
}

function showActiveTabContent(elem){
    $(".info-link-text").fadeOut("fast");
    elem.fadeIn("fast");
}

function headerInfoClick() {
      $(".header-main-info-tabs-tab").dblclick(
        function () {
            clearInterval($t);
            $t=setInterval('autoChange()',4000);

            $(".header-main-info-tabs-tab").removeClass("active");
            $(this).addClass("active");

            elemId = $(this).attr("id") + "-text";
            elem = $("#"+elemId);
            showActiveTabContent(elem);
        });

      $(".header-main-info-tabs-tab").click(
        function () {
            clearInterval($t);
            
            $(".header-main-info-tabs-tab").removeClass("active");
            $(this).addClass("active");

            elemId = $(this).attr("id") + "-text";
            elem = $("#"+elemId);
            showActiveTabContent(elem);
        });
}

function headerImagePositionFix() {
    width = document.documentElement.clientWidth;
    res = Math.round((width-970)/2);
    pos = "-"+(462-res)+"px 0";
    $("#asdf").css( {backgroundPosition: pos} )
}

function autoChange(){
    $i++;
    $j = ($i % 3) + 1;
//    alert($(".header-main-info-tabs div:nth-child(" + $j + ")").attr("id"))
    tabName = "#header-info-link-" + $j;
    $(tabName).trigger('dblclick');
}


$smi = 1;
$sminterval = 5000;
$smj = 0;
$elementsClass = ".box-gall";
$container = "#smartGallery";
$fadeSpeed = 1000;
$smt = 0;
$pause = 0;


function smartGalleryStart(){
    smartGalleryPlayPause();
    $($elementsClass+":first-child").fadeIn($fadeSpeed);
    $smt=setInterval('smartGalleryAutoChange()',$sminterval);
    smartGalleryBoxClick();
}

function smartGalleryPlayPause(){
    $($container).click(
        function() {
            if($pause == 0){
                clearInterval($smt);
//                $t = '';
                $pause = 1;
            }else{
                $pause = 0;
                $smt=setInterval('smartGalleryAutoChange()',$sminterval);
            }
        }
    );
}

function smartGalleryBoxClick() {
      $($elementsClass).dblclick(
        function () {
            clearInterval($smt);
            $smt=setInterval('smartGalleryAutoChange()',$sminterval);
//            if ($(this).html() == $($elementsClass+":first-child").html()){
//                $($elementsClass+":last-child").fadeOut($fadeSpeed);
//            }else{
//                $(this).prev().fadeOut($fadeSpeed);
//            }
            $($elementsClass).fadeOut($fadeSpeed);
            $(this).fadeIn($fadeSpeed);
        });
}

function smartGalleryAutoChange(){
    $smj = ($smi % $($elementsClass).size()) + 1;
    $("#info").html = $smj;
    $($elementsClass+":nth-child(" + $smj + ")").trigger('dblclick');
    $smi++;
}
/*
 * klasa Loading
 * atrybuty:
 * $steps - ilosc krokow
 *
 * metody:
 * setLoop(bool) - ustawienie petli
 * start(miliseconds) - uruchomienie ladowania - miliseconds: czas w jakim ma sie wywolac ladowanie
 */


function Loading() {
    this.$i = 0;
    this.$steps = 24;
    this.$delay = 0;
    this.$t = 0;
    this.$selector = ".smart-header-navigator-loading";
    this.$loop = true;
    this.$className = "smart-loading-";

    this.setLoop = function($bool){
        this.$loop = $bool;
    }

    this.test = function() {
        alert("works!");
    }

    this.lastStep = function(){
        $(this.$selector).removeClass(this.$className+this.$i);
        this.$i++;
        $(this.$selector).addClass(this.$className+this.$i);
        this.$i = 0;
    }

    this.changeImage = function (){
        $(this.$selector).removeClass(this.$className+this.$i);
        this.$i = ((this.$i+1) % this.$steps);
        $(this.$selector).addClass(this.$className+this.$i);
        //$(this.$selector).html(this.$i);
        if ((this.$i == (this.$steps-1)) && (!(this.$loop))){
            $(this.$selector).addClass(this.$className+this.$i);
            setTimeout(function() {callLastStep();}, this.$delay);
            clearInterval(this.$t);
        }
    }

    var myself = this;

    function callChangeImage() {
        myself.changeImage();
    }

    function callLastStep() {
        myself.lastStep();
    }

    function callStart() {
        myself.start(myself.time);
    }

    this.stop = function(){
        $(".smart-header-navigator-loading").attr("class" , "smart-header-navigator-loading smart-loading-0");
        //this.$i = ((this.$i+1) % this.$steps);
        //$(this.$selector).addClass(this.className+"0");
        clearInterval(this.$t);
        this.$i = 0;
        this.$t = '';
    }

    this.start = function ($time){
        //$(this.$selector).attr("class", "");
        this.$time = $time;
        this.$delay = Math.round(this.$time / this.$steps);
        this.$t=setInterval(callChangeImage, this.$delay);
    }
}
var $smartHeaderInterval = 9000;

var $smartHeaderTimer = setInterval('SmartHeaderEventNext()', $smartHeaderInterval);

var $paused = false;

var $prevIndex = 0;

var $effect = "slide";

var $additionalImages = true;

options = {direction: 'right'};



function SmartHeaderEventFirst(){

    SmartHeaderRefreshInterval();

    $(".smart-header-navigator-tab:first-child").dblclick();

}



function SmartHeaderEventPrev(){

    SmartHeaderRefreshInterval();

    var active = $(".smart-header-navigator-tab.active");

    var first = $(".smart-header-navigator-tab:first-child");

    if(active.html() != first.html()){

        active.prev().dblclick();

    }else{

        SmartHeaderEventLast();

    }

}



function SmartHeaderRefreshInterval(){

    if ($paused){

    

    }else{

        $loading.stop();

        $loading.start($smartHeaderInterval);



        clearInterval($smartHeaderTimer);

        $smartHeaderTimer = setInterval('SmartHeaderEventNext()', $smartHeaderInterval);

    }

}



function SmartHeaderEventPause(){

    $loading.stop();

    $(".smart-header-navigator-control.pause").addClass("play");

    $(".smart-header-navigator-control.pause.play").removeClass("pause");

    $paused = true;

    clearInterval($smartHeaderTimer);

}



function SmartHeaderEventPlay(){
    $smartHeaderTimer = setInterval('SmartHeaderEventNext()', $smartHeaderInterval);
    $paused = false;
    $(".smart-header-navigator-control.play.pause").removeClass("play");
    $(".smart-header-navigator-control.play").addClass("pause");

    $loading.start($smartHeaderInterval);
}



function SmartHeaderEventNext(){

    SmartHeaderRefreshInterval();

    var active = $(".smart-header-navigator-tab.active");

    var last = $(".smart-header-navigator-tab:last-child");

    if(active.html() != last.html()){

        active.next().dblclick();

    }else{

        SmartHeaderEventFirst();

    }

}



function SmartHeaderEventLast(){

    SmartHeaderRefreshInterval();

    $(".smart-header-navigator-tab:last-child").dblclick();

}



function SmartHeaderEvents(){

    $(".smart-header-window-tab-content:nth-child(1)").show($effect, options);



    if($additionalImages){

        $(".header-main-image-over-element:nth-child(1)").animate({top: "0"}, 500 );//.fadeIn("2000");

    }

    

    

    $(".smart-header-navigator-tab").mouseover(

        function () {

            $(this).addClass("over");

        }

    );

    

    $(".smart-header-navigator-tab").mouseout(

        function () {

            $(".smart-header-navigator-tab").removeClass("over");

        }

    );



    //dodawanie listy elementow z automatu

    $('.smart-header-window-tab-content').each(function(index) {

        $(".smart-header-navigator-tabs").append('<div class="smart-header-navigator-tab">' + (index+1) + '</div>');

    });

    $(".smart-header-navigator-tab:first-child").addClass("active");


    $(".smart-header-navigator-tab").click(

        function () {
            $(this).dblclick();
            $(".smart-header-navigator-control.pause").click();
        }
    );


    $(".smart-header-navigator-tab").dblclick(

        function () {

            SmartHeaderRefreshInterval();

            var index = $(".smart-header-navigator-tab").index(this);

            

            $(".smart-header-window-tab-content").fadeOut();



            if($additionalImages){

                $(".header-main-image-over-element").animate({top: "270px"}, 500 );//.fadeOut("2000");

            }



            $prevIndex = index;

            $(".smart-header-window-tab-content:nth-child(" + (index+1) + ")").show($effect, options);



            if($additionalImages){

                $(".header-main-image-over-element:nth-child(" + (index+1) + ")").animate({top: "0"}, 500 );//.fadeIn("2000");

            }



            $(".smart-header-navigator-tab").removeClass("active");

            $(this).addClass("active");

        }

    );





    $(".smart-header-navigator-control.first").click(

        function(){

            SmartHeaderEventFirst();

        }

    );



    $(".smart-header-navigator-control.prev").click(

        function(){

            SmartHeaderEventPrev();

        }

    );



    $(".smart-header-navigator-control.pause").toggle(

        function(){

            SmartHeaderEventPause();

        },

        function(){

            SmartHeaderEventPlay();

        }

    );



    $(".smart-header-navigator-control.play").click(

        function(){

            SmartHeaderEventPlay();

        }

    );



    $(".smart-header-navigator-control.next").click(

        function(){

            SmartHeaderEventNext();

        }

    );



    $(".smart-header-navigator-control.last").click(

        function(){

            SmartHeaderEventLast();

        }

    );





}/** * jQuery lightBox plugin * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/) * and adapted to me for use like a plugin from jQuery. * @name jquery-lightbox-0.5.js * @author Leandro Vieira Pinho - http://leandrovieira.com * @version 0.5 * @date April 11, 2008 * @category jQuery plugin * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com) * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin */// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias(function($) {	/**	 * $ is an alias to jQuery object	 *	 */	$.fn.lightBox = function(settings) {		// Settings to configure the jQuery lightBox plugin how you like		settings = jQuery.extend({			// Configuration related to overlay			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9			// Configuration related to navigation			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.			// Configuration related to images			imageLoading:			'images/lightbox-blank.gif',		// (string) Path and the name of the loading icon			imageBtnPrev:			'images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image			imageBtnNext:			'images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image			imageBtnClose:			'images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn			imageBlank:				'images/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)			// Configuration related to container image box			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.			txtImage:				'Image',	// (string) Specify text "Image"			txtOf:					'of',		// (string) Specify text "of"			// Configuration related to keyboard navigation			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.			// Donï¿½t alter these variables in any way			imageArray:				[],			activeImage:			0,			hardWidthImage:			850,			hardHeighImage:			0		},settings);		// Caching the jQuery object with all elements matched		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object		/**		 * Initializing the plugin calling the start function		 *		 * @return boolean false		 */		function _initialize() {                        _start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked			return false; // Avoid the browser following the link		}		/**		 * Start the jQuery lightBox plugin		 *		 * @param object objClicked The object (link) whick the user have clicked		 * @param object jQueryMatchedObj The jQuery object with all elements matched		 */		function _start(objClicked,jQueryMatchedObj) {                                                // Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.			$('embed, object, select').css({'visibility' : 'hidden'});			// Call the function to create the markup structure; style some elements; assign events in some elements.			_set_interface();			// Unset total images in imageArray			settings.imageArray.length = 0;			// Unset image active information			settings.activeImage = 0;			// We have an image set? Or just an image? Letï¿½s see it.			if ( jQueryMatchedObj.length == 1 ) {				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));                                			} else {				// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references						for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {					settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));				}			}                        			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {				settings.activeImage++;			}			// Call the function that prepares image exibition			_set_image_to_view();		}		/**		 * Create the jQuery lightBox plugin interface		 *		 * The HTML markup will be like that:			<div id="jquery-overlay"></div>			<div id="jquery-lightbox">				<div id="lightbox-container-image-box">					<div id="lightbox-container-image">						<img src="../fotos/XX.jpg" id="lightbox-image">						<div id="lightbox-nav">							<a href="#" id="lightbox-nav-btnPrev"></a>							<a href="#" id="lightbox-nav-btnNext"></a>						</div>						<div id="lightbox-loading">							<a href="#" id="lightbox-loading-link">								<img src="../images/lightbox-ico-loading.gif">							</a>						</div>					</div>				</div>				<div id="lightbox-container-image-data-box">					<div id="lightbox-container-image-data">						<div id="lightbox-image-details">							<span id="lightbox-image-details-caption"></span>							<span id="lightbox-image-details-currentNumber"></span>						</div>						<div id="lightbox-secNav">							<a href="#" id="lightbox-secNav-btnClose">								<img src="../images/lightbox-btn-close.gif">							</a>						</div>					</div>				</div>			</div>		 *		 */		function _set_interface() {			// Apply the HTML markup into body tag			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div><div id="sm-tabs-tab-description"></div><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '" style="width: 850px"></a></div></div></div></div>');			// Get page sizes			var arrPageSizes = ___getPageSize();			// Style overlay and show it			$('#jquery-overlay').css({				backgroundColor:	settings.overlayBgColor,				opacity:			settings.overlayOpacity,				width:				arrPageSizes[0],				height:				arrPageSizes[1]			}).fadeIn();			// Get page scroll			var arrPageScroll = ___getPageScroll();			// Calculate top and left offset for the jquery-lightbox div object and show it			$('#jquery-lightbox').css({				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),				left:	arrPageScroll[0]			}).show();			// Assigning click events in elements to close overlay			$('#jquery-overlay,#jquery-lightbox').click(function() {				_finish();												});			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {				_finish();				return false;			});			// If window was resized, calculate the new overlay dimensions			$(window).resize(function() {				// Get page sizes				var arrPageSizes = ___getPageSize();				// Style overlay and show it				$('#jquery-overlay').css({					width:		arrPageSizes[0],					height:		arrPageSizes[1]				});				// Get page scroll				var arrPageScroll = ___getPageScroll();				// Calculate top and left offset for the jquery-lightbox div object and show it				$('#jquery-lightbox').css({					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),					left:	arrPageScroll[0]				});			});		}		/**		 * Prepares image exibition; doing a imageï¿½s preloader to calculate itï¿½s size		 *		 */		function _set_image_to_view() { // show the loading			// Show the loading			$('#lightbox-loading').show();			if ( settings.fixedNavigation ) {				//$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();			} else {				// Hide some elements				//$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();			}			// Image preload process			var objImagePreloader = new Image();			objImagePreloader.onload = function() {				$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);                                                                $('#sm-tabs-tab-description').html("<span>" + $(".lightboximg:[href='" + settings.imageArray[settings.activeImage][0] + "'] img").attr('title') + "</span>");                                $('#sm-tabs-tab-description').show();                                if ($('#sm-tabs-tab-description').html() == '<span></span>'){                                    $('#sm-tabs-tab-description').hide();                                }                                //Resizowanie obrazka za zyczenie marty				var imgWidth = 0;				var imgHeight = 0;				if (objImagePreloader.width>settings.hardWidthImage) {					imgWidth = settings.hardWidthImage;					imgHeight = Math.round((settings.hardWidthImage / objImagePreloader.width) * objImagePreloader.height);				} else {					imgWidth = objImagePreloader.width;					imgHeight = objImagePreloader.height;				}								settings.hardWidthImage = imgWidth;                                settings.hardHeighImage = imgHeight;				// Perfomance an effect in the image container resizing it				_resize_container_image_box(imgWidth,imgHeight);				//	clear onLoad, IE behaves irratically with animated gifs otherwise				objImagePreloader.onload=function(){};			};                        objImagePreloader.src = settings.imageArray[settings.activeImage][0];                        		};		/**		 * Perfomance an effect in the image container resizing it		 *		 * @param integer intImageWidth The imageï¿½s width that will be showed		 * @param integer intImageHeight The imageï¿½s height that will be showed		 */		function _resize_container_image_box(intImageWidth,intImageHeight) {			// Get current width and height			var intCurrentWidth = $('#lightbox-container-image-box').width();			var intCurrentHeight = $('#lightbox-container-image-box').height();			// Get the width and height of the selected image plus the padding			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the imageï¿½s width and the left and right padding value			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the imageï¿½s height and the left and right padding value			// Diferences			var intDiffW = intCurrentWidth - intWidth;			var intDiffH = intCurrentHeight - intHeight;			// Perfomance the effect                                                $("#sm-tabs-tab-description").css("width", intWidth)//.animate({width: intWidth},settings.containerResizeSpeed);			$('#lightbox-container-image-box').css("width", intWidth).css("height", intHeight).animate({},1,function() {_show_image();});			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {				if ( $.browser.msie ) {					___pause(250);				} else {					___pause(100);					}			} 			$('#lightbox-container-image-data-box').css({width: intImageWidth});			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({height: intImageHeight + (settings.containerBorderSize * 2)});		};		/**		 * Show the prepared image		 *		 */		function _show_image() {			$('#lightbox-loading').hide();			$('#lightbox-image').width(settings.hardWidthImage).height(settings.hardHeighImage).fadeIn(function() {				_show_image_data();				_set_navigation();			});                        			_preload_neighbor_images();		};		/**		 * Show the image information		 *		 */		function _show_image_data() {                        			$('#lightbox-container-image-data-box').show();//.slideDown('fast');                        $('#lightbox-image-details-caption').show();                                                // lista obrazkow do przelaczenia			if ( settings.imageArray.length > 1 ) {				//$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();                                var indexes = "<div id='sm-lb-tabs'></div>" + settings.activeImage+':';                                for(i = 0; i < settings.imageArray.length; i++){                                    indexes += settings.imageArray[i] + " - ";                                }                                $('#lightbox-image-details-currentNumber').html(indexes + " prev: " + settings.imageBtnPrev).show();                                var tabs = '<div id="sm-lightbox-tabs">';                                for(i = 0; i < settings.imageArray.length; i++){                                    if(settings.activeImage == i){                                        tabs += '<div class="sm-lightbox-tabs-tab active">' + (i+1) + "</div>";                                    }else{                                        tabs += '<div class="sm-lightbox-tabs-tab">' + (i+1) + "</div>";                                    }                                }                                tabs += '</div>';                                                                $('#lightbox-image-details-currentNumber').html(tabs).show();                                $(".sm-lightbox-tabs-tab").each(                                    function(){                                        $(this)                                            .unbind()                                            .bind('click',function() {                                                settings.activeImage = Math.round($(this).html()-1);                                                _set_image_to_view();                                                return false;                                            });                                    }                                );			}                        		}		/**		 * Display the button navigations		 *		 */		function _set_navigation() {			$('#lightbox-nav').show();			// Instead to define this configuration in CSS file, we define here. And itï¿½s need to IE. Just.			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'});						// Show the prev button, if not the first image in set			if ( settings.activeImage != 0 ) {				if ( settings.fixedNavigation ) {					$('#lightbox-nav-btnPrev').css({'background' : 'url(' + settings.imageBtnPrev + ') left 100px no-repeat'})						.unbind()						.bind('click',function() {							settings.activeImage = settings.activeImage - 1;							_set_image_to_view();							return false;						});				} else {					// Show the images button for Next buttons					$('#lightbox-nav-btnPrev').unbind().hover(function() {						$(this).css({'background' : 'url(' + settings.imageBtnPrev + ') left 100px no-repeat'});					},function() {						$(this).css({'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'});					}).show().bind('click',function() {						settings.activeImage = settings.activeImage - 1;						_set_image_to_view();						return false;					});				}			}						// Show the next button, if not the last image in set			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {				if ( settings.fixedNavigation ) {					$('#lightbox-nav-btnNext').css({'background' : 'url(' + settings.imageBtnNext + ') right 100px no-repeat'})						.unbind()						.bind('click',function() {							settings.activeImage = settings.activeImage + 1;							_set_image_to_view();							return false;						});				} else {					// Show the images button for Next buttons					$('#lightbox-nav-btnNext').unbind().hover(function() {						$(this).css({'background' : 'url(' + settings.imageBtnNext + ') right 100px no-repeat'});					},function() {						$(this).css({'background' : 'transparent url(' + settings.imageBlank + ') no-repeat'});					}).show().bind('click',function() {						settings.activeImage = settings.activeImage + 1;						_set_image_to_view();						return false;					});				}			}			// Enable keyboard navigation                        			_enable_keyboard_navigation();		}		/**		 * Enable a support to keyboard navigation		 *		 */		function _enable_keyboard_navigation() {			$(document).keydown(function(objEvent) {				_keyboard_action(objEvent);			});		}		/**		 * Disable the support to keyboard navigation		 *		 */		function _disable_keyboard_navigation() {			$(document).unbind();		}		/**		 * Perform the keyboard actions		 *		 */		function _keyboard_action(objEvent) {			// To ie			if ( objEvent == null ) {				keycode = event.keyCode;				escapeKey = 27;			// To Mozilla			} else {				keycode = objEvent.keyCode;				escapeKey = objEvent.DOM_VK_ESCAPE;			}			// Get the key in lower case form			key = String.fromCharCode(keycode).toLowerCase();			// Verify the keys to close the ligthBox			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {				_finish();			}			// Verify the key to show the previous image			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {				// If weï¿½re not showing the first image, call the previous				if ( settings.activeImage != 0 ) {					settings.activeImage = settings.activeImage - 1;					_set_image_to_view();					_disable_keyboard_navigation();				}			}			// Verify the key to show the next image			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {				// If weï¿½re not showing the last image, call the next				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {					settings.activeImage = settings.activeImage + 1;					_set_image_to_view();					_disable_keyboard_navigation();				}			}		}		/**		 * Preload prev and next images being showed		 *		 */		function _preload_neighbor_images() {			if ( (settings.imageArray.length -1) > settings.activeImage ) {				objNext = new Image();				objNext.src = settings.imageArray[settings.activeImage + 1][0];			}			if ( settings.activeImage > 0 ) {				objPrev = new Image();				objPrev.src = settings.imageArray[settings.activeImage -1][0];			}		}		/**		 * Remove jQuery lightBox plugin HTML markup		 *		 */		function _finish() {			$('#jquery-lightbox').remove();			$('#jquery-overlay').fadeOut(function() {$('#jquery-overlay').remove();});			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.			$('embed, object, select').css({'visibility' : 'visible'});		}		/**		 / THIRD FUNCTION		 * getPageSize() by quirksmode.com		 *		 * @return Array Return an array with page width, height and window width, height		 */		function ___getPageSize() {			var xScroll, yScroll;			if (window.innerHeight && window.scrollMaxY) {					xScroll = window.innerWidth + window.scrollMaxX;				yScroll = window.innerHeight + window.scrollMaxY;			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac				xScroll = document.body.scrollWidth;				yScroll = document.body.scrollHeight;			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari				xScroll = document.body.offsetWidth;				yScroll = document.body.offsetHeight;			}			var windowWidth, windowHeight;			if (self.innerHeight) {	// all except Explorer				if(document.documentElement.clientWidth){					windowWidth = document.documentElement.clientWidth; 				} else {					windowWidth = self.innerWidth;				}				windowHeight = self.innerHeight;			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode				windowWidth = document.documentElement.clientWidth;				windowHeight = document.documentElement.clientHeight;			} else if (document.body) { // other Explorers				windowWidth = document.body.clientWidth;				windowHeight = document.body.clientHeight;			}				// for small pages with total height less then height of the viewport			if(yScroll < windowHeight){				pageHeight = windowHeight;			} else { 				pageHeight = yScroll;			}			// for small pages with total width less then width of the viewport			if(xScroll < windowWidth){					pageWidth = xScroll;					} else {				pageWidth = windowWidth;			}			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);			return arrayPageSize;		};		/**		 / THIRD FUNCTION		 * getPageScroll() by quirksmode.com		 *		 * @return Array Return an array with x,y page scroll values.		 */		function ___getPageScroll() {			var xScroll, yScroll;			if (self.pageYOffset) {				yScroll = self.pageYOffset;				xScroll = self.pageXOffset;			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict				yScroll = document.documentElement.scrollTop;				xScroll = document.documentElement.scrollLeft;			} else if (document.body) {// all other Explorers				yScroll = document.body.scrollTop;				xScroll = document.body.scrollLeft;				}			arrayPageScroll = new Array(xScroll,yScroll);			return arrayPageScroll;		};		 /**		  * Stop the code execution from a escified time in milisecond		  *		  */		 function ___pause(ms) {			var date = new Date(); 			curDate = null;			do {var curDate = new Date();}			while ( curDate - date < ms);		 };		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once		return this.unbind('click').click(_initialize);	};})(jQuery); // Call and execute the function immediately passing the jQuery object/*
jQuery Fieldtag Plugin
    * Version 1.1
    * 2009-05-07 10:10:35
    * URL: http://ajaxcssblog.com/jquery/fieldtag-watermark-inputfields/
    * Description: jQuery Plugin to dynamically tag an inputfield, with a class and/or text
    * Author: Matthias JÃ¤ggli
    * Copyright: Copyright (c) 2009 Matthias JÃ¤ggli under dual MIT/GPL license.
*/

(function($){$.fn.fieldtag=function(options){var opt=$.extend({markedClass:"tagged",standardText:false},options);$(this).focus(function(){if(!this.changed){this.clear();}}).blur(function(){if(!this.changed){this.addTag();}}).keyup(function(){this.changed=($(this).val()?true:false);}).each(function(){this.title=$(this).attr("title");if($(this).val()==$(this).attr("title")){this.changed=false;}
this.clear=function(){if(!this.changed){$(this).val("").removeClass(opt.markedClass);}}
this.addTag=function(){$(this).val(opt.standardText===false?this.title:opt.standardText).addClass(opt.markedClass);}
if(this.form){this.form.tagFieldsToClear=this.form.tagFieldsToClear||[];this.form.tagFieldsToClear.push(this);if(this.form.tagFieldsAreCleared){return true;}
this.form.tagFieldsAreCleared=true;$(this.form).submit(function(){$(this.tagFieldsToClear).each(function(){this.clear();});});}}).keyup().blur();return $(this);}})(jQuery);
/*
Licencja na u¿ytek prywatny i komercyjny. Wymaga pozostawiania poni¿szych danych o autorze i pochodzeniu skryptu.
Autor: Labsta.com Laboratorium Designu
Skrypt pochodzi ze strony http://websta.pl - Blog o grafice i projektowaniu stron
*/

(function($) {
	
	$.fn.ukryjpola = function(options) {
		
		var defaults = {
			szybkoscpokaz : 'slow',
			szybkoscukryj : 'fast'
		},
		
		settings = $.extend({}, defaults, options); 
		
		$('#'+settings.docelowy+'').hide();
		
		function aktywatorCheckbox() {
			if ($(this).is(':checked')) {
				$('#'+settings.docelowy+'').slideDown(settings.szybkoscpokaz);
			} else {
				$('#'+settings.docelowy+'').slideUp(settings.szybkoscukryj);
			}
		}
		
		function aktywatorRadio() {
			if ($('#'+aktyw+'').is(':checked')) {
				$('#'+settings.docelowy+'').slideDown(settings.szybkoscpokaz);
			} else {
				$('#'+settings.docelowy+'').slideUp(settings.szybkoscukryj);
			}
		}
		
		if ($(this).is("input[type='checkbox']")) {
			$(this).click(aktywatorCheckbox);
		}else if ($(this).is("input[type='radio']")){
			var grupa = $(this).attr("name");
			var aktyw = $(this).attr("id") 
			$("input[name='"+grupa+"']").click(aktywatorRadio);
		}				
		
	} 
	
})(jQuery);$(document).ready(
            function(){
                start();
            }
        );
/*****************************************************************************
scalable Inman Flash Replacement (sIFR) version 3, revision 436.

Copyright 2006 â€“ 2008 Mark Wubben, <http://novemberborn.net/>

Older versions:
* IFR by Shaun Inman
* sIFR 1.0 by Mike Davidson, Shaun Inman and Tomas Jogin
* sIFR 2.0 by Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

See also <http://novemberborn.net/sifr3> and <http://wiki.novemberborn.net/sifr3>.

This software is licensed and provided under the CC-GNU LGPL.
See <http://creativecommons.org/licenses/LGPL/2.1/>
*****************************************************************************/

var sIFR=new function(){var O=this;var E={ACTIVE:"sIFR-active",REPLACED:"sIFR-replaced",IGNORE:"sIFR-ignore",ALTERNATE:"sIFR-alternate",CLASS:"sIFR-class",LAYOUT:"sIFR-layout",FLASH:"sIFR-flash",FIX_FOCUS:"sIFR-fixfocus",DUMMY:"sIFR-dummy"};E.IGNORE_CLASSES=[E.REPLACED,E.IGNORE,E.ALTERNATE];this.MIN_FONT_SIZE=6;this.MAX_FONT_SIZE=126;this.FLASH_PADDING_BOTTOM=5;this.VERSION="436";this.isActive=false;this.isEnabled=true;this.fixHover=true;this.autoInitialize=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.forceWidth=true;this.fitExactly=false;this.forceTextTransform=true;this.useDomLoaded=true;this.useStyleCheck=false;this.hasFlashClassSet=false;this.repaintOnResize=true;this.replacements=[];var L=0;var R=false;function Y(){}function D(c){function d(e){return e.toLocaleUpperCase()}this.normalize=function(e){return e.replace(/\n|\r|\xA0/g,D.SINGLE_WHITESPACE).replace(/\s+/g,D.SINGLE_WHITESPACE)};this.textTransform=function(e,f){switch(e){case"uppercase":return f.toLocaleUpperCase();case"lowercase":return f.toLocaleLowerCase();case"capitalize":return f.replace(/^\w|\s\w/g,d)}return f};this.toHexString=function(e){if(e.charAt(0)!="#"||e.length!=4&&e.length!=7){return e}e=e.substring(1);return"0x"+(e.length==3?e.replace(/(.)(.)(.)/,"$1$1$2$2$3$3"):e)};this.toJson=function(g,f){var e="";switch(typeof(g)){case"string":e='"'+f(g)+'"';break;case"number":case"boolean":e=g.toString();break;case"object":e=[];for(var h in g){if(g[h]==Object.prototype[h]){continue}e.push('"'+h+'":'+this.toJson(g[h]))}e="{"+e.join(",")+"}";break}return e};this.convertCssArg=function(e){if(!e){return{}}if(typeof(e)=="object"){if(e.constructor==Array){e=e.join("")}else{return e}}var l={};var m=e.split("}");for(var h=0;h<m.length;h++){var k=m[h].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!k||k.length!=3){continue}if(!l[k[1]]){l[k[1]]={}}var g=k[2].split(";");for(var f=0;f<g.length;f++){var n=g[f].match(/\s*([^:\s]+)\s*\:\s*([^;]+)/);if(!n||n.length!=3){continue}l[k[1]][n[1]]=n[2].replace(/\s+$/,"")}}return l};this.extractFromCss=function(g,f,i,e){var h=null;if(g&&g[f]&&g[f][i]){h=g[f][i];if(e){delete g[f][i]}}return h};this.cssToString=function(f){var g=[];for(var e in f){var j=f[e];if(j==Object.prototype[e]){continue}g.push(e,"{");for(var i in j){if(j[i]==Object.prototype[i]){continue}var h=j[i];if(D.UNIT_REMOVAL_PROPERTIES[i]){h=parseInt(h,10)}g.push(i,":",h,";")}g.push("}")}return g.join("")};this.escape=function(e){return escape(e).replace(/\+/g,"%2B")};this.encodeVars=function(e){return e.join("&").replace(/%/g,"%25")};this.copyProperties=function(g,f){for(var e in g){if(f[e]===undefined){f[e]=g[e]}}return f};this.domain=function(){var f="";try{f=document.domain}catch(g){}return f};this.domainMatches=function(h,g){if(g=="*"||g==h){return true}var f=g.lastIndexOf("*");if(f>-1){g=g.substr(f+1);var e=h.lastIndexOf(g);if(e>-1&&(e+g.length)==h.length){return true}}return false};this.uriEncode=function(e){return encodeURI(decodeURIComponent(e))};this.delay=function(f,h,g){var e=Array.prototype.slice.call(arguments,3);setTimeout(function(){h.apply(g,e)},f)}}D.UNIT_REMOVAL_PROPERTIES={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};D.SINGLE_WHITESPACE=" ";function U(e){var d=this;function c(g,j,h){var k=d.getStyleAsInt(g,j,e.ua.ie);if(k==0){k=g[h];for(var f=3;f<arguments.length;f++){k-=d.getStyleAsInt(g,arguments[f],true)}}return k}this.getBody=function(){return document.getElementsByTagName("body")[0]||null};this.querySelectorAll=function(f){return window.parseSelector(f)};this.addClass=function(f,g){if(g){g.className=((g.className||"")==""?"":g.className+" ")+f}};this.removeClass=function(f,g){if(g){g.className=g.className.replace(new RegExp("(^|\\s)"+f+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(f,g){return new RegExp("(^|\\s)"+f+"(\\s|$)").test(g.className)};this.hasOneOfClassses=function(h,g){for(var f=0;f<h.length;f++){if(this.hasClass(h[f],g)){return true}}return false};this.ancestorHasClass=function(g,f){g=g.parentNode;while(g&&g.nodeType==1){if(this.hasClass(f,g)){return true}g=g.parentNode}return false};this.create=function(f,g){var h=document.createElementNS?document.createElementNS(U.XHTML_NS,f):document.createElement(f);if(g){h.className=g}return h};this.getComputedStyle=function(h,i){var f;if(document.defaultView&&document.defaultView.getComputedStyle){var g=document.defaultView.getComputedStyle(h,null);f=g?g[i]:null}else{if(h.currentStyle){f=h.currentStyle[i]}}return f||""};this.getStyleAsInt=function(g,i,f){var h=this.getComputedStyle(g,i);if(f&&!/px$/.test(h)){return 0}return parseInt(h)||0};this.getWidthFromStyle=function(f){return c(f,"width","offsetWidth","paddingRight","paddingLeft","borderRightWidth","borderLeftWidth")};this.getHeightFromStyle=function(f){return c(f,"height","offsetHeight","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth")};this.getDimensions=function(j){var h=j.offsetWidth;var f=j.offsetHeight;if(h==0||f==0){for(var g=0;g<j.childNodes.length;g++){var k=j.childNodes[g];if(k.nodeType!=1){continue}h=Math.max(h,k.offsetWidth);f=Math.max(f,k.offsetHeight)}}return{width:h,height:f}};this.getViewport=function(){return{width:window.innerWidth||document.documentElement.clientWidth||this.getBody().clientWidth,height:window.innerHeight||document.documentElement.clientHeight||this.getBody().clientHeight}};this.blurElement=function(g){try{g.blur();return}catch(h){}var f=this.create("input");f.style.width="0px";f.style.height="0px";g.parentNode.appendChild(f);f.focus();f.blur();f.parentNode.removeChild(f)}}U.XHTML_NS="http://www.w3.org/1999/xhtml";function H(r){var g=navigator.userAgent.toLowerCase();var q=(navigator.product||"").toLowerCase();var h=navigator.platform.toLowerCase();this.parseVersion=H.parseVersion;this.macintosh=/^mac/.test(h);this.windows=/^win/.test(h);this.linux=/^linux/.test(h);this.quicktime=false;this.opera=/opera/.test(g);this.konqueror=/konqueror/.test(g);this.ie=false/*@cc_on||true@*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(g)/*@cc_on&&@_jscript_version>=5.5@*/;this.ieWin=this.ie&&this.windows/*@cc_on&&@_jscript_version>=5.1@*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on&&@_jscript_version<5.1@*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=/safari/.test(g);this.webkit=!this.konqueror&&/applewebkit/.test(g);this.khtml=this.webkit||this.konqueror;this.gecko=!this.khtml&&q=="gecko";this.ieVersion=this.ie&&/.*msie\s(\d\.\d)/.exec(g)?this.parseVersion(RegExp.$1):"0";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(g)?this.parseVersion(RegExp.$2):"0";this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(g)?this.parseVersion(RegExp.$1):"0";this.geckoVersion=this.gecko&&/.*rv:\s*([^\)]+)\)\s+gecko/.exec(g)?this.parseVersion(RegExp.$1):"0";this.konquerorVersion=this.konqueror&&/.*konqueror\/([\d\.]+).*/.exec(g)?this.parseVersion(RegExp.$1):"0";this.flashVersion=0;if(this.ieWin){var l;var o=false;try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(m){try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=this.parseVersion("6");l.AllowScriptAccess="always"}catch(m){o=this.flashVersion==this.parseVersion("6")}if(!o){try{l=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(m){}}}if(!o&&l){this.flashVersion=this.parseVersion((l.GetVariable("$version")||"").replace(/^\D+(\d+)\D+(\d+)\D+(\d+).*/g,"$1.$2.$3"))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var n=navigator.plugins["Shockwave Flash"].description.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var p=n.replace(/^\D*(\d+\.\d+).*$/,"$1");if(/r/.test(n)){p+=n.replace(/^.*r(\d*).*$/,".$1")}else{if(/d/.test(n)){p+=".0"}}this.flashVersion=this.parseVersion(p);var j=false;for(var k=0,c=this.flashVersion>=H.MIN_FLASH_VERSION;c&&k<navigator.mimeTypes.length;k++){var f=navigator.mimeTypes[k];if(f.type!="application/x-shockwave-flash"){continue}if(f.enabledPlugin){j=true;if(f.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){c=false;this.quicktime=true}}}if(this.quicktime||!j){this.flashVersion=this.parseVersion("0")}}}this.flash=this.flashVersion>=H.MIN_FLASH_VERSION;this.transparencySupport=this.macintosh||this.windows||this.linux&&(this.flashVersion>=this.parseVersion("10")&&(this.gecko&&this.geckoVersion>=this.parseVersion("1.9")||this.opera));this.computedStyleSupport=this.ie||!!document.defaultView.getComputedStyle;this.fixFocus=this.gecko&&this.windows;this.nativeDomLoaded=this.gecko||this.webkit&&this.webkitVersion>=this.parseVersion("525")||this.konqueror&&this.konquerorMajor>this.parseVersion("03")||this.opera;this.mustCheckStyle=this.khtml||this.opera;this.forcePageLoad=this.webkit&&this.webkitVersion<this.parseVersion("523");this.properDocument=typeof(document.location)=="object";this.supported=this.flash&&this.properDocument&&(!this.ie||this.ieSupported)&&this.computedStyleSupport&&(!this.opera||this.operaVersion>=this.parseVersion("9.61"))&&(!this.webkit||this.webkitVersion>=this.parseVersion("412"))&&(!this.gecko||this.geckoVersion>=this.parseVersion("1.8.0.12"))&&(!this.konqueror)}H.parseVersion=function(c){return c.replace(/(^|\D)(\d+)(?=\D|$)/g,function(f,e,g){f=e;for(var d=4-g.length;d>=0;d--){f+="0"}return f+g})};H.MIN_FLASH_VERSION=H.parseVersion("8");function F(c){this.fix=c.ua.ieWin&&window.location.hash!="";var d;this.cache=function(){d=document.title};function e(){document.title=d}this.restore=function(){if(this.fix){setTimeout(e,0)}}}function S(l){var e=null;function c(){try{if(l.ua.ie||document.readyState!="loaded"&&document.readyState!="complete"){document.documentElement.doScroll("left")}}catch(n){return setTimeout(c,10)}i()}function i(){if(l.useStyleCheck){h()}else{if(!l.ua.mustCheckStyle){d(null,true)}}}function h(){e=l.dom.create("div",E.DUMMY);l.dom.getBody().appendChild(e);m()}function m(){if(l.dom.getComputedStyle(e,"marginLeft")=="42px"){g()}else{setTimeout(m,10)}}function g(){if(e&&e.parentNode){e.parentNode.removeChild(e)}e=null;d(null,true)}function d(n,o){l.initialize(o);if(n&&n.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",d,false)}if(window.removeEventListener){window.removeEventListener("load",d,false)}}}function j(){l.prepareClearReferences();if(document.readyState=="interactive"){document.attachEvent("onstop",f);setTimeout(function(){document.detachEvent("onstop",f)},0)}}function f(){document.detachEvent("onstop",f);k()}function k(){l.clearReferences()}this.attach=function(){if(window.addEventListener){window.addEventListener("load",d,false)}else{window.attachEvent("onload",d)}if(!l.useDomLoaded||l.ua.forcePageLoad||l.ua.ie&&window.top!=window){return}if(l.ua.nativeDomLoaded){document.addEventListener("DOMContentLoaded",i,false)}else{if(l.ua.ie||l.ua.khtml){c()}}};this.attachUnload=function(){if(!l.ua.ie){return}window.attachEvent("onbeforeunload",j);window.attachEvent("onunload",k)}}var Q="sifrFetch";function N(c){var e=false;this.fetchMovies=function(f){if(c.setPrefetchCookie&&new RegExp(";?"+Q+"=true;?").test(document.cookie)){return}try{e=true;d(f)}catch(g){}if(c.setPrefetchCookie){document.cookie=Q+"=true;path="+c.cookiePath}};this.clear=function(){if(!e){return}try{var f=document.getElementsByTagName("script");for(var g=f.length-1;g>=0;g--){var h=f[g];if(h.type=="sifr/prefetch"){h.parentNode.removeChild(h)}}}catch(j){}};function d(f){for(var g=0;g<f.length;g++){document.write('<script defer type="sifr/prefetch" src="'+f[g].src+'"><\/script>')}}}function b(e){var g=e.ua.ie;var f=g&&e.ua.flashVersion<e.ua.parseVersion("9.0.115");var d={};var c={};this.fixFlash=f;this.register=function(h){if(!g){return}var i=h.getAttribute("id");this.cleanup(i,false);c[i]=h;delete d[i];if(f){window[i]=h}};this.reset=function(){if(!g){return false}for(var j=0;j<e.replacements.length;j++){var h=e.replacements[j];var k=c[h.id];if(!d[h.id]&&(!k.parentNode||k.parentNode.nodeType==11)){h.resetMovie();d[h.id]=true}}return true};this.cleanup=function(l,h){var i=c[l];if(!i){return}for(var k in i){if(typeof(i[k])=="function"){i[k]=null}}c[l]=null;if(f){window[l]=null}if(i.parentNode){if(h&&i.parentNode.nodeType==1){var j=document.createElement("div");j.style.width=i.offsetWidth+"px";j.style.height=i.offsetHeight+"px";i.parentNode.replaceChild(j,i)}else{i.parentNode.removeChild(i)}}};this.prepareClearReferences=function(){if(!f){return}__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}};this.clearReferences=function(){if(f){var j=document.getElementsByTagName("object");for(var h=j.length-1;h>=0;h--){c[j[h].getAttribute("id")]=j[h]}}for(var k in c){if(Object.prototype[k]!=c[k]){this.cleanup(k,true)}}}}function K(d,g,f,c,e){this.sIFR=d;this.id=g;this.vars=f;this.movie=null;this.__forceWidth=c;this.__events=e;this.__resizing=0}K.prototype={getFlashElement:function(){return document.getElementById(this.id)},getAlternate:function(){return document.getElementById(this.id+"_alternate")},getAncestor:function(){var c=this.getFlashElement().parentNode;return !this.sIFR.dom.hasClass(E.FIX_FOCUS,c)?c:c.parentNode},available:function(){var c=this.getFlashElement();return c&&c.parentNode},call:function(c){var d=this.getFlashElement();if(!d[c]){return false}return Function.prototype.apply.call(d[c],d,Array.prototype.slice.call(arguments,1))},attempt:function(){if(!this.available()){return false}try{this.call.apply(this,arguments)}catch(c){if(this.sIFR.debug){throw c}return false}return true},updateVars:function(c,e){for(var d=0;d<this.vars.length;d++){if(this.vars[d].split("=")[0]==c){this.vars[d]=c+"="+e;break}}var f=this.sIFR.util.encodeVars(this.vars);this.movie.injectVars(this.getFlashElement(),f);this.movie.injectVars(this.movie.html,f)},storeSize:function(c,d){this.movie.setSize(c,d);this.updateVars(c,d)},fireEvent:function(c){if(this.available()&&this.__events[c]){this.sIFR.util.delay(0,this.__events[c],this,this)}},resizeFlashElement:function(c,d,e){if(!this.available()){return}this.__resizing++;var f=this.getFlashElement();f.setAttribute("height",c);this.getAncestor().style.minHeight="";this.updateVars("renderheight",c);this.storeSize("height",c);if(d!==null){f.setAttribute("width",d);this.movie.setSize("width",d)}if(this.__events.onReplacement){this.sIFR.util.delay(0,this.__events.onReplacement,this,this);delete this.__events.onReplacement}if(e){this.sIFR.util.delay(0,function(){this.attempt("scaleMovie");this.__resizing--},this)}else{this.__resizing--}},blurFlashElement:function(){if(this.available()){this.sIFR.dom.blurElement(this.getFlashElement())}},resetMovie:function(){this.sIFR.util.delay(0,this.movie.reset,this.movie,this.getFlashElement(),this.getAlternate())},resizeAfterScale:function(){if(this.available()&&this.__resizing==0){this.sIFR.util.delay(0,this.resize,this)}},resize:function(){if(!this.available()){return}this.__resizing++;var g=this.getFlashElement();var f=g.offsetWidth;if(f==0){return}var e=g.getAttribute("width");var l=g.getAttribute("height");var m=this.getAncestor();var o=this.sIFR.dom.getHeightFromStyle(m);g.style.width="1px";g.style.height="1px";m.style.minHeight=o+"px";var c=this.getAlternate().childNodes;var n=[];for(var k=0;k<c.length;k++){var h=c[k].cloneNode(true);n.push(h);m.appendChild(h)}var d=this.sIFR.dom.getWidthFromStyle(m);for(var k=0;k<n.length;k++){m.removeChild(n[k])}g.style.width=g.style.height=m.style.minHeight="";g.setAttribute("width",this.__forceWidth?d:e);g.setAttribute("height",l);if(sIFR.ua.ie){g.style.display="none";var j=g.offsetHeight;g.style.display=""}if(d!=f){if(this.__forceWidth){this.storeSize("width",d)}this.attempt("resize",d)}this.__resizing--},replaceText:function(g,j){var d=this.sIFR.util.escape(g);if(!this.attempt("replaceText",d)){return false}this.updateVars("content",d);var f=this.getAlternate();if(j){while(f.firstChild){f.removeChild(f.firstChild)}for(var c=0;c<j.length;c++){f.appendChild(j[c])}}else{try{f.innerHTML=g}catch(h){}}return true},changeCSS:function(c){c=this.sIFR.util.escape(this.sIFR.util.cssToString(this.sIFR.util.convertCssArg(c)));this.updateVars("css",c);return this.attempt("changeCSS",c)},remove:function(){if(this.movie&&this.available()){this.movie.remove(this.getFlashElement(),this.id)}}};var X=new function(){this.create=function(p,n,j,i,f,e,g,o,l,h,m){var k=p.ua.ie?d:c;return new k(p,n,j,i,f,e,g,o,["flashvars",l,"wmode",h,"bgcolor",m,"allowScriptAccess","always","quality","best"])};function c(s,q,l,h,f,e,g,r,n){var m=s.dom.create("object",E.FLASH);var p=["type","application/x-shockwave-flash","id",f,"name",f,"data",e,"width",g,"height",r];for(var o=0;o<p.length;o+=2){m.setAttribute(p[o],p[o+1])}var j=m;if(h){j=W.create("div",E.FIX_FOCUS);j.appendChild(m)}for(var o=0;o<n.length;o+=2){if(n[o]=="name"){continue}var k=W.create("param");k.setAttribute("name",n[o]);k.setAttribute("value",n[o+1]);m.appendChild(k)}l.style.minHeight=r+"px";while(l.firstChild){l.removeChild(l.firstChild)}l.appendChild(j);this.html=j.cloneNode(true)}c.prototype={reset:function(e,f){e.parentNode.replaceChild(this.html.cloneNode(true),e)},remove:function(e,f){e.parentNode.removeChild(e)},setSize:function(e,f){this.html.setAttribute(e,f)},injectVars:function(e,g){var h=e.getElementsByTagName("param");for(var f=0;f<h.length;f++){if(h[f].getAttribute("name")=="flashvars"){h[f].setAttribute("value",g);break}}}};function d(p,n,j,h,f,e,g,o,k){this.dom=p.dom;this.broken=n;this.html='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="'+f+'" width="'+g+'" height="'+o+'" class="'+E.FLASH+'"><param name="movie" value="'+e+'"></param></object>';var m="";for(var l=0;l<k.length;l+=2){m+='<param name="'+k[l]+'" value="'+k[l+1]+'"></param>'}this.html=this.html.replace(/(<\/object>)/,m+"$1");j.style.minHeight=o+"px";j.innerHTML=this.html;this.broken.register(j.firstChild)}d.prototype={reset:function(f,g){g=g.cloneNode(true);var e=f.parentNode;e.innerHTML=this.html;this.broken.register(e.firstChild);e.appendChild(g)},remove:function(e,f){this.broken.cleanup(f)},setSize:function(e,f){this.html=this.html.replace(e=="height"?/(height)="\d+"/:/(width)="\d+"/,'$1="'+f+'"')},injectVars:function(e,f){if(e!=this.html){return}this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+f)}}};this.errors=new Y(O);var A=this.util=new D(O);var W=this.dom=new U(O);var T=this.ua=new H(O);var G={fragmentIdentifier:new F(O),pageLoad:new S(O),prefetch:new N(O),brokenFlashIE:new b(O)};this.__resetBrokenMovies=G.brokenFlashIE.reset;var J={kwargs:[],replaceAll:function(d){for(var c=0;c<this.kwargs.length;c++){O.replace(this.kwargs[c])}if(!d){this.kwargs=[]}}};this.activate=function(){if(!T.supported||!this.isEnabled||this.isActive||!C()||a()){return}G.prefetch.fetchMovies(arguments);this.isActive=true;this.setFlashClass();G.fragmentIdentifier.cache();G.pageLoad.attachUnload();if(!this.autoInitialize){return}G.pageLoad.attach()};this.setFlashClass=function(){if(this.hasFlashClassSet){return}W.addClass(E.ACTIVE,W.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}W.removeClass(E.ACTIVE,W.getBody());W.removeClass(E.ACTIVE,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(c){if(!this.isActive||!this.isEnabled){return}if(R){if(!c){J.replaceAll(false)}return}R=true;J.replaceAll(c);if(O.repaintOnResize){if(window.addEventListener){window.addEventListener("resize",Z,false)}else{window.attachEvent("onresize",Z)}}G.prefetch.clear()};this.replace=function(x,u){if(!T.supported){return}if(u){x=A.copyProperties(x,u)}if(!R){return J.kwargs.push(x)}if(this.onReplacementStart){this.onReplacementStart(x)}var AM=x.elements||W.querySelectorAll(x.selector);if(AM.length==0){return}var w=M(x.src);var AR=A.convertCssArg(x.css);var v=B(x.filters);var AN=x.forceSingleLine===true;var AS=x.preventWrap===true&&!AN;var q=AN||(x.fitExactly==null?this.fitExactly:x.fitExactly)===true;var AD=q||(x.forceWidth==null?this.forceWidth:x.forceWidth)===true;var s=x.ratios||[];var AE=x.pixelFont===true;var r=parseInt(x.tuneHeight)||0;var z=!!x.onRelease||!!x.onRollOver||!!x.onRollOut;if(q){A.extractFromCss(AR,".sIFR-root","text-align",true)}var t=A.extractFromCss(AR,".sIFR-root","font-size",true)||"0";var e=A.extractFromCss(AR,".sIFR-root","background-color",true)||"#FFFFFF";var o=A.extractFromCss(AR,".sIFR-root","kerning",true)||"";var AW=A.extractFromCss(AR,".sIFR-root","opacity",true)||"100";var k=A.extractFromCss(AR,".sIFR-root","cursor",true)||"default";var AP=parseInt(A.extractFromCss(AR,".sIFR-root","leading"))||0;var AJ=x.gridFitType||(A.extractFromCss(AR,".sIFR-root","text-align")=="right")?"subpixel":"pixel";var h=this.forceTextTransform===false?"none":A.extractFromCss(AR,".sIFR-root","text-transform",true)||"none";t=/^\d+(px)?$/.test(t)?parseInt(t):0;AW=parseFloat(AW)<1?100*parseFloat(AW):AW;var AC=x.modifyCss?"":A.cssToString(AR);var AG=x.wmode||"";if(!AG){if(x.transparent){AG="transparent"}else{if(x.opaque){AG="opaque"}}}if(AG=="transparent"){if(!T.transparencySupport){AG="opaque"}else{e="transparent"}}else{if(e=="transparent"){e="#FFFFFF"}}for(var AV=0;AV<AM.length;AV++){var AF=AM[AV];if(W.hasOneOfClassses(E.IGNORE_CLASSES,AF)||W.ancestorHasClass(AF,E.ALTERNATE)){continue}var AO=W.getDimensions(AF);var f=AO.height;var c=AO.width;var AA=W.getComputedStyle(AF,"display");if(!f||!c||!AA||AA=="none"){continue}c=W.getWidthFromStyle(AF);var n,AH;if(!t){var AL=I(AF);n=Math.min(this.MAX_FONT_SIZE,Math.max(this.MIN_FONT_SIZE,AL.fontSize));if(AE){n=Math.max(8,8*Math.round(n/8))}AH=AL.lines}else{n=t;AH=1}var d=W.create("span",E.ALTERNATE);var AX=AF.cloneNode(true);AF.parentNode.appendChild(AX);for(var AU=0,AT=AX.childNodes.length;AU<AT;AU++){var m=AX.childNodes[AU];if(!/^(style|script)$/i.test(m.nodeName)){d.appendChild(m.cloneNode(true))}}if(x.modifyContent){x.modifyContent(AX,x.selector)}if(x.modifyCss){AC=x.modifyCss(AR,AX,x.selector)}var p=P(AX,h,x.uriEncode);AX.parentNode.removeChild(AX);if(x.modifyContentString){p.text=x.modifyContentString(p.text,x.selector)}if(p.text==""){continue}var AK=Math.round(AH*V(n,s)*n)+this.FLASH_PADDING_BOTTOM+r;if(AH>1&&AP){AK+=Math.round((AH-1)*AP)}var AB=AD?c:"100%";var AI="sIFR_replacement_"+L++;var AQ=["id="+AI,"content="+A.escape(p.text),"width="+c,"renderheight="+AK,"link="+A.escape(p.primaryLink.href||""),"target="+A.escape(p.primaryLink.target||""),"size="+n,"css="+A.escape(AC),"cursor="+k,"tunewidth="+(x.tuneWidth||0),"tuneheight="+r,"offsetleft="+(x.offsetLeft||""),"offsettop="+(x.offsetTop||""),"fitexactly="+q,"preventwrap="+AS,"forcesingleline="+AN,"antialiastype="+(x.antiAliasType||""),"thickness="+(x.thickness||""),"sharpness="+(x.sharpness||""),"kerning="+o,"gridfittype="+AJ,"flashfilters="+v,"opacity="+AW,"blendmode="+(x.blendMode||""),"selectable="+(x.selectable==null||AG!=""&&!sIFR.ua.macintosh&&sIFR.ua.gecko&&sIFR.ua.geckoVersion>=sIFR.ua.parseVersion("1.9")?"true":x.selectable===true),"fixhover="+(this.fixHover===true),"events="+z,"delayrun="+G.brokenFlashIE.fixFlash,"version="+this.VERSION];var y=A.encodeVars(AQ);var g=new K(O,AI,AQ,AD,{onReplacement:x.onReplacement,onRollOver:x.onRollOver,onRollOut:x.onRollOut,onRelease:x.onRelease});g.movie=X.create(sIFR,G.brokenFlashIE,AF,T.fixFocus&&x.fixFocus,AI,w,AB,AK,y,AG,e);this.replacements.push(g);this.replacements[AI]=g;if(x.selector){if(!this.replacements[x.selector]){this.replacements[x.selector]=[g]}else{this.replacements[x.selector].push(g)}}d.setAttribute("id",AI+"_alternate");AF.appendChild(d);W.addClass(E.REPLACED,AF)}G.fragmentIdentifier.restore()};this.getReplacementByFlashElement=function(d){for(var c=0;c<O.replacements.length;c++){if(O.replacements[c].id==d.getAttribute("id")){return O.replacements[c]}}};this.redraw=function(){for(var c=0;c<O.replacements.length;c++){O.replacements[c].resetMovie()}};this.prepareClearReferences=function(){G.brokenFlashIE.prepareClearReferences()};this.clearReferences=function(){G.brokenFlashIE.clearReferences();G=null;J=null;delete O.replacements};function C(){if(O.domains.length==0){return true}var d=A.domain();for(var c=0;c<O.domains.length;c++){if(A.domainMatches(d,O.domains[c])){return true}}return false}function a(){if(document.location.protocol=="file:"){if(O.debug){O.errors.fire("isFile")}return true}return false}function M(c){if(T.ie&&c.charAt(0)=="/"){c=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+c}return c}function V(d,e){for(var c=0;c<e.length;c+=2){if(d<=e[c]){return e[c+1]}}return e[e.length-1]||1}function B(g){var e=[];for(var d in g){if(g[d]==Object.prototype[d]){continue}var c=g[d];d=[d.replace(/filter/i,"")+"Filter"];for(var f in c){if(c[f]==Object.prototype[f]){continue}d.push(f+":"+A.escape(A.toJson(c[f],A.toHexString)))}e.push(d.join(","))}return A.escape(e.join(";"))}function Z(d){var e=Z.viewport;var c=W.getViewport();if(e&&c.width==e.width&&c.height==e.height){return}Z.viewport=c;if(O.replacements.length==0){return}if(Z.timer){clearTimeout(Z.timer)}Z.timer=setTimeout(function(){delete Z.timer;for(var f=0;f<O.replacements.length;f++){O.replacements[f].resize()}},200)}function I(f){var g=W.getComputedStyle(f,"fontSize");var d=g.indexOf("px")==-1;var e=f.innerHTML;if(d){f.innerHTML="X"}f.style.paddingTop=f.style.paddingBottom=f.style.borderTopWidth=f.style.borderBottomWidth="0px";f.style.lineHeight="2em";f.style.display="block";g=d?f.offsetHeight/2:parseInt(g,10);if(d){f.innerHTML=e}var c=Math.round(f.offsetHeight/(2*g));f.style.paddingTop=f.style.paddingBottom=f.style.borderTopWidth=f.style.borderBottomWidth=f.style.lineHeight=f.style.display="";if(isNaN(c)||!isFinite(c)||c==0){c=1}return{fontSize:g,lines:c}}function P(c,g,s){s=s||A.uriEncode;var q=[],m=[];var k=null;var e=c.childNodes;var o=false,p=false;var j=0;while(j<e.length){var f=e[j];if(f.nodeType==3){var t=A.textTransform(g,A.normalize(f.nodeValue)).replace(/</g,"&lt;");if(o&&p){t=t.replace(/^\s+/,"")}m.push(t);o=/\s$/.test(t);p=false}if(f.nodeType==1&&!/^(style|script)$/i.test(f.nodeName)){var h=[];var r=f.nodeName.toLowerCase();var n=f.className||"";if(/\s+/.test(n)){if(n.indexOf(E.CLASS)>-1){n=n.match("(\\s|^)"+E.CLASS+"-([^\\s$]*)(\\s|$)")[2]}else{n=n.match(/^([^\s]+)/)[1]}}if(n!=""){h.push('class="'+n+'"')}if(r=="a"){var d=s(f.getAttribute("href")||"");var l=f.getAttribute("target")||"";h.push('href="'+d+'"','target="'+l+'"');if(!k){k={href:d,target:l}}}m.push("<"+r+(h.length>0?" ":"")+h.join(" ")+">");p=true;if(f.hasChildNodes()){q.push(j);j=0;e=f.childNodes;continue}else{if(!/^(br|img)$/i.test(f.nodeName)){m.push("</",f.nodeName.toLowerCase(),">")}}}if(q.length>0&&!f.nextSibling){do{j=q.pop();e=f.parentNode.parentNode.childNodes;f=e[j];if(f){m.push("</",f.nodeName.toLowerCase(),">")}}while(j==e.length-1&&q.length>0)}j++}return{text:m.join("").replace(/^\s+|\s+$|\s*(<br>)\s*/g,"$1"),primaryLink:k||{}}}};
var parseSelector=(function(){var B=/\s*,\s*/;var A=/\s*([\s>+~(),]|^|$)\s*/g;var L=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var F=/(^|\))[^\s>+~]/g;var M=/(\)|^)/;var K=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function H(R,P){P=P||document.documentElement;var S=R.split(B),X=[];for(var U=0;U<S.length;U++){var N=[P],W=G(S[U]);for(var T=0;T<W.length;){var Q=W[T++],O=W[T++],V="";if(W[T]=="("){while(W[T++]!=")"&&T<W.length){V+=W[T]}V=V.slice(0,-1)}N=I(N,Q,O,V)}X=X.concat(N)}return X}function G(N){var O=N.replace(A,"$1").replace(L,"$1*$2").replace(F,D);return O.match(K)||[]}function D(N){return N.replace(M,"$1 ")}function I(N,P,Q,O){return(H.selectors[P])?H.selectors[P](N,Q,O):[]}var E={toArray:function(O){var N=[];for(var P=0;P<O.length;P++){N.push(O[P])}return N}};var C={isTag:function(O,N){return(N=="*")||(N.toLowerCase()==O.nodeName.toLowerCase())},previousSiblingElement:function(N){do{N=N.previousSibling}while(N&&N.nodeType!=1);return N},nextSiblingElement:function(N){do{N=N.nextSibling}while(N&&N.nodeType!=1);return N},hasClass:function(N,O){return(O.className||"").match("(^|\\s)"+N+"(\\s|$)")},getByTag:function(N,O){return O.getElementsByTagName(N)}};var J={"#":function(N,P){for(var O=0;O<N.length;O++){if(N[O].getAttribute("id")==P){return[N[O]]}}return[]}," ":function(O,Q){var N=[];for(var P=0;P<O.length;P++){N=N.concat(E.toArray(C.getByTag(Q,O[P])))}return N},">":function(O,R){var N=[];for(var Q=0,S;Q<O.length;Q++){S=O[Q];for(var P=0,T;P<S.childNodes.length;P++){T=S.childNodes[P];if(T.nodeType==1&&C.isTag(T,R)){N.push(T)}}}return N},".":function(O,Q){var N=[];for(var P=0,R;P<O.length;P++){R=O[P];if(C.hasClass([Q],R)){N.push(R)}}return N},":":function(N,P,O){return(H.pseudoClasses[P])?H.pseudoClasses[P](N,O):[]}};H.selectors=J;H.pseudoClasses={};H.util=E;H.dom=C;return H})();var helvetica = { src: 'js/sifr3-r436/flash/helvetica.swf' };

        var tahoma = { src: 'js/sifr3-r436/flash/tahoma.swf' };
font = helvetica;

sIFR.activate(font);

sIFR.replace(font, {
  selector: '.news-box-title a',
  wmode: 'transparent',
  sharpness : 0,
  thickness : 80,
  forceSingleLine : true,
  css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0; cursor: pointer;}'
});

sIFR.replace(font, {
  selector: '.content-box-title a',
  wmode: 'transparent',
  sharpness : 0,
  thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0; cursor: pointer;}'
});

sIFR.replace(font, {
  selector: '.subpage-box-title',
  wmode: 'transparent',
  sharpness : 0,
  thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0}'
});

sIFR.replace(font, {
  selector: '.default-box-title',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#2d2d2d; font-size:14px; padding-top:0; letter-spacing:0;}'
});

sIFR.replace(font, {
  selector: '.contact-person-title',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#2d2d2d; font-size:15px; padding-top:2px; letter-spacing:0;}'
});

sIFR.replace(font, {
  selector: '#referencje h2',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#2d2d2d; font-size:15px; padding-top:2px; letter-spacing:0;}'
});

sIFR.replace(font, {
  selector: '.contact-person-name',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:17px; padding-top:0; margin-top: -10px; letter-spacing:0; text-align: right;}'
});


sIFR.replace(font, {
  selector: '.left-box-content-, #newsletter .box-title, #strefa-klienta .box-title',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0}'
});


sIFR.replace(font, {
  selector: 'h1 a',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; cursor: pointer; font-size:17px; letter-spacing:0}'
});

sIFR.replace(font, {
  selector: '.smart_wdrozenie h3',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:15px; letter-spacing:0}'
});

sIFR.replace(font, {
  selector: '.sub-category-header',
  wmode: 'transparent',
					sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:13px; letter-spacing:0}'
});

sIFR.replace(font, {
  selector: '.sub-category-header',
  wmode: 'transparent',
  sharpness : 0,
			 			thickness : 80,
  css: '.sIFR-root {color:#017c4d; font-size:13px; letter-spacing:0}'
});


 sIFR.replace(font, {
      selector: '#rodzaje_realizacji h3',
      wmode: 'transparent',
      sharpness : 0,
      thickness : 80,
      css: '.sIFR-root {color:#676767; font-size:15px; letter-spacing:0}'
    });
	
sIFR.replace(font, {
	transparent: true,
	selector: '#calcOszcz h2',
	css: '.sIFR-root { color: #676767; font-size: 16px;} strong {color: #017c4d; font-size: 24px; text-align: center;} em { font-style: normal; color: #017c4d; }'
});


function sifr_realoaded() {
    font = helvetica;

    sIFR.activate(font);

	sIFR.replace(font, {
      selector: '.news-box-title a',
      wmode: 'transparent',
      sharpness : 0,
      thickness : 80,
      forceSingleLine : true,	  
      css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0}'
    });

	sIFR.replace(font, {
      selector: '.content-box-title a',
      wmode: 'transparent',
      sharpness : 0,
      thickness : 80,
      forceSingleLine : true,	  
      css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0}'
    });
	
    sIFR.replace(font, {
      selector: '.subpage-box-title',
      wmode: 'transparent',
      sharpness : 0,
      thickness : 80,
      css: '.sIFR-root {color:#017c4d; font-size:17px; letter-spacing:0}'
    });

    sIFR.replace(font, {
      selector: '#rodzaje_realizacji h3',
      wmode: 'transparent',
      sharpness : 0,
      thickness : 80,
      css: '.sIFR-root {color:#676767; font-size:15px; letter-spacing:0}'
    });
}
