// Hover move listing
$(document).ready(function() {
	
	
	
	// tooltip
	$.tools.tooltip.addEffect("fade",
		// opening animation
		function(done) {
			this.getTip().fadeIn();
			done.call();
		},
		// closing animation
		function(done) {
			this.getTip().fadeOut();
			done.call();
		}
	);
	$(".tool").tooltip({
		effect: 'fade'
	});
	
	
	// rollovers
	$("#sidebar li.sidemenu ul li.cat-item a").hover(function() { 
		// on rollover	
		$(this).stop().animate({ 
			marginLeft: "10" 
		}, "fast");
	} , function() { 
		// on out
		$(this).stop().animate({
			marginLeft: "0" 
		}, "fast");
	});
	
	
	
	
	// slideshow
  	$('#slides')
  	.before('<div id="slideshow-nav">')
  	.cycle({ 
		fx:     slideshow_fx, 
		speed:  slideshow_speed, 
		timeout: slideshow_timeout, 
		pause: 1,
		pager:  '#slideshow-nav',
		next:   'img#next', 
		prev:   'img#prev',
		after: function(){
			var myLink = $(this).children("a").attr("href");
            $('#slideshow-link').attr({ href: myLink});
		}
	});
		

		
	// fade slide
	$('.fade-slide').cycle({ 
		fx:     'fade', 
		speed:  500, 
		timeout: 3000, 
		pause: 1
	});
	
	
	
	
	// toggle
	$(".toggle-container").hide(); 
	$(".toggle-trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false;
	});
	
	
	
	
	
	// accordion
	$('.accordion-container').hide(); 
	$('.accordion-trigger:first').addClass('active').next().show();
	$('.accordion-trigger').click(function(){
		if( $(this).next().is(':hidden') ) { 
			$('.accordion-trigger').removeClass('active').next().slideUp();
			$(this).toggleClass('active').next().slideDown();		}
		return false;
	});
	
	
	// pretty photo
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	// init cufon fonts
	//Cufon.replace('.custom, ul#sidebar li.sidemenu ul li a, ul#nav li a', { fontFamily: 'bebas', hover: true });
	
	
	
	//superfish
	$("ul.sf-menu").superfish({
		autoArrows:  false, // disable generation of arrow mark-up
		  animation: {height:'show'}
	}); 
	
	// tabs
	$('.tabbed').tabs({
		fxFade: true
	});
	
	
//close			
});
	


// search clearance	
function defaultInput(target){
	if((target).value == 'Search...'){(target).value=''}
}

function clearInput(target){
	if((target).value == ''){(target).value='Search...'}
}

