//home page slider
	$(document).ready(function(){
							   
							   
	/* ------------------------------------------------------------------------ 
	 Cycle functions
	------------------------------------------------------------------------ */

	var activeIndex = 9999; // counter used
	
	// redefine Cycle's updateActivePagerLink function 
	$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
		if (activeIndex == currSlideIndex) {
			var anchor = $(pager).find('li').filter('li:eq('+currSlideIndex+')').find('a');
			if (anchor.attr('target') == '_blank') {
				window.open(anchor.attr('href'));
			} 
			else {
				location.href = anchor.attr('href');
			}
		}
		$(pager).find('li')
			.filter('li:not('+currSlideIndex+')')
			.animate({height: '41', width: '330', backgroundColor: 'black'},600)
			.removeClass('on')
			.filter('li:eq('+currSlideIndex+')')
			.animate({height: '160', width: '522', backgroundColor: 'blue'},850,'easeOutBack') // Colors allowed here are Blue or Red. You can create your own color in file jquery.colors.js
			.addClass('on');
		activeIndex = currSlideIndex;
	};

	// Give extra tease time for slides with class of "delay"
	var animTimeout = 8000;
	var animDelayMultiplier = 2;
	 
	function onBefore(curr,next,opts) {
		if(next.className == 'delay') { 
			opts.timeout = animTimeout * animDelayMultiplier;
		} else if(opts.timeout != animTimeout) {
			opts.timeout = animTimeout;
		}
	}

	$('#slides ul').after('<div id="slidesitems"><ol>').cycle({
		fx: 'fade',
		speed: 1400,
		timeout: animTimeout,
		pager: '#slidesitems ol',
		pagerEvent: 'click',
		pagerAnchorBuilder: function(idx, slide) {
			var $content = $('#slides ul li:eq(' + (idx) + ') div.nav').html();
			return '<li><div class="default">' + $content + '</div><div class="extended">' + $content + '</div></li>';
		},
        before: onBefore
	});
	
	// Pause SLideshow on hover of slide nav
	$('#slidesitems').hover(
		function(){ 
			$('#slides ul').cycle('pause'); 
		}, 
		function(){ 
			$('#slides ul').cycle('resume'); 
		}
	);

	// Set Opacity of slide nav
	$('#slidesitems li').css('opacity','0.90');

	/* ------------------------------------------------------------------------ 
	 End Cycle functions
	------------------------------------------------------------------------ */

							   
							   
		$('#slider_area').cycle({ 
			fx:     'fade', 
			easing: 'backout', 
			timeout: 5110, 
			pager:  '#numbers', 
			cleartype:  1,
			pagerAnchorBuilder: function(idx) { 
				return '<li><a href="#" title="">&nbsp; s</a></li>'; 
			} 
		});
	});

//cufon fonts
	$(document).ready(function(){
		Cufon.replace('h1,h2,h3,h4,h5,h6', {hover: true});
	});

//navigation
	$(document).ready(function(){
			ddsmoothmenu.init({
				mainmenuid: "dropdown_menu", //menu DIV id
				orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
				classname: 'dropdown', //class added to menu's outer DIV
				//customtheme: ["#1c5a80", "#18374a"],
				contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
			})
 	});

//image effects 
	$(document).ready(function(){
			var image_e= $(".image.portfolio, .image.product_image");
			image_e.mouseover(function(){$(this).stop().animate({ opacity:0.6
					}, 400);
			}).mouseout(function(){
				image_e.stop().animate({ 
					opacity:1
					}, 400 );
			});
	});

//pretty photo
	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto();
	});

//product tabs
	$(document).ready(function(){
			var tabs= $("#tabs ul li");
			var content = $("#tabs #content");
			var kids = content.children();
			kids.attr("style","display:none;");
			$("#tabs #content div:first").attr("style","display:block;");
			tabs.click(
				function(){
						var show=$(this).attr("title");
						//change clicked tab class
						$("#tabs ul li").removeClass("active");
						$(this).addClass("active");
						//view clicked tab content
						kids.attr("style","display:none;");
						content.slideUp(100);
					$(function(){
							content.slideDown(400);
							$("#"+show+"").attr("style","display:block;");
					});
				}
			);
	});

//validate contact form
	  $(document).ready(function(){
		  jQuery.validator.messages.required = "";
			$("#validate_form").validate({});
	  });
	  
