var currentSlideElement;

// Cufon ----------------------------------------------------------------		
 Cufon.replace(['h2','h3','h4','h5','h6'], {hover: true});
// End of Cufon --------------------------------------------------------- 	

// Content ------------------------------------------------------------- 
(function($, window, document, undefined){
	$(document).ready(function(){
		$(".gallery").colorbox({maxWidth:800, maxHeight:600});
		$('ul.listBrands').find('.sub').fadeOut(0);
		$('ul.listBrands > li, a.listLink li').click(function(e){
			var $this = $(this);
			if(!$(e.target).is('img') && !$(e.target).is('a')){
				if($('ul.listBrands').find('ul.sub:animated').length > 0){return false;}
				$('ul.listBrands').find('.active').removeClass('active');
				if($this.find('ul.sub').is(':visible')){
					$this.find('ul.sub').stop(true,true).fadeOut(500);
				}else{
					$this.find('ul.sub').addClass('active');
					$('ul.listBrands').find('ul.sub').not('.active').stop(true, true).fadeOut(500, function(){
						if($this.find('ul.sub').is(':hidden')){
							$this.find('ul.sub').fadeIn(500);
						}
					});
				}
			}
		});
		
		$('ul.listImpress .sub').fadeOut(500);
		$('ul.listImpress').find('> li > h6').click(function(){
			if($(this).hasClass('active')){
				$(this).removeClass('active');
				$(this).parent().find('.sub').stop(true).fadeOut(500);
			}else{
				$(this).addClass('active');
				$(this).parent().find('.sub').stop(true).fadeIn(500);
			}
		});
		
		
		$('#book').colorbox({width: 600, height: 600, iframe: true});
	});
})(jQuery, window, document);
// End of Content ------------------------------------------------------
jQuery(document).ready(function(){	
	jQuery('a#brand').click(function() {
  		jQuery('div#open').fadeToggle({
   			 opacity: 1
  }, 500, function() {
    // Animation complete.
  });
});


});
// Tooltip --------------------------------------------------------------
jQuery(document).ready(function(){	
	jQuery("a").easyTooltip();
});
	jQuery.fn.easyTooltip = function(options){
	  
		// default configuration properties
		var defaults = {	
			xOffset: 22,		
			yOffset: 2,
			tooltipId: "easyTooltip",
			clickRemove: false,
			content: "",
			useElement: ""
		}; 
			
		var options = jQuery.extend(defaults, options);  
		var content;
				
		this.each(function() {  				
			var title = jQuery(this).attr("title");				
			jQuery(this).hover(function(e){											 							   
				content = (options.content != "") ? options.content : title;
				content = (options.useElement != "") ? jQuery("#" + options.useElement).html() : content;
				jQuery(this).attr("title","");									  				
				if (content != "" && content != undefined){			
					jQuery("body").append("<div id='"+ options.tooltipId +"'>"+ content +"</div>");		
					jQuery("#" + options.tooltipId)
						.css("position","absolute")
						.css("top",(e.pageY - options.yOffset) + "px")
						.css("left",(e.pageX + options.xOffset) + "px")						
						.css("display","none")
						.fadeIn("fast")
				}
			},
			function(){	
				jQuery("#" + options.tooltipId).remove();
				jQuery(this).attr("title",title);
			});	
			jQuery(this).mousemove(function(e){
				jQuery("#" + options.tooltipId)
					.css("top",(e.pageY - options.yOffset) + "px")
					.css("left",(e.pageX + options.xOffset) + "px")					
			});	
			if(options.clickRemove){
				jQuery(this).mousedown(function(e){
					jQuery("#" + options.tooltipId).remove();
					jQuery(this).attr("title",title);
				});				
			}
		});
	  
	};

// End of Tooltip -------------------------------------------------------

// Mailmask -------------------------------------------------------------
function noSpam() {
    if (document.getElementById) {
		var at = "@";
	  	var links = document.getElementsByTagName('a');
	  
	  	for (var i = 0; i < links.length; i++) {
		  	var linkElem = links[i];
			
		  	if (linkElem.className == 'escape') {
		  		var mail = linkElem.firstChild; var domain = linkElem.lastChild;
		  		mail.nextSibling.firstChild.innerHTML = at;
		  		linkElem.href = "mailto:" + mail.data + at + domain.data;
		  	}
			
	  	} // End for
	  
    } // End if
}

window.addEventListener?window.addEventListener('load',noSpam,false):window.attachEvent('onload',noSpam);
// End of Mailmask ------------------------------------------------------

// easySlider Settings --------------------------------------------------
/*jQuery(document).ready(function(){						  
		jQuery("#easySlider").easySlider({
			auto: false, 
			continuous: false,
			speed: 200
		});
	});	*/
// End of easySlider Settings -------------------------------------------

