function zmianaAliasu(alias,alias_staly){
	if(alias!=''){
		document.forms[0].action=alias;
	}else{
		document.forms[0].action=alias_staly;
	}
}
function przelicz(){
	//var ilosc = document.forms[0].elements.length;
	var ilosc = tablica_guzikow.length;
	var idguzika;
	var guzik;
	var suma = 0;
	var ilosc_t = 0;
	var cena_t = 0;
	for(var i=0;i<ilosc;i++){
		idguzika = "Produkty"+tablica_guzikow[i];
		guzik = document.getElementById(idguzika)
		if(guzik.type=="text" && guzik.value>0){
			ilosc_t=parseInt(guzik.value);
			cena_t=parseInt(tablica_cen[i]);
			suma=suma + ilosc_t*cena_t;
		}
		if(guzik.type=="hidden"){
			ilosc_t=parseInt(guzik.value);
			cena_t=parseInt(tablica_cen[i]);
			suma=suma + ilosc_t*cena_t;
		}
		if(guzik.type=="checkbox" && guzik.checked){
			ilosc_t=parseInt(guzik.value);
			cena_t=parseInt(tablica_cen[i]);
			suma=suma + ilosc_t*cena_t;
		}
		
	}
	suma=parseFloat(suma/100)+",00";
	var pole_suma=document.getElementById("cena_calkowita");
	pole_suma.innerHTML=suma;
	
}
function menu(thismenu){
	
	var idmenu = thismenu.id;
	$("#menuglowne ul li ul li").hide();
	$("#menuglowne ul li#"+idmenu+" ul li").show();
	
}
function menuzaznaczone(){
	
	
	$("#menuglowne ul li ul li").hide();
	$("#menuglowne ul li.childrenSelected ul li").show();
}

$(document).ready(function() {

	$("#menuglowne ul li.hasChildren").mouseover(function(){
		menu(this)
	})
	
	$("#menuglowne ul li.hasChildren").mouseout(function(){
		menuzaznaczone()
	})
	
	$("#menuglowne ul li.childrenSelected").mouseover(function(){
		menu(this)
	})

})

$.fn.qtip.styles.cream2 = { // Last part is the name of the style
  	width: 250,
      padding: 5,
      fontWeight:'500',
      fontSize:'12px',
      tip: 'topLeft',
      name: 'cream' // Inherit the rest of the attributes from the preset dark style
}

$.fn.qtip.styles.cream3 = { // Last part is the name of the style
  	width: 250,
      padding: 5,
      fontWeight:'500',
      fontSize:'12px',
      tip: 'bottomMiddle',
      name: 'cream' // Inherit the rest of the attributes from the preset dark style
}
