$(document).ready(function(){
	$('#hosting_zamow1').click(function() {$('#hosting_form1').submit();return false;});
	$('#hosting_zamow2').click(function() {$('#hosting_form2').submit();return false;});
	$('#hosting_zamow3').click(function() {$('#hosting_form3').submit();return false;});
	$('#hosting_zamow4').click(function() {$('#hosting_form4').submit();return false;});
	Cufon.replace('#menu li a', {
		hover: true
	});
	Cufon.replace('#contactMailTopBox a, #domainMailTopBox a', {
		hover: true
	});
	Cufon.replace('.hostingsList li ul li a, .hostingsList li ul li span', {
		hover: true,
		textShadow: '1px 1px #FFF'
	});
	Cufon.replace('.hostingsList li ul li span', {
		hover: true,
		textShadow: '1px 1px #FEDCAE'
	});
	Cufon.replace('.hostingsList li.apple ul li span', {
		hover: true,
		textShadow: '1px 1px #ae0000'
	});
	Cufon.replace('.yellowButton, .button', {
		textShadow: '1px 1px #FFE8C4'
	});
	Cufon.replace('h1:not(.noCufon)')('h2:not(.noCufon)')('h3:not(.noCufon)')('.cufonik');

	$('ul#menu li:last-child, ul.leftMenu li:last-child').addClass('last');
	
	$('ul.form li input[type=text], ul.form li input[type=password], ul.form li select, ul.form li textarea').focusin(function(){
		$(this).addClass('focus')	
	});
	
		$('ul.form li input[type=text], ul.form li input[type=password], ul.form li select, ul.form li textarea').focusout(function(){
		$(this).removeClass('focus')	
	});
	
	
	$("#logosSlider").flash({
		src: 'swf/scroll.logotypes.swf',
		id: 'LogotypesSlider',
		wmode: 'transparent',
		width: 785,
		height: 70 },
        { version: 8 }
    );

	$('#toUp').click(function(){
		var target_offset = $("#wrapper").offset();
		var target_top = target_offset.top;

		$("html, body").animate({scrollTop:target_top}, 1000);
		return false;
	});

	$('table .checkboxCol input[type=checkbox]:not(.chAll)').click(function(){
		var tr = $(this).parent().parent();
		if ($(this).is(':checked'))
			tr.addClass('active');
		else
			tr.removeClass('active');
	});

	$('.selectAll .chAll').click(function(){
		var checboxes = $(this).parent().parent().parent().find('input[type=checkbox]:not(.chAll)');
		var tr = $(this).parent().parent().parent().find('tr:not(.selectAll)');
		if ($(this).is(':checked'))
		{
			checboxes.attr('checked', true);
			tr.addClass('active');
		}
		else
		{
			checboxes.attr('checked', false);
			tr.removeClass('active');
		}
	});

	$('.radioList input[type=radio]').change(function(){
		var current_div = $(this).parent();
		current_div.parent().parent().find('div').removeClass('active');
		current_div.addClass('active');
	});

	if ($('form#domainStep2').length)
		$('form#domainStep2').validate();

	if ($('form#domainStep5').length)
		$('form#domainStep5').validate();

	if ($('#kontakt_form').length)
		$('#kontakt_form').validate();
	
	$('a.bLivechat').attr('href', 'https://lcpanel.lh.pl/licence/12900/open_chat.cgi?groups=0&s=1&lang=pl');
	$('a.bLivechat').click(function() {
		window.open('https://lcpanel.lh.pl/licence/12900/open_chat.cgi?groups=0'+'&s=1&lang=pl&dc='+escape(document.cookie+';l='+document.location+';r='+document.referer+';s='+typeof lc_session),'chat_12900','width=529,height=520,resizable=yes,scrollbars=no,status=1');
		return false;
	});
});

