$(document).ready(function(){
	$(".velikostiseznam").change(function(){
		//alert("a")
		var pId = $(this).attr("id").replace(/velikost_/, "");
		var sId = $(this).attr("value");
		$("#cena").load("/script/ajax/Slike/update_price_data.php", {parentId: pId, sizeId: sId});
	});
	
	$(".poslji").toggle(
		function(){
			$("#send").removeClass("okvirjiformov");
			$("#send").load("/templates/Slike/razglednica.tpl.php");
			$("#send").fadeIn();
		},
		function(){
			$("#send").fadeOut();
			$("#send").html("");
		}
	);
	
	$("#biografijaTrigger").toggle(
		function(){
			$("#biografija").slideDown();
		},
		function(){
			$("#biografija").slideUp();
		}
	);
	
	$(".vkosarico").click(function(){
		var pId = $(this).attr("id").replace(/slika_/, "");
		$("#minicart").load("/script/ajax/Kosarica/update_cart.php", {productId: pId});
		$("#dodano").fadeIn('slow');
		$("#dodano").animate({opacity: 1.0}, 10000);
		$("#dodano").fadeOut('slow');
	});
	
	$("#soglasje").click(function(){
		if(!document.getElementById("soglasje").checked)
		{
			document.form1.Submit3.disabled = true;
		}
		else
		{
			document.form1.Submit3.disabled = false;
		}
	});
});

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

