$(document).ready(function(){
	
	var lang = window.location.pathname.split("/")[1];
	
	swfobject.embedSWF("/flash/cuber.swf", "BoxPlace", "319", "320", "9.0.0", "expressInstall.swf", {}, { 'scale':'noscale','menu': 'false', 'wmode': 'transparent' }, { 'align':'top' } );
	swfobject.embedSWF("/flash/1pc.swf", "Morph1pc", "60", "40", "9.0.0", "expressInstall.swf", {}, { 'menu': 'false', 'wmode': 'transparent' }, { 'align':'top' } );
	/* swfobject.embedSWF("/flash/morph.swf", "Morph", "320", "90", "9.0.0", "expressInstall.swf", {"lang":lang}, { 'scale':'noscale','menu': 'false', 'wmode': 'transparent' }, { 'align':'top' } ); */
	
	$('a.Rep,a.RepGB').each(function(){
		var e = $(this).attr("href").replace("/","").split(".html")[0]+"@"+$(this).attr("rel");
		$(this).attr({"href":"mailto:"+e});
		if($(this).attr('class').indexOf('RepGB')==-1) $(this).text(e);
	});
	
	$(".lightbox").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'image'
	});
	
	$("#Main .Text p:last").css({'padding-bottom':'0px'});
	
	/* $("#FastJump").hover(
		function () { $(this).stop().fadeTo('fast', 1); }, 
		function () { $(this).stop().fadeTo('slow', 0.3); }
	); */

	
	$("a.Printer").click(function(){
		window.print();
		return false;
	});
	/* $("#SubMenu a.Rozw").click(function(){
		$(this).parent().find("ul:first").animate({ opacity: 'toggle', height: 'toggle' }, "slow");
		return false;
	}); */
	$("#SubMenu ul li:last").css({"border":"none"});
	
});

function checkEmail(x){return/^[\w\.-]+@([\w-]+\.)*[a-z]{2,4}$/.test(x)}

function ShowError(txt) {
	$.fancybox({
		'autoScale'			: true,
		'content'			: '<div id="Question"><div class="txt">'+txt+'</div></div>'
	});
	return false;
}
