function confirmGetUrl(url, mess){
	if (!confirm(mess))
		return 0;
	else
		document.location=url;
}

function showTyp(typ)
{
	pola = document.getElementsByTagName('select');
	//alert (pola);
	
	for(i=0; i<pola.length; i++)
	{
		//alert (pola[i]);
		document.getElementById(pola[i]).style.display= "none";
	}
}


function showHide(property, value, showHideId) {
	var el;
		el = document.getElementById(showHideId);
			
	if ( property==value ) {
		el.style.display="";	
	} else {
		el.style.display="none";
	}
}
function copyVatData() {
	//document.form1.bill_firstname.value = document.form1.firstname.value;
	//document.form1.bill_lastname.value = document.form1.lastname.value;
	document.form1.bill_street.value = document.form1.street.value;
	document.form1.bill_buildingNo.value = document.form1.buildingNo.value;
	document.form1.bill_locInBuildingNo.value = document.form1.locInBuildingNo.value;
	document.form1.bill_postal.value = document.form1.postal.value;
	document.form1.bill_city.value = document.form1.city.value;
	document.form1.bill_country.options[document.form1.country.selectedIndex].selected=true;
}

function round_float(x,n){
	  if(!parseInt(n))
	  	var n=0;
	  if(!parseFloat(x))
	  	return false;
	  return Math.round(x*Math.pow(10,n))/Math.pow(10,n);
	}


function updateOrderSumPrice() {
	var price, deliveryPrice, deliveryTypeIdEl, operatorIndex;
	
	price 	= parseFloat(document.form1.orderOrgPrice.value);
	operatorIndex = document.form1.deliveryType.selectedIndex;
        deliveryPrice = parseFloat(document.form1.availableDeliveryOperatorsPrices.options[operatorIndex].label);
	document.getElementById('deliveryTypeDesc').innerHTML = "Przesyłka: " + document.form1.availableDeliveryOperatorsClear.options[operatorIndex].label;
        

        if ( document.form1.paymentType.options[document.form1.paymentType.selectedIndex].value == 3 )
            deliveryPrice =22.14;
        
        price += deliveryPrice;
        document.getElementById('deliveryTypePrice').innerHTML = deliveryPrice + " PLN";
	
	deliveryTypeIdEl = document.getElementById("deliveryTypeId");
		deliveryTypeIdEl.style.display="";
	
		
		document.getElementById('orderSumBruttoPLN').innerHTML = round_float(price,2);
}
function showVotedStars(from,till) {
	for( i=from; i<=till; i++) 
		document.getElementById('unvotedStar_'+i).src='images/voted_star.jpg';
	
}

function showUnvotedStars(from,till) {
	for( i=from; i<=till; i++) {
		document.getElementById('unvotedStar_'+i).src='images/unvoted_star.jpg';
	}
}


