$(document).ready(function(){
	var url = "http://localhost/cms/wp/wp-content/themes/puntogeek/";
	var spanAllCorners = '<span class="tlC"></span><span class="trC"></span><span class="blC"></span><span class="brC"></span>';
	var divAllCorners = '<div class="tlC"></div><div class="trC"></div><div class="blC"></div><div class="brC"></div>';
	var divTopCorners = '<div class="tlC"></div><div class="trC"></div>';
	var divBottomCorners = '<div class="blC"></div><div class="brC"></div>';
	var pointer = '<div class="pointer"></div>';
	
	$('.comment-Author a, #trackbacks a, #bottom-PoweredBy a, #bottomInfo p a').each(function(){
		$(this).attr('target', '_blank');
	});	
	
	$('#searchBox input').focus(function(){
		$(this).val('');
	});
	
	$('#recentPosts ul li:last').addClass('last');
	
	$('#topMenu h2 a, #subscribeFieldContainer').each(function(){
		$(this).append(spanAllCorners);
	});
	
	$('.postTitle .thumb, .comment-Text, #twitter-Msg, #sidebar-UltimosComentarios .thumb, #sidebar-EditoresPuntoGeek .thumb').each(function(){
		$(this).append(divAllCorners);
	});
	
	$('.comment-Text, #twitter-Msg').each(function(){
		$(this).append(pointer);
	});
	
	$('#leaveCommentForm-Title').each(function(){
		$(this).append(divTopCorners);
	});
	
	$('#leaveCommentForm form, .sidebar-Box').each(function(){
		$(this).append(divBottomCorners);
	});
	
	$('.postContent blockquote p:last').each(function(){
		$(this).append('url<img src="'+url+'images/icons/quoteEnd.gif" alt"" />');
	});
	
	$('#trackbacks a').each(function(){
		$(this).append('<img src="'+url+'images/icons/externalLink.gif" alt"" />');
	});
		
	$('.toggle').each(function(){
		$(this).attr('href', 'javascript:void(0)');
	});
	
	$('.toggleShow').click(function(){
		var editorPostsUlShow = $(this).parents().filter('span').next('.editorPosts');
		var toggleHide = $(this).parents().filter('.thumbText').find('.toggleHide');
		$(editorPostsUlShow).slideDown('slow');
		$(this).hide();
		$(toggleHide).show();
	});
	
	$('.toggleHide').click(function(){
		var editorPostsUlHide = $(this).parents().filter('.editorPosts');
		var toggleShow = $(this).parents().filter('.thumbText').find('.toggleShow');
		$(editorPostsUlHide).slideUp('slow');
		$(this).hide();
		$(toggleShow).show();
	});
});