//home page slider

var showEffect;
jQuery.each(jQuery.browser, function(i) {
         if($.browser.msie){
              showEffect = 'false';
         }
});

$(document).ready(function(){
	var slider_area;
	var slider_buttons;

	// Which slider
	if ($('#slider_area').length>0){
		
		// Home Page Slider
		slider_area="#slider_area";	
		slider_buttons="#numbers";	
	
		$(slider_area).cycle({ 
			fx:     'scrollLeft', 
			timeout:  4000,
			easing: 'backout', 
			prev: '.prev', 
			next: '.next',
			cleartype:  1,
			pause:           true,     // true to enable "pause on hover"
			pauseOnPagerHover: true,   // true to pause when hovering over pager link				
			before:  onBefore, 
			after:   onAfter ,				
			pagerAnchorBuilder: function(idx) { 
				return '<a href="#" title=""><img src="images/pixel.gif" width="14" heigth="14"></a>'; 
			}
		});
		
	} 

	if ($('.sub_slider').length>0){
		
		// Sub Page Slider
		sub_slider_area=".sub_slider";	

		$(sub_slider_area).cycle({ 
			fx:     'fade', 
			timeout:  4000,
			pager:'.sub_slider_pager',
			cleartype:  1
		});
		
	}
        
	
      jQuery('.prev, .next').css({opacity:0});
      jQuery('#slider').hover(function()
      {
              jQuery('.prev, .next').stop().animate({opacity:1},400);
      },
      function()
      {
              jQuery('.prev, .next').stop().animate({opacity:0},400);
      });


	function onBefore() {
		if (showEffect!="false"){
			jQuery('.desc').stop().animate({opacity:0},0);
		}else{
				
		}
	} 
	function onAfter() {
		if (showEffect!="false"){
			jQuery('.desc').stop().animate({opacity:1},400);
		}else{
				
		}			
	}
	
});


//pretty photo
$(document).ready(function(){
        $("a[rel^='prettyPhoto']").prettyPhoto();
});

 
 


//cufon fonts
$(document).ready(function(){
       Cufon.replace('h1,h2,h3,h4,h5,h6,.title,.title a,.subtitle, .subtitle a, .banner, a.banner_button', {hover: true});
});
	 
 
//drop down menu
$(document).ready(function() {
	$("#navigation li").each(function()
	{   
            $(this).hover(function()
            {	
                       $(this).find('ul:first').stop().css({
                             paddingTop:"8px",                              
                             height:"auto",
                             overflow:"hidden",
                             display:"none"
                             }).slideDown(200, function()
                       {
                       $(this).css({
                             height:"auto",
                             overflow:"visible"
                       });
            });
                       
            },
            
            function()
            {	
                 $(this).find('ul:first').stop().slideUp(200, function()
                 {	
                         $(this).css({
                          display:"none",
                          overflow:"hidden"
                          });
                 });
            });	
	});
        
        $("#navigation ul ").css({
            display: "none"}
         ); 
});


	 



//image effects 
$(document).ready(function(){
         var image_e= $(".image.portf, .image.product_image");
         image_e.mouseover(function(){$(this).stop().animate({ opacity:0.7
                         }, 400);
         }).mouseout(function(){
                 image_e.stop().animate({ 
                         opacity:1
                         }, 400 );
         });
});


//Coda slider on product detail page
$(document).ready(function() {
  if ($('#product-slider').length>0){	
        $('#product-slider').codaSlider(
                {
                dynamicArrows: false,
                dynamicTabsAlign: "left",
                dynamicTabsPosition: "top"
                }
        );
  }
});

