$(document).ready(function(){


                $('.lbx').lightBox();



				var menuopen=0;
				if($("#idhidden").attr("rel")=='') {
					var lastopen=-1;
					var lastdid=-1;
					//alert("test 1");
				} else {
					var lastopen=$("#idhidden").attr("rel");
				}
				
				//alert(lastopen);
				//

				$("a.l2").mouseover(function() {
					var arr = new Array();
					arr =  this.rel.split(/,/);
					arr[0] = arr[0].toString(arr[0]);
					var y = $("#"+arr[1]).position().top;
					$("#"+arr[0]).css('top',y);
					$("#"+arr[0]).css('display','block');
					$("#"+arr[0]).fadeIn('fast');
					showmenu=arr[0];
				});

				$("a.alev_1").mouseup(function() {

					var did = "last_" + this.rel;
					var ile = parseInt($("#"+did).css('height'));
					var sid = this.rel;
					if(sid!=menuopen) {
						menuopen = sid;
						fxmenuopen(sid);
					}
					//lastopen=sid;
					
				});
				

				$("a.alev_1xx").mouseout(function() {
					alert(1);
					menulevlock[this.rel] = 2;
					var did = "last_" + this.rel;
					var sid = this.rel;
					window.setTimeout(function() {
					    fxmenuclose(sid);
					}, 100);
					
				});
				
				$(".menu2ain").mouseover(function () {
					var idx = "apps_" + this.rel;
					//alert(idx);
					$("#"+idx).css('backgroundColor','#F7F0AF');
					$("#"+idx).css('color','#DA3F10');
				});
				
				$(".menu2ain").mouseout(function () {
					var idx = "apps_" + this.rel;
					//alert(idx);
					$("#"+idx).css('backgroundColor','#CBE9F1');
					$("#"+idx).css('color','#095FC7');
				});
		
				
				
				
				
				function fxmenuclose(sid) {
					if(menulevlock[sid]==2) {
						var did = "last_" + sid;
						$("#"+did).slideUp(700);
						menulevlock[sid]==0;
					}
				}
				
				function fxmenuopen(sid) {

					var did = "last_" + sid;
					var lastdid = "last_" + lastopen;
					//alert(lastopen);
					if(lastopen!=0) {
						$("#"+lastdid).slideUp(300);
					}
					//$("#"+did).slideDown(300);
					$("#"+did).css('display','block');
					lastopen = sid;

				}
				
				$("#zamawiamKey").mouseout(function() {
					$(this).attr("src","g/zamawiam.png");
				});
				
				$("#zamawiamKey").mouseover(function() {
					$(this).attr("src","g/zamawiamb.png");
				});
				
				$("#zamawiamAKey").mouseout(function() {
					$(this).attr("src","g/zamawiam-akceptuje.png");
				});
				
				$("#zamawiamAKey").mouseover(function() {
					$(this).attr("src","g/zamawiam-akceptujeb.png");
				});
				
				$(".radioPlatnosc").mouseup(function() {
					
					$('#platnosckwota').html($(this).attr("rel"));
					$("#koszykRazem").html(parseFloat($('#razem0').html())+parseFloat($('#wysylkakwota').html())+parseFloat($('#platnosckwota').html()));
					
					$.ajax({
						type: "POST",
						url: "fx-ajax.php",
						data: "sh="+$(this).attr("name")+"&id="+$(this).val(),
						success: function(msg){
							//alert( "Data Saved: " + msg );
						}
					});
				});
				
				$(".radioWysylka").mouseup(function() {
					
					$('#wysylkakwota').html($(this).attr("rel"));
					$("#koszykRazem").html(parseFloat($('#razem0').html())+parseFloat($('#wysylkakwota').html())+parseFloat($('#platnosckwota').html()));
					
					$.ajax({
						type: "POST",
						url: "fx-ajax.php",
						data: "sh="+$(this).attr("name")+"&id="+$(this).val(),
						success: function(msg){
							//alert( "Data Saved: " + msg );
						}
					});
				});
				
				
				
				
				
			});




