document.observe('dom:loaded', function() {
	Cufon.replace
	('#main_nav li a',{ hover: true, fontFamily: 'FagoCoTf' })
	("#tagline h3", { fontFamily: 'Fago' })
	("ul.product_type a", { hover: true, fontFamily: 'Fago' })
	("ul.pages li a", { hover: true, fontFamily: 'FagoCoTf' })
	("h1.wide", { fontFamily: 'FagoCoTf' })
	("div.product_details dl dt", { fontFamily: 'Fago' })
	("div.product_details button.add_to_cart", { fontFamily: 'FagoCoTf'})
	("div.product_details h3", { fontFamily: 'FagoCoTf'})
	("#product div.product_list_wrap h2", { fontFamily: 'Fago' })
	("th", { fontFamily: 'FagoCoTf'})
	("td dl dd.product_details h2 a", { fontFamily: 'Fago', hover: true})
	("td.total p strong.total", { fontFamily: 'FagoCoTf' })
	("#cart p.finish *", { fontFamily: 'FagoCoTf' })
	("#register_form h2", { fontFamily: 'FagoCoTf' })
	("ul.client_type li a", { fontFamily: 'FagoCoTf', hover: true})
	("li.finish button.submit", { fontFamily: 'FagoCoTf'})
	("#text h1", { fontFamily: 'Fago'})
	("#text ul.content_nav li a", { fontFamily: 'Fago', hover: true})
	("div.info h2", { fontFamiliy: 'Fago'})
	("#contact h1", { fontFamily: 'Fago'})
	("#contact h2", { fontFamily: 'FagoCoTf'})
	("button.button", { fontFamily: 'FagoCoTf', hover: true})
	("a.button", { fontFamily: 'FagoCoTf', hover: true})
	("#register div.col h2", {fontFamily: 'FagoCoTf'})
	("#contact table.contact_details td strong", { fontFamily: 'FagoCoTf'});

	$$("*[class*='tooltip-hook']").each(function (element) {
		new Tooltip(element, $($A(element.classNames()).last().replace('tooltip-hook:', '')).show(), {delta_x: 5, delta_y: 5});
	});

	$$('a[rel="external"]').each(function(link){
		if(link.readAttribute('href') != '' && link.readAttribute('href') != '#'){
				link.writeAttribute('target','_blank');
        }
    });	

    $$('.toggle').each(function (elm) {
        elm.observe('focus', function () {
            if (elm.value == elm.title) {
                elm.value = '';
            }
        }).observe('blur', function (event) {
            if (elm.value == '') {
                elm.value = elm.title;
            }
        });
    });

    $$('.sidebar .carousel').each(function (carousel) {
        new Carousel(carousel, carousel.select('.slide'), carousel.up().select('.carousel-control'), {
            duration:   0.3,
            wheel:      true,
            circular:   true
        });
    });
});
