jQuery(document).ready(function(){
	jQuery.noConflict()

       	jQuery(".tweet").tweet({
           username: "Rare_1s",
           join_text: "auto",
           avatar_size: 45,
           count: 5,
		auto_join_text_default: "",
        auto_join_text_ed: "",
        auto_join_text_ing: "",
        auto_join_text_reply: "",
        auto_join_text_url: "",
           loading_text: "loading tweets..."
       });

	Cufon.replace('.myriad_pro_semibold_italic', { fontFamily: 'Myriad Pro Semibold Italic', hover: true }); 
	Cufon.replace('h3.productName, .name, .myriad_pro_semibold, h3#comments, span.fn, h3.main-title, h1.page-title, .cat-item, #sidebarPages ul li', { fontFamily: 'Myriad Pro Semibold', hover: true }); 
	Cufon.replace('.myriad_pro_regular, #crp_related li, #cartNav a.button, .commentmetadata', { fontFamily: 'Myriad Pro Regular', hover: true }); 
	Cufon.replace('.myriad_pro_condensed_italic', { fontFamily: 'Myriad Pro Condensed Italic', hover: true }); 
	Cufon.replace('.myriad_pro_condensed', { fontFamily: 'Myriad Pro Condensed', hover: true }); 
	Cufon.replace('.myriad_pro_bold_italic', { fontFamily: 'Myriad Pro Bold Italic', hover: true }); 
	Cufon.replace('.myriad_pro_bold_condensed_italic', { fontFamily: 'Myriad Pro Bold Condensed Italic', hover: true }); 
	Cufon.replace('.myriad_pro_bold_condensed, h3.relatedTitle', { fontFamily: 'Myriad Pro Bold Condensed', hover: true }); 
	Cufon.replace('.myriad_pro_bold, #crp_related h3, ul.product_list_widget li a, ul.cart_list li a', { fontFamily: 'Myriad Pro Bold', hover: true }); 

	// Expand Panel
	jQuery("#open").click(function(){
		jQuery("div#panel").slideDown("slow");
		return false;
	});
		
	// Collapse Panel
	jQuery("#close").click(function(){
		jQuery("div#panel").slideUp("slow");		
		return false;	
	});
		
	jQuery("#toggle a").click(function () {
		jQuery("#toggle a").toggle();
		return false;
	});
		
	jQuery("#close").click(function(){
		jQuery("div#panel").slideUp("slow");		
		return false;	
	});

	jQuery('#contactForm input[type=text], #contactForm textarea').hover(
		function(){
			$(this).stop().animate({opacity: 0.8}, 300);
		},
		function(){
			$(this).stop().animate({opacity: 1}, 300);
		}
	);
  	jQuery(".triggerTip").hover(function(){
        tip = $(this).find('.tip');
        tip.show(); //Show tooltip
    }, function() {
        tip.hide(); //Hide tooltip
    }).mousemove(function(e) {
        var mousex = e.pageX + 20; //Get X coodrinates
        var mousey = e.pageY + 20; //Get Y coordinates
        var tipWidth = tip.width(); //Find width of tooltip
        var tipHeight = tip.height(); //Find height of tooltip

        //Distance of element from the right edge of viewport
        var tipVisX = $(window).width() - (mousex + tipWidth);
        //Distance of element from the bottom of viewport
        var tipVisY = $(window).height() - (mousey + tipHeight);

        if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
            mousex = e.pageX - tipWidth - 20;
        } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
            mousey = e.pageY - tipHeight - 20;
        }
        //Absolute position the tooltip according to mouse position
        tip.css({  top: mousey, left: mousex });
    });
	jQuery('#featured').carousel({
	orientation: 'horizontal',
	itemsPerPage: 1,
	itemsPerTransition: 1,
	speed: 600,
	autoScroll: true,
	pause: 5000,
	continuous: true,
	loop: true
});
});
