$(document).ready(function() {
	$("a.fancybox").fancybox({
		'titlePosition': 'inside',
		'type' : 'image'
	});
	$('#naglowek-image').cycle({ 
		'fx':    'fade', 
    	'timeout':  5000  		
	});

	$("a.fancytube").click(function() {
		$.fancybox({
			'titlePosition': 'inside',
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'width'		: 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
		return false;
	});

	$("img.form-foto").click(function() {
		var currentId = $(this).attr("id");
		var nazwa = $('#nazwa-' + currentId).val();
		$('#aparat-' + currentId).val(nazwa);
		var status = $('#status-' + currentId).val();	

		if (status == 'on'){
			$('#cb-' + currentId).removeClass('form-cb-on');
			$(this).removeClass('form-foto-sel');
			$('#status-' + currentId).val('off');	
			$('#aparat-' + currentId).val('');
		}
		else {
			$('#cb-' + currentId).addClass('form-cb-on');
			$(this).addClass('form-foto-sel');
			$('#status-' + currentId).val('on');	
			$('#aparat-' + currentId).val(nazwa);
		}
	});

	$("div.form-cb").click(function() {
		var currentId = $(this).attr("id");
		currentId = currentId.replace("cb-", "");
		var nazwa = $('#nazwa-' + currentId).val();
		$('#aparat-' + currentId).val(nazwa);
		var status = $('#status-' + currentId).val();	

		if (status == 'on'){
			$('#cb-' + currentId).removeClass('form-cb-on');
			$('#'+currentId).removeClass('form-foto-sel');
			$('#status-' + currentId).val('off');	
			$('#aparat-' + currentId).val('');
		}
		else {
			$('#cb-' + currentId).addClass('form-cb-on');
			$('#'+currentId).addClass('form-foto-sel');
			$('#status-' + currentId).val('on');	
			$('#aparat-' + currentId).val(nazwa);
		}
	});
	
	

	$("a.cena-glowica").click(function() {
		var currentId = $(this).attr("id");
		var nazwa = $('#nazwa-' + currentId).val();
		$('#glowica-' + currentId).val(nazwa);
		var status = $('#status-' + currentId).val();	

		if (status == 'on'){
			$('#cb-glowica-' + currentId).removeClass('form-cb-on');
			$(this).removeClass('cena-glowica-sel');
			$('#status-' + currentId).val('off');	
			$('#glowica-' + currentId).val('');
			
		}
		else {
			$('#cb-glowica-' + currentId).addClass('form-cb-on');
			$(this).addClass('cena-glowica-sel');
			$('#status-' + currentId).val('on');	
			$('#glowica-' + currentId).val(nazwa);
		}
	});

});

function SubtextResize(item){
	blockItem = document.getElementById(item);
	$('#'+item).animate({
		height: 'toggle' 
	}, 500, function() {
	});	}
	
		var flashvars = {};
		var params = {};
		params.wmode ="opaque";
		var attributes = {};
		attributes.id = "ehoson-export";
		swfobject.embedSWF("swf/ehoson-export.swf", "ehoson-export", "800", "300", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
		
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-25397336-1']);
  _gaq.push(['_setDomainName', 'echoson.pl']);
  _gaq.push(['_setAllowHash', false]);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



		
		
