<!-- path: views/pages/combined --> 
function ajax_loader(type) {
if (type == "start") {
$('body').prepend('<div class="loading"><span>Loading&hellip;</span></div>');
} else {
$('div.loading').slideDown('slow').remove();
};
}// affects the display of pages - where CSS is not enough
$(document).ready(function() {
if ($.browser.msie) { // for IE6 as CSS attr selector are not supported
$('input[@type$="checkbox"]').each(function() {
$(this).addClass('checkbox');
});
$('input[@type$="radio"]').each(function() {
$(this).addClass('radio');
});
}
});$(document).ready(function(){
$("#nav-one li").click(
function()
{
if( $(this).children("ul").length == 0 )
{
window.location.href = $(this).children().eq(0).attr("href");
return false;
}
if( $(this).children("ul").css("display")!='none')
{
if($(this).children().eq(1).children().eq(0).children().length>0)
{
window.location.href = $(this).children().eq(1).children().eq(0).children().attr("href");
return false;
}
}
$("#nav-one li ul").hide("fast");
$("ul", this).fadeIn("fast"); 
return false;
}
);
$("div#tabs td.active div:first-child").html("<img src='/images/active_mid_left.gif' style='width:14px'/>");
$("div#tabs td.active div:last-child").html("<img src='/images/active_mid_right.gif' style='width:14px'/>");
$("div#tabs td.inactive div:first-child").html("<img src='/images/inactive_mid_left.gif' style='width:14px'/>");
$("div#tabs td.inactive div:last-child").html("<img src='/images/inactive_mid_right.gif' style='width:14px'/>");
//$("ul.tabs li.active div.a div:nth-child(2)").css("background-image", "url(/images/active_center.gif)").css("padding-top", "10px").css("height", "20px");
//$("ul.tabs li.inactive div.a div:nth-child(2)").css("background-image", "url(/images/inactive_center.gif)").css("padding-top", "10px").css("height", "20px");
$("div#tabs td.active:first-child div:first-child").html("<img src='/images/active_left.gif' style='width:14px'/>");
$("div#tabs td.active:first-child div:last-child").html("<img src='/images/active_mid_right.gif' style='width:14px'/>");
$("div#tabs td.inactive:first-child div:first-child").html("<img src='/images/inactive_left.gif' style='width:14px'/>");
$("div#tabs td.inactive:first-child div:last-child").html("<img src='/images/inactive_mid_right.gif' style='width:14px'/>");
$("div#tabs td.active:last-child div:last-child").html("<img src='/images/active_right.gif' style='width:14px'/>");
$("div#tabs td.inactive:last-child div:last-child").html("<img src='/images/inactive_right.gif' style='width:14px'/>");
var count = $("td.active, td.inactive").length
$("td.active, td.inactive").width(55 / count + "em")
$("div.middle").width( ( 55.7850 - (2 * 1.2850 * count ) ) / count + "em")
if(!$.browser.mozilla)
{
$("div.middle").eq($("div.middle").length - 1).width(parseFloat($("div.middle").eq($("div.middle").length - 1).width() * 0.0907 + 0.15) + "em")
}
else
{
if(count>4)
{
$("div.middle").eq($("div.middle").length - 1).width(parseFloat($("div.middle").eq($("div.middle").length - 1).width() * 0.0907 - 0.15) + "em")
}
}

$("#nav-one li ul li a").click(
function()
{
window.location.href = $(this).attr('href');
return false;
}
);

$("#nav-one li ul li a.selected").css('font-weight','bold').parent().parent().show();

//$("#nav-one li").hover(function(){$(this).addClass("sfHover")})
});
 
