//facebook widget
$(document).ready(function(){
	$(".trigger").click(function(){
			$(".FBpanel").toggle("fast");
			$(this).toggleClass("active");
			$(".trigger").toggle();
			return false;
	});
	$(".FBCloseButton").click(function(){
		$(".FBpanel").toggle("fast");
		$(".trigger").toggle();
	});
});

var tt;

function showPrice(wariant_id)
{
	if (ceny[wariant_id])
	{
		document.getElementById('brutto').innerHTML = ceny[wariant_id][1];
		document.getElementById('netto').innerHTML = ceny[wariant_id][0];
	}
}

function rozwinWysylkoweDane(elem)
{
	var tbl = document.getElementById('tabelaWysylki');
	var elementy = tbl.getElementsByTagName('tr');

	if (elem.checked == true)
	{

		for (var i=0; i<elementy.length; i++)
		{
			if (elementy[i].id != 'aaa')
				elementy[i].style.display = '';
		}
	}
	else
	{

		for (var i=0; i<elementy.length; i++)
		{
			if (elementy[i].id != 'aaa')
				elementy[i].style.display = 'none';
		}
	}
}

function hsd(string) {
    string = string.replace(/&amp;/g, '&');
    return string;
}

function pokazDaneWysylkowe(elem)
{
	if (elem.checked)
	{
		document.getElementById('daneWysylkowe').style.display = 'block';
	}
	else
	{
		document.getElementById('daneWysylkowe').style.display = 'none';
	}
}

function ppSelectTab(tab)
{
	var i = 0;
	for(i=1;i<3;i++)
	{
		if(i==tab)
		{
			document.getElementById('tab'+i).style.display = 'block';
			document.getElementById('pptab'+i).className = 'active';
		}
		else
		{
			document.getElementById('tab'+i).style.display = 'none';
			document.getElementById('pptab'+i).className = '';
		}
	}
	
}

function showBasket()
{
 $('#fullBasket').fadeIn();
 window.clearTimeout(tt);
 tt = window.setTimeout("doHideBasket()",5000);
}


function hideBasket()
{
	tt = window.setTimeout("doHideBasket()",2000);
}

function cancelHide()
{
	window.clearTimeout(tt);
}
function doHideBasket()
{
 $('#fullBasket').fadeOut();
}
function verticalAlign (){
		$('#menuContainer a').each (function() {
			$(this).height()  <20? $(this).css({lineHeight:'36px',display:'block'}): $(this).css({lineHeight:'17px',display:'block'});
			})
		$('#menuContainer li li a').each (function() {
			$(this).css({lineHeight:'16px'})
			})			
}
