var _prefix = '/';

$(window).load(function() {

	$("a.imagineLink").fancybox({'overlayOpacity': 0.5, 'overlayShow' : true, 'titleShow' : false});
/*
    $('.jcarousel-skin-tango').jcarousel({
      auto: 0,
      wrap: 'last'
    });
*/
//	$('.swapImage').rollover(true);	
	
/*
	$('#slider').nivoSlider({
		effect: 'sliceDown',
		directionNav: false,
		directionNavHide: true,
		controlNav: false,
		keyboardNav: false,
		pauseOnHover: false,
		pauseTime: 5000
	});
	
	$('#bSave').formValidator({
		onSuccess: function () {
			$("#form").submit();
		},
		scope: '#form'
	});
	
	$("#imgSec").click(function(){
		$(this).attr('src', 'include/script_generate_code.php?id='+Math.random());
	});
*/

  $('#btnSendPFPJ').formValidator({
	  onSuccess	: function() {
	  $("#frmCheckoutPFPJ").submit(); 
	  },
	  scope		  : '#frmCheckoutPFPJ'
  });	

  $('#btnSend').formValidator({
	  onSuccess	: function() {
	  $("#frmContact").submit(); 
	  },
	  scope		  : '#frmContact'
  });	
	
	$("#finishOrder").click(function(e){
		e.preventDefault();
		$("#frmFinish").submit();
	});
	
	$("#captchaImg").click(function(){
		$(this).attr('src', 'include/script_generate_code.php?id=' + Math.random());
	});	
	
});

function removeFromCart(id, question)
{
  if(confirm(question))
    window.location.href = _prefix + 'cart.php?act=deleteFromCart&id=' + id;  
}

function updateQuantity(qnt, pos)
{
  window.location.href = _prefix + "cart.php?act=updateCart&qnt=" + qnt + "&pos=" + pos;
}
