$(document).ready(function() {
    // Clear field value when clicked
    $(".has_default_value").focus(function() {
        if ($(this).val() == $(this).attr("title")) {
            $(this).val("");
        }
    });
    $(".has_default_value").blur(function() {
        if ($(this).val() == "") {
            $(this).val($(this).attr("title"));
        }
    });
    // Colorbox
    $('a.colorbox').colorbox({ transition: 'slide', maxHeight: '90%', speed: 500 });
    // Remove focus outline on click
    $("a").mousedown(function() {
        this.blur();
        this.hideFocus = true;
        this.style.outline = 'none';
    });
    // Rollovers
    $(".rollover").hover(function() {
        this.src = this.src.replace("_off.", "_on.");
    },
	function() {
	    this.src = this.src.replace("_on.", "_off.");
	});
    $(".rollover").each(function() {
        source_image = $(this).attr("src");
        rename_image = source_image.replace(/\_off./gi, "_on.");
        $("<img>").attr("src", rename_image);
    });


// Changable tabs

$('div.changable_tabs ul.tabs').show();
$('div.changable_tabs div.content h2').hide();

$('div.changable_tabs ul.tabs li.tab_1 a').click(function() {
    setTab1();
});
$('div.changable_tabs ul.tabs li.tab_2 a').click(function() {
    setTab2();
});
$('div.changable_tabs ul.tabs li.tab_3 a').click(function() {
    setTab3();
});
$('div.changable_tabs ul.tabs li.tab_4 a').click(function() {
    setTab4();
});

// Remove focus outline on click
    $("a").mousedown(function() {
        this.blur();
        this.hideFocus = true;
        this.style.outline = 'none';
    });

    // Rollovers
    $(".rollover").hover(function() {
        this.src = this.src.replace("_off.", "_on.");
    },
	function() {
	    this.src = this.src.replace("_on.", "_off.");
	});
    $(".rollover").each(function() {
        source_image = $(this).attr("src");
        rename_image = source_image.replace(/\_off./gi, "_on.");
        $("<img>").attr("src", rename_image);
    });

});

function setTab1() {
    $('div.changable_tabs ul.tabs li a').removeClass('current');
    $('div.changable_tabs ul.tabs li.tab_1 a').addClass('current');
    $('div.changable_tabs div.content').hide();
    $('div.changable_tabs div.content_1').show();
    return false;
}

function setTab2() {
    $('div.changable_tabs ul.tabs li a').removeClass('current');
    $('div.changable_tabs ul.tabs li.tab_2 a').addClass('current');
    $('div.changable_tabs div.content').hide();
    $('div.changable_tabs div.content_2').show();
    return false;
}

function setTab3() {
    $('div.changable_tabs ul.tabs li a').removeClass('current');
    $('div.changable_tabs ul.tabs li.tab_3 a').addClass('current');
    $('div.changable_tabs div.content').hide();
    $('div.changable_tabs div.content_3').show();
    return false;
}

function setTab4() {
    $('div.changable_tabs ul.tabs li a').removeClass('current');
    $('div.changable_tabs ul.tabs li.tab_4 a').addClass('current');
    $('div.changable_tabs div.content').hide();
    $('div.changable_tabs div.content_4').show();
    return false;
}
    // FadeRoll
    $('a').hover(function() {
        $(this).find('.faderoll').stop().fadeTo(0, 0.60);
    }, function() {
        $(this).find('.faderoll').stop().fadeTo(200, 1.00);
    });
 // jQZoom
    try {
        $('.zoomable').jqzoom({
            fadeoutSpeed: 'fast',
            hideEffect: 'fadeout',
            imageOpacity: '0.25',
            preloadText: 'Loading',
            title: false,
            xOffset: 14,
            yOffset: 0,
            zoomHeight: 430,
            zoomWidth: 440
        });
    }
    catch (err) {
 }
 
 var t;
     
    $(document).ready(function() {
         $('#divAddedToBasket').hover(function() {
            clearTimeout(t);
            $('#divAddedToBasket').show();
        },
	function() {
	    t = setTimeout(function() {
	        $('#divAddedToBasket').fadeOut('slow');
	        clearTimeout(t);
	    }, 2000);
	});
        $('#divAddedToBasket').mouseover(function() {
            clearTimeout(t);
        });
    });


    function FadeOut() {
       t = setTimeout(function() {
            $('#divAddedToBasket').fadeOut('slow');
           clearTimeout(t);
        }, 5000);
    }
