$(function()
{	
	$('ul.menu li a').not('.select').hover(
		function(){
			$(this).animate({opacity:0.5},100);
		},
		function(){
			$(this).animate({opacity:1},100);
		});
		
	$('ul.menu li a').click(function(){
		var n = $(this).parent().find('.subnav');
		if (n.length == 0) {
			return true;
		}
		else {
			$(this).blur();
			if (!n.is(':visible')) {
				$('.subnav').hide();
				n.fadeIn();
				return false;	
			}
			else {
				return true;
			}
			
		}
	});
		
	$('.vimeoswf').each(function()
		{
			var id = this.id;
			var url= "http://vimeo.com/moogaloop.swf?";
			url = url + "clip%5Fid=" + id + "&";
			url = url + "server=vimeo%2Ecom&";
			url = url + "autoplay=0&";
			url = url + "fullscreen=1&";
			url = url + "md5=0&";
			url = url + "show%5Fportrait=0&";
			url = url + "show%5Ftitle=0&";
			url = url + "show%5Fbyline=0&";
			url = url + "context=user%3A434740&";
			url = url + "context%5Fid=&";
			url = url + "force%5Fembed=0&";
			url = url + "multimoog=&";
			url = url + "color=ffffff";
			swfobject.embedSWF(url, this.id, "600", "330", "9.0.0","false", {}, {wmode: "transparent"}, {});
		});
		
	$('.youtubeswf').each(function()
	{
		var id = this.id;
		var url= "http://www.youtube.com/v/";
		url = url + id + "&hl=es&fs=1&showinfo=0&egm=0&rel=0";
		swfobject.embedSWF(url, this.id, "600", "330", "9.0.0","false", {}, {wmode: "transparent"}, {});
	});
	
	$('.flvswf').each(function()
	{
		var url= "/media/swf/common/jcplayer.swf?";
		url += "videoURL="+this.id+".flv" + 
			   "&startPhotoSource="+this.id+".jpg" + 
			   "&autoPlay=false&scaleMode=maintainAspectRatio&loop=false&backgroundColor1=0xffffff&backgroundColor2=0x444444&" + 
			   "movieBackgroundColor=0x000000&inkColor=0x000000&highlightColor=0x3399cc&playButoon=true&seekBar=true&timeBar=true&" + 
			   "volumeButton=true&fullScreenButton=true&autoHide=false&autoHideFullScreen=true&offsetY=0&offsetYFullScreen=25&margins=0&" + 
			   "marginsFullScreen=0&volume=70&bufferTime=1&smoothing=false"
		swfobject.embedSWF(url, this.id, "600", "330", "10.0.0","false", {}, {wmode: "transparent"}, {});
	});
	
	
	$('.menu a.main').hover(
		function(){
			var t = this;
			$('.subnav').hide(250,function(){
				$(t).next('.subnav').show(250);
			});
		},
		function(){});
});



$(function(){
	$('#lminipost li .minipost').hover(
		function(e){
			var t = this
			//$('#lminipost li h2').parent().find('h2').stop().animate( {bottom:(-100)+'px' } );
			
			$(this).parent().find('img.bgImage').stop().animate({opacity:0},300);
			
			$(t).find('h2').stop().animate( {bottom:-50 } );
			
			
		},
		function(e){
			$(this).parent().find('img.bgImage').stop().animate({opacity:1},300);
			$(this).find('h2').stop().animate( { bottom:0 } );
		});
	
	$('a[rel=external]').attr("target", "_blank")
});
