$(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
  $.facebox.settings.opacity = 0.8;
}) ;

$(document).ready( function(){ 
$('.fade_images').innerfade({ animationtype: 'fade', speed: 'slow', timeout: 5000, type: 'sequence', containerheight: '144px' }); 
} ); 
$(document).ready( function(){ 
$('.reviews').innerfade({ animationtype: 'fade', speed: 'slow', timeout: 5000, type: 'random', containerheight: '80px' }); 
} ); 

function remove(id,type){
$.ajaxSetup({ cache:false });
$.post("/includes/remove.php",{id: id});
var row = $("#remove_" + id);
var loading = "<img src='/graphics/loading.gif' alt='loading' style='margin:3px 0 0 0;' />"
row.html(loading);
row.fadeTo("slow", 0, function () { 
row.remove();
$("#the_basket").load("/includes/"+type+".php");
});
}

function add(id,item_desc,net_value,weight,qty,type){
if(id > 0){
$.ajaxSetup({ cache:false });
var url = "/includes/add_to_basket.php";
url=url+"?qty="+qty;
url=url+"&id="+id;
url=url+"&item_desc="+item_desc;
url=url+"&net_value="+net_value;
url=url+"&mysid="+Math.random();

jQuery.facebox({ajax:url});
return false;
}
else{$("#the_basket").load("/includes/"+type+".php");return false;}
}

$(document).ready( function(){ 
$.ajaxSetup({ cache:false });
var pathname = window.location.pathname;

if(pathname != "/shopping-basket.php")
{window.onfocus = $("#the_basket").load("/includes/basket.php");}
if(pathname == "/shopping-basket.php")
{window.onfocus = $("#the_basket").load("/includes/checkout.php");}
} ); 
