/* --- Cufon Font Generator Plugin --- */
Cufon.replace('h1, h2, h3, h4', { fontFamily: 'ColaborateLight', hover: {color:'rgba(0, 0, 0, 0.5)'} });
Cufon.replace('.btn_big', { fontFamily: 'ColaborateLight', color: '#ffffff', hover: true, textShadow: '-1px -1px #000' });
Cufon.replace('#lofslider h3, .panel h3, .textSlide h2', { fontFamily: 'ColaborateLight', color: '#fff', hover: true });
Cufon.replace('b.price', { fontFamily: 'ColaborateLight', color: 'rgba(0, 0, 0, 0.6)', hover: true });
Cufon.replace('#fsb h3', { fontFamily: 'ColaborateLight', hover: true, textShadow: '1px 1px rgba(0, 0, 0, 0.8)', color: '-linear-gradient(#FCFCFC, #B8B8B8)' });


// initialise plugins
jQuery(function(){
	
	/* --- jQuery Sliding Panel --- */
	jQuery('#slidingpanel .panel').stop().animate({'marginLeft':'-215px'},3000);

	jQuery('#slidingpanel').hover(
		function () {
			$('.panel',$(this)).stop().animate({'marginLeft':'0px'},500);
		},
		function () {
			$('.panel',$(this)).stop().animate({'marginLeft':'-215px'},500);
		}
	);

	// Stylesheet switcher
	// Call stylesheet init so that all stylesheet changing functions
	// will work.
	$.stylesheetInit();
	// When one of the styleswitch links is clicked then switch the stylesheet to
	// the one matching the value of that links rel attribute.
	jQuery('.links a').bind(
		'click',
		function(e)
			{
			$.stylesheetSwitch(this.getAttribute('rel'));
			return false;
	});

	// choose colors panel
	var offset = $("#slidingpanel").offset();
	var topPadding = 50;
	$(window).scroll(function() {
		if ($(window).scrollTop() > offset.top) {
			$("#slidingpanel").stop().animate({
				marginTop: $(window).scrollTop() - offset.top + topPadding
			});
		} else {
			$("#slidingpanel").stop().animate({
				marginTop: 0
			});
		};
	});
	
	/* --- DropDown Menu Plugin --- */
	jQuery('ul.sf-menu').superfish();
	
	/* --- jQuery Watermark Plugin --- */
	jQuery("#s").Watermark("Enter keywords");
	
	/* --- jQuery Tipsy --- */
	jQuery('.social a').tipsy(
		{
			gravity: 's', // nw | n | ne | w | e | sw | s | se
			fade: true
		}); 
	
	/* --- jQuery autoAlign --- */
	jQuery("#fsb").autoAlign(".widget-container", 50);
	jQuery(".columns").autoAlign(".column", 60);
	jQuery(".columns2").autoAlign(".column", 60);
	jQuery(".columns3").autoAlign(".column", 35);
	jQuery(".columns4").autoAlign(".column", 35);

});
