$(function() {
    /*
    // load galleria for product pages 
    $("#product-details .product-slide").hide();
   
    $("#product-details #product-1").show();
    $("#image-line-ul li").mouseover(function(){
        var photo_id = $(this).attr("id").replace("thumb-", "");
        $("#product-details .product-slide").hide();
        $("#" + photo_id).show();
    });
    */

    /* slide faq */
    $('div#faq_body p').click(function() {
        $(this).toggleClass("current");
        $('div#faq_body p').not(this).removeClass("current");
        $('#a_' + this.id).slideToggle();
        $('.answer').hide();
    });

    /* random background image on homepage */
    changeBg(0);

    /* Animate buttons homepage buttons */
    $("#home-banners div").hover(function() {
        $(this).stop().animate({ marginTop: "-14px", height: "150px" }, 250, function() {
            $(this).animate({ marginTop: "-10px", height: "146px" }, 250);
        });
    },function(){
        $(this).stop().animate({ marginTop: "0", height: "136px" }, 250);
    });
	    Cufon.replace('h1, h2, h3, h5, h6');
	    Cufon.replace('.cufon');
	    Cufon.replace('div#rechargeable-banner p');


    /* slide battery comparison */

    var last_slide_id = 'comparison_1';
    
    $('.title_comparison').click(function() {
        $('#sub' + last_slide_id).not('#sub' + $(this).attr("id")).slideUp();
        $('#sub' + $(this).attr("id")).slideToggle();
        last_slide_id = $(this).attr("id");
    });

    /* chargers features tooltip */

    $("#functions img").tooltip({
        track: true,
        delay: 0,
        showURL: false,
        showBody: " - ",
        extraClass: "pretty",
        fixPNG: true,
        opacity: 1,
        left: -120
    });

	/* disable right click */
    $("#galleria").bind("contextmenu", function(e) {
        return false;
    });

    $("body#home #main-content img").bind("contextmenu", function(e) {
        return false;
    });	

})
var i;
function changeBg(i)
{
    $('.home_img').hide();
    $('#home_img' + i%3).fadeIn();
    i++;
    if (i > 999) return
    setTimeout('changeBg(' + i + ')',10000);
}



