
$(function(){

		$('#search input').each(function(){
			var nm = $(this).val();
			$(this).attr('def',nm);
		}).focus(function(){
			if($(this).val() == $(this).attr('def')){
				$(this).val('');
			}
		}).blur(function(){
			if(!$(this).val()){
				var nm = $(this).attr('def');
				$(this).val(nm);
			}
		});
		
		$('#search a').click(function(){
			$(this).parents('form:first').submit();
			return false
		});
			
		$('#submenu a:not(".active")').mousedown(function(){$(this).addClass('down')}).mouseup(function(){$(this).removeClass('down')}).mouseout(function(){$(this).removeClass('down')});
	
		$('div.tweet').each(function(){
			//if($(this).next().is('img')){$(this).css('visibility','visible').css('position','static').next().next().prepend($(this))}
			//else{
			//	if($(this).next().is('p') && $(this).next().find('img').size()>0){$(this).css('visibility','visible').css('position','static').next().next().prepend($(this))}
			//}
			if($(this).next().is('img')){$(this).next().insertBefore($(this));$(this).css('visibility','visible').css('position','relative').css('top','14px')}
			else{
				if($(this).next().is('p') && $(this).next().find('img').size()>0){$(this).next().insertBefore($(this));$(this).css('visibility','visible').css('position','relative')}
			}
		});

});


