$(document).ready(function() {
	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_square'
	});

	$.tools.tooltip.addEffect("fade",
		function(done) {
			this.getTip().fadeIn();
			done.call();
		},
		function(done) {
			this.getTip().fadeOut();
			done.call();
		}
		);

	$(".tool").tooltip({
		effect: 'fade',
		offset: [50, 0]
	});

	$(".tool-right").tooltip({
		effect: 'fade',
		position: 'center right',
		offset: [0, -50],
		tipClass: 'tooltip-right'
	});

	$(".tool-bottom").tooltip({
		effect: 'fade',
		position: 'bottom center',
		offset: [-50, 0],
		tipClass: 'tooltip-bottom'
	});

	$(".tool-left").tooltip({
		effect: 'fade',
		position: 'center left',
		offset: [0, 50],
		tipClass: 'tooltip-left'
	});
	
	$("ul.sf-menu").superfish({
		autoArrows:  false,
		animation: {
			height:'show'
		},
		speed: 'fast'
	}); 

	$("#sidebar li.sidemenu ul li.cat-item a").hover(
		function() {
			$(this).stop().animate({
				marginLeft: "7"
			}, "fast");
		},
		function() {
			$(this).stop().animate({
				marginLeft: "0"
			}, "fast");
		}
	);

	$('#output li a').featureList();
		
	$('.slide-fade').cycle({ 
		fx:     'fade', 
		speed:  500, 
		timeout: 3000, 
		pause: 1
	});
	
	$('.slide-scroll').cycle({ 
		fx:     'scrollHorz', 
		speed:  500, 
		timeout: 3000, 
		pause: 1
	});
	
	$(".toggle-container").hide(); 
	$(".toggle-trigger").click(function(){
		$(this).toggleClass("active").next().slideToggle("slow");
		return false;
	});
	
	$('.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;
	});

	Cufon.replace('.custom, #nav>li>a, .follow-us li, .fancy, #footer ul.footer-cols li.col h6, .page-title, .page-subtitle, .block-title, .link-button, .sub-header, h1, h2, h3 ,h4, h5, h6, #portfolio-filter li, .gallery li em, .meta .day, .meta .month-year, .meta .comments, #posts .post-title, ul.blog-pager a, ul.portfolio-pager a, .comments-header, .portfolio-title, .client-title', { 
		fontFamily: 'bebas-neue',
		hover: true
	});
	
	getTwitters('twitter-holder', {
		id: twitter_user,
		prefix: '',
		clearContents: false,
		count: 5,
		withFriends: true,
		ignoreReplies: false,
		newwindow: true,
		template: '<div class="twitter-entry">"%text%" <span class="twitter-time">%time%</span> </div>'
	});
});

function defaultInput(target){
	if((target).value == 'Buscar...')
		(target).value = ''
}

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

