	$(document).ready( function() {
// ----------------------------------------------------------------

		$('#slideshow')=="" ? null : $('#slideshow').slide({autoplay: false, duration: 3000, showSlideIndex: true});
		$('#pane1').jScrollPane();

// --------------------------- external links

			$('a[rel="external"]').click( function() {
        		window.open( $(this).attr('href') );
        		return false;});
			

// --------------------------- no spam mail

			$('a[rel="mail"]').each( function() {
			   this.href = this.href.replace('(at)',"@");
       		   return true;});

// --------------------------- blur remove

			$("a", "#pane1").focus(function() {
  			$(this).blur();
			});
			
			$("input.radio").focus(function() {
  			$(this).blur();
			});			

// ---------------------------- FANCY BOX
	
		$(".slide_realizacje #slidesContainer .slide a.foto, .slide_realizacje #slidesContainer .slide a.fancybox").fancybox({
				'titleShow'		:	false,
				'top'			:	57,
				'padding'		:	0,
				'width'			:	'960',
				'height'		:	'450',
				'transitionIn' 	: 	'fade', 
				'transitionOut' : 	'fade',
				'scrolling'		:	'none',
				'type'			:	'iframe'
		});	

		
				

// ---------------------------- style switcher

	$("#panel_content").hide();
 
	$("#panel_click").click (function() { 
 			$(this).parent().find("#panel_content").slideDown('fast').fadeIn('slow').show();
		return false;
	});
	
	$("#panel_content").click(function() { 
			$("#panel_content").slideUp('normal').fadeOut('slow').hide();
		return true;
	});	

	
	$("#style-switcher a").click(function() { 
			$("#panel_content").slideUp('normal').fadeOut('slow').hide();
			$("#style-switcher a").removeClass('active');
			$(this).addClass('active');
		return true;
	});	


 // -------------------------- fancybox		
/*			$("#products_all .slide .foto a").fancybox({
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
			});
*/

});

/* window modal */

	var openMyModal = function(source,lang)
	{
		modalWindow.windowId = "myModal";
		modalWindow.width = "100%";
		modalWindow.height = "100%";
		modalWindow.content = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='100%' height='100%' id='indexload' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='wmode' value='transparent' /><param name='movie' value='/swf/indexmain.swf' /><param name='quality' value='high' /><param name='bgcolor' value='#000000' /><param name='FlashVars' value='&xml=foto,xml,"+source+",high,"+lang+"'><embed src='/swf/indexmain.swf' quality='high' bgcolor='#000000' width='100%' height='100%' wmode='transparent' name='indexmain' align='middle' allowScriptAccess='sameDomain' FlashVars='&xml=foto,xml,"+source+",high,"+lang+"' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
		modalWindow.open();
	};		
	
	
	
			
/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".tooltip").mouseover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    });	
	$(".tooltip").mouseout(function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
		
};


