$(document).ready(function(){
	
	$("#hid").css('display', 'none');
	
	function round(number,x) {
		var x = (!x ? 2 : x);
		return (Math.round(number*Math.pow(10,x)) / Math.pow(10,x)).toFixed(2);
	}
	
	$(".datep").datepicker();
	
	$("input:image").mouseover(function(){
		$(this).attr("src","img/dodaj2.gif");
	}).mouseout(function(){
		$(this).attr("src","img/dodaj.gif");
	});
	
	$(".at").live("mouseover",function(){
		$(this).attr("style","background:#c5c5c5;");
	}).live("mouseout",function(){
		$(this).attr("style","");
	});
	
	$(".get_prod").live("click",function(){
		if( $(this).find("div:eq(2) img").attr("src")!="img/zwin.png" ){ $(this).find("div:eq(2) img").attr("src","img/zwin.png"); }else{ $(this).find("div:eq(2) img").attr("src","img/rozwin.png"); }
		$(this).next("div").slideToggle(100);
	});
	
	$("select[name=file]").live("change",function(){
		$("input[name=plik]").val( $(this).val() );
	});
	
	$(".delete").live("click",function(){
		if( !confirm("Czy napewno chcesz usun±æ?") ){
			return false;
		}
	});
	
	$(".log_in").click(function(){ $("input[name=login]").focus(); });
	$(".register").click(function(){ document.location.href="strona,register"; });

	$("input:radio[name=wysylka]").click(function(){
		var cena=parseFloat( $(this).attr("rel") );
		var bt=parseFloat( $(this).attr("bt") );
		$(".c_3").html(cena.toFixed(2)+"&nbsp;");
		$(".c_4").html( round((parseFloat($(".c_4").attr("val"))+cena).toFixed(2))+"&nbsp;" );
		$(".c_5").html( round((parseFloat($(".c_5").attr("val"))+bt).toFixed(2))+"&nbsp;" );
	});
	
});

function sel_pay(i) {
	if (document.getElementById && !document.all && document.getElementById(i)){ 
    	document.getElementById(i).checked=true;
 	}
	if (document.all && document.all[i]){
    	document.all[i].checked=true;
  }
}
