

function log(obj) {
	if (window.console && window.console.log)
		window.console.log(obj);
};

	// Setup SIFR

	if ($.browser.msie && $.browser.version.substr(0,1)<7) { jQuery.fx.off = true; var ie6 = true; }
	
		var FrutigerLightCn = { src: '/wp-content/themes/luxelife/assets/FrutigerLightCn.swf'};
		sIFR.activate(FrutigerLightCn);
		sIFR.replace(FrutigerLightCn, { selector: '#content h1', css: [ '.sIFR-root { color: #5d245a; leading: -6; }' ] });
		sIFR.replace(FrutigerLightCn, { selector: '#content h4', css: [ '.sIFR-root { color: #333333; leading: 5;}'] });


	// Global Class Toggle
	$.fn.hoverClass = function(c) {
	    return this.each(function(){
	        $(this).hover( 
	            function() { $(this).addClass(c);  },
	            function() { $(this).removeClass(c); }
	        );
	    });
	};

	$(document).ready(function(){
		
		var preLoad = new Array();

		$('a.button').each(function(index, value){
			var $img = $(this).find('img');
			var static = $img.attr('src');
			var hover = static.replace("static", "hover");
			preLoad[index] = hover;
		}).hover(function() {
			var $img = $(this).find('img');
			var static = $img.attr('src');
			var hover = static.replace("static", "hover");
			$img.attr('src', hover);
		},function() {
			var $img = $(this).find('img');
			var hover = $img.attr('src');
			var static = hover.replace("hover", "static");
			$img.attr('src', static);
		});
		
		
		// Fading Hover States
		$('#nav li a').append('<span class="hover"></span>');
		$('#nav li ul').css({'opacity': 0});
		$('#nav li ul li a span').remove();
		$('#nav li:not(.current_page_item) a').hover(function() {
			$('.hover', this).stop().animate({'opacity': 1}, 600,'easeOutSine');
		},function() {
			$('.hover', this).stop().animate({'opacity': 0 }, 600, 'easeOutQuad');
		});

		// Fading Dropdown Menues
	    $("#nav li").hover(
	        function(){
				$("ul", this).stop().show().animate({'opacity': 1}, 600,'easeOutSine');
			}, 
	        function(){
				$("ul", this).stop().animate({'opacity': 0 }, 600, 'easeOutQuad', function () { $(this).hide(); });
			}
	    );
	
		$("a[href^=#][href!=#]").live('click',function(e){
		    $('html,body').animate({'scrollTop': $($(this).attr('href')).offset().top+'px'}); 
		    e.preventDefault();
		});
		
		$.preloadImages(preLoad)

	});



