$(document).ready(function() {
	$(".wpcf7-form input[type=file]").filestyle({ 
     image: "http://www.sologics.ro/wp-content/themes/sologics/img/browse.gif",
     imageheight : 19,
     imagewidth : 62,
     width : 253
	});

	var config = {    
		over: showMenu, 
		timeout: 100,     
		out: hideMenu     
	};
  $('#sub-menu li').hoverIntent( showMenu, hideMenu );
  $('#morevideos li').hoverIntent( showMenu, hideMenu );
  
  $('.projects .more a').click(function (){
  	var id = $(this).attr('rel');
		if(id) {
			id= '#'+id;
			$(id).slideToggle(100);	
			if($(this).hasClass('active')) {
				$(this).removeClass('active');
				$('span', this).html('mehr');
			}
			else {
				$(this).addClass('active');
				$('span', this).html('weniger');
			}
		}
	})
  
	$("#footer .menu .menu-item:last").html($("#footer .menu .menu-item:last").html().replace("</a> |","</a>"));  
  $('a[rel=external]').attr('target', '_blank');
  
  $("#video .swf").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		  : 853,
			'height'		: 505,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'		: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});  
		return false;
	});
	
	$("#interface .face").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'href'			: this.href,			
		});  
		return false;
	});
	
	$("a.fancybox").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		  : 853,
			'height'		: 505,
			'type'			: 'iframe',
			'href'			: this.href,			
		});  
		return false;
	});
	
	$("#interface .info").animate({'opacity':0},0);	
	$("#interface .info").hover(function(){		
		$(this).stop().animate({'opacity':1},300, 'swing');  				
	}, function() {                                            		
		$(this).stop().animate({'opacity':0},300, 'swing'); 
	});
	
	$('#interface .info strong').wraplines();
  
}); 
function showMenu(ev) {
	li = ev.currentTarget;
	if(li.childNodes.length > 1) {
  	$(li.childNodes[0]).addClass('hover');
  	$(li.childNodes[2]).fadeIn(150);
  }
} 
function hideMenu(ev) {
	li = ev.currentTarget;
	if(li.childNodes.length > 1) {
  	$(li.childNodes[0]).removeClass('hover');
  	$(li.childNodes[2]).fadeOut(150);
  }
}    
  
Cufon.replace('#nav h3', { fontFamily: 'MyFont' });              
Cufon.replace('#nav li a', { fontFamily: 'MyFont', hover: true });
Cufon.replace('#page h2', { fontFamily: 'MyFont' });   
     
