jq(document).ready(function(){

	jq('.auto-hint').each(function(i, el){
        if(jq(this).val() == ''){
            jq(this).val(jq(this).attr('title'));
        }
        jq(el).focus(function(){
            if (jq(this).val() == jq(this).attr('title')) {
                jq(this).val('');
            }
        });
        jq(el).blur(function(){
            if (jq(this).val() == '') {
                jq(this).val(jq(this).attr('title'));
            }
        });
    });

	jq('a[rel=external]').attr('target','_blank');

	/**
	Cufon.replace('#content H1')('#content H2')('#footer H2')('#links H2')('#links a.level-1')('#footer .stock-products .title-stock')('#footer .stock-products .body-stock')
				('#footer .social-media .follow-us')('#footer .newsletter-box LABEL')('#content .rotator-box .transp-box P')('.slide-content h3')('.home-pages ul li a')('h3.cufon')('h4.cufon');
				*/

	jq('#slides ul').cycle({
		fx: 'fade',
		speed:  1000,
		timeout: 8000,
		pager:  '#carousel-nav',
		pause: 1
	});

	/*  Preload Images  */
	jq('a[rel=gallery]').each(function(){
		var src = jq(this).attr('href');
		var img = new Image();
		jq(img).load().attr('src', src);
	});

	/*  Switch Product Image  */
	jq('a[rel=gallery]').click(function(){return false;});
	jq('a[rel=gallery]').mouseover(function(){
		if (jq('#product-image').length) {
			var new_src = jq(this).attr('href');
			jq('#product-image img').attr('src',new_src);
			//jq('#product-image a').attr('href',new_src);
			return false;
		}
	});
});