/*$.fn.onclick = function(c) {
return this.each(function(){
$(this).onclick( 
function() { $(this).addClass(c);  },
function() { $(this).removeClass(c); }
);
});
};
*//*
function validator() {
if (!document.getElementById("checkout-form")) { return false; }
var form = document.getElementById("checkout-form");
form.onsubmit = function() {
var errors = 0;
$('#checkout-form li.error span').remove();
$("li").removeClass("error");
var firstname = document.getElementById("firstname");
if(firstname.value === '') {
errors[errors++]
$(firstname.parentNode).addClass("error").append('<span>Firstname is required</span>');
}
var lastname = document.getElementById("lastname");
if(lastname.value === '') {
errors[errors++]
$(lastname.parentNode).addClass("error").append('<span>Lastname is required</span>');
}
var city = document.getElementById("city");
if(city.value === '') {
errors[errors++]
$(city.parentNode).addClass("error").append('<span>City is required</span>');
}
var address = document.getElementById("address");
if(address.value === '') {
errors[errors++]
$(address.parentNode).addClass("error").append('<span>Address is required</span>');
}
var postcode = document.getElementById("postcode");
if(postcode.value === '') {
errors[errors++]
$(postcode.parentNode).addClass("error").append('<span>Postcode is required</span>');
}
var email = document.getElementById("email");
if(email.value === '') {
errors[errors++]
$(email.parentNode).addClass("error").append('<span>Email is required</span>');
}
var phone = document.getElementById("phone");
if(phone.value === '') {
errors[errors++]
$(phone.parentNode).addClass("error").append('<span>Phone is required</span>');
}
if (errors != 0) {
return false;
}
}
}
*/
function amend(id, val)
{
$.ajax({
type: "GET",
url: "/shopping_carts/amend/" +id + "/" + val,
success: function(msg)
{
window.location.reload(true);
}
});
}
$(document).ready(function(){
$("#billing").click(function(){
if($("#billing").attr("checked"))
{
$("#btitle").val('');
$("#bfname").val('');
$("#blname").val('');
$("#bcompany").val('');
$("#baddress1").val('');
$("#baddress2").val('');
$("#baddress3").val('');
$("#bcity").val('');
$("#bcounty").val('');
$("#bpostcode").val('');
$("#bcountry").val('');
$("#bemail").val('');
$("#bphone").val('');
}
else
$("form input").val("");
})
if($("#paymentmethod").val()=='Cheque')
{
$(".hid").show();
} else {
$(".hid").hide();
}
if($("#paymentmethod").val()=='Bank transfer')
{
$(".hid2").show();
} else {
$(".hid2").hide();
}
if($("#paymentmethod").val() == 'Cheque' 
|| $("#paymentmethod").val() == 'Bank transfer'
|| $("#paymentmethod").val() == 'Call me')
{
$("#cardnameli").hide();
$("#cardnumberli").hide();
$("#validfrommonthli").hide();
$("#validfromyearli").hide();
$("#validtomonthli").hide();
$("#validtoyearli").hide();
$("#cardverificationli").hide();
$("#issuenumberli").hide();
}
$("#paymentmethod").change(function(){
if($(this).val() == 'Cheque')
$(".hid").show();
else
$(".hid").hide();
if($(this).val() == 'Bank transfer')
$(".hid2").show();
else
$(".hid2").hide();
if($("#paymentmethod").val() == 'Cheque' 
|| $("#paymentmethod").val() == 'Bank transfer'
|| $("#paymentmethod").val() == 'Call me')
{
$("#cardnameli").hide();
$("#cardnumberli").hide();
$("#validfrommonthli").hide();
$("#validfromyearli").hide();
$("#validtomonthli").hide();
$("#validtoyearli").hide();
$("#cardverificationli").hide();
$("#issuenumberli").hide();
} else {
$("#cardnameli").show();
$("#cardnumberli").show();
$("#validfrommonthli").show();
$("#validfromyearli").show();
$("#validtomonthli").show();
$("#validtoyearli").show();
$("#cardverificationli").show();
$("#issuenumberli").show();
}
})
});
$(document).ready(function(){
var form = document.getElementById("scart");
if(form)
form.onsubmit = function()  {
var f='';
var o={};
$(form).find("input, textarea, select").each(function() {
o[this.name]=$(this).val();
});
$.post(form.getAttribute("action") +'ajax/', o, function() {
if ($.browser.msie) {
var $url = '/shopping_carts/minicart/' +'?' + new Date().getTime();
} else {
var $url = '/shopping_carts/minicart/';
}
$('#right').load($url);
});
$('#right').empty();
$('#right').prepend('<div id="temp-cart1"><div id="temp-cart2">Loading</div></div>');
$("#temp-cart2").height(200);
return false;
}
});<!-- pathend: views/pages/combined -->