
	var xsn = {			
		SIZE_5MB: 	5242880,
		SIZE_15MB: 	15728640,
		SIZE_50MB:	52428800			
	};

	var _snEditMode = false;


	if( typeof(_shadowbox_ops) == 'undefined' ){
		
		var _shadowbox_ops = {
				language: 'pl',
				players: ['img','html', 'wmp']	
		};
	}


	function addEvent(el, type, fn){
	    if (el.addEventListener) {
	        el.addEventListener(type, fn, false);
	    } else if (el.attachEvent) {
	        el.attachEvent('on' + type, function(){
	            fn.call(el);
	        });
	    } else {
	        throw new Error('not supported or DOM not loaded');
	    }
	}

	function formatText(index, panel) {
		return index + "";
	}	

	function blinkLink(elId){
		$('#'+ elId).fadeOut('slow', function(){			
			$(this).fadeIn('slow');
		});
	}
	
	function getDom( elId ){		
		return document.getElementById( elId );		
	}

	$(document).ready(function(){
		
		if( $('#jq_configureCard').length ){
			window.setInterval("blinkLink('jq_configureCard')", 6000);
		}
		
		$('.jq_Sidelink').click(function(){
			document.location.href =  $(this).children().find('a').attr('href');
		});
		
		if( typeof(jQuery.fn.lightBox) == 'function' ){		
			$('a.lightbox').lightBox();
		}
		
		if( typeof(jQuery.fn.tabs) == 'function' ){		
			$('#tabs2').tabs(1);
			$('#tabs3').tabs();
			$('#featured').tabs({fx:{opacity:'toggle'}}).tabs('rotate', 5000, true);
		}		
		
		if( typeof(jQuery.fn.jshowoff) == 'function' ){
			$('#features').jshowoff({ speed:19500, links: true, autoplay:true, controls: false, controlText: {play : "rozpocznij", pause:"stop", previous: "poprzedni", next: "następny"} });
		}
		
		$('ul.sf-menu').superfish();		 		
		$('ul.sf-menu2').superfish();		
		
		$('.anythingSlider').anythingSlider({
            easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
            autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
            delay: 6000,                    // How long between slide transitions in AutoPlay mode
            startStopped: false,            // If autoPlay is on, this can force it to start stopped
            animationTime: 600,             // How long the slide transition takes
            hashTags: true,                 // Should links change the hashtag in the URL?
            buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
    		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
	        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
        });
        
        $("#slide-jump").click(function(){
            $('.anythingSlider').anythingSlider(6);
        });
        
        /* Footer Start*/
		//vars
		var conveyor = $(".content-conveyor", $("#sliderContent")),
		item = $(".item", $("#sliderContent"));
		
		//set length of conveyor
		conveyor.css("width", item.length * parseInt(item.css("width")));
				
        //config
        var sliderOpts = {
		  max: (item.length * parseInt(item.css("width"))) - parseInt($(".viewer", $("#sliderContent")).css("width")),
          slide: function(e, ui) { 
            conveyor.css("left", "-" + ui.value + "px");
          }
        };

        //create slider
        if( typeof(jQuery.fn.slider) == 'function' ){
        	$("#slider").slider(sliderOpts);
        }
		
        $('#searchForm').submit(function(){		
    		var whatField = $('#sWhat');
    		if( whatField.val() == whatField.attr('title') ){
    			whatField.val('');
    		}				
    	});
    	
    	$('#sWhat').click(function(event){    		
    		if( $(this).val() == $(this).attr('title') ){
    			$(this).val('');
    		}   		
    	})
    	.blur(function(){
    		if(  $.trim($(this).val()) == ''){
    			$(this).val( $(this).attr('title') );
    		}
    	});
	});