$(document).ready(function(){

	$(".slidex2").click(function(){
		$(this).toggleClass("activex2"); return false;
	});
	
	 
});
$(document).ready(function(){

	$(".slidex3").click(function(){
		$(this).toggleClass("activex3"); return false;
	});
	
	 
});


navHover = function() {
var lis = document.getElementById("navmenu").getElementsByTagName("LI");
for (var i=0; i<lis.length; i++) {
lis[i].onmouseover=function() {
this.className+=" iehover";
}
lis[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" iehover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", navHover);




$(function() {
    $('.feature_bg').cycle({
        fx:     'fade',
        speed:  'fast',
        timeout: 0,
        pager:  '#nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav li:eq(' + (idx) + ') a';
        }
    });
		
});

$(document).ready(function() {
	var current_div = '.cycler-display-first';
	var next_div = '.cycler-display-second';
  $('ul#wine-nav li > a').click(function(ev) {
		var tmp_div = '';
		ev.preventDefault();
		$('ul#wine-nav li > a').removeClass('selected');
		$(this).addClass('selected');
    $(next_div).load($(this).attr('href'), null, function() {
  		$(current_div).fadeOut(150, function() {
  			$(current_div).html($(next_div).html());
				$(current_div).fadeIn(1000);
  		});		
		});
  });
});


   $(document).ready(function()
{
	slide("#tool-nav", 10, 20, 90, .8);
});

function slide(navigation_id, pad_out, pad_in, time)
{
	var list_elements = navigation_id + " li.slide";
	var link_elements = list_elements + " a.slide";
	
	var timer = 0;	
	$(link_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).animate({ paddingLeft: pad_out }, 150);
		},		
		function()
		{
			$(this).animate({ paddingLeft: pad_in }, 150);
		});
	});
}
// MIKES AMAZING TAB SWITCHERoo
// $(document).ready(function() {  
//  $('#tool-nav').each(function() {    
// $(this).children('a').click(function() {  
//  $(this).addClass('selector'); 
//  $(this).siblings().removeClass('selector');     
//return false;         
//  });  
// });  
//});  


 $(document).ready(function() {  
 $('#tool-nav').each(function() { 
 $("#tool-nav > li > a").click(function(){
  $(this).addClass('selector'); 
  $(this).parent().siblings().children("a").removeClass('selector'); 
		
	});
	
	});	 
}); 

$(document).ready(function() {
	anchor.init()
});

anchor = {
	init : function()  {
		$("a.anchorLink").click(function () {	
			elementClick = $(this).attr("href")
			destination = $(elementClick).offset().top;
			$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination}, 1100 );
		  	return false;
		})
	}
}
    
    
    
    