function createQuote (id_posts)
{
	jQuery.get("/forums/get-quote",
		{id_posts : id_posts },
		function (data) {
			jQuery('#quote').html(data);
			quote = id_posts;
			jQuery("[name='forums_posts_FK_quote_PK']").val(id_posts);
		}
     );
}

function eraseQuote (id_parent,id_posts)
{
	document.getElementById('quote').innerHTML='';
	$("[name=posts_quote]").val('');
	quote = 0;
}

function logoutMember(){
    $.post("/desconectar",
        function (data) {
           window.location.reload();
        }
    );
}

function refreshLanguage(languageId){
    $.post("/language/index",{language: languageId},
        function (data) {
           window.location.reload();
        }
    );
}

function showBannerszone ( zone )
{
	var zoneId = zone;
	document.write('<span class="bannerszone'+zoneId+'"></span>');
	jQuery('.bannerszone'+zoneId).load("/banners/view/zone/"+zoneId);
}

function bannerClick ( bannerId )
{
	$.post("/banners/clicks-count",{id: bannerId},
        function (data) {
           //window.location.reload();
        }
    );
}

function playMultimedia ( t , url )
{
	var object = '<object type="application/x-shockwave-flash" data="/swf/dewplayer-mini.swf" width="160" height="20" id="hhdirecto" name="hhdirecto">';
		object += '<param name="movie" value="/swf/dewplayer-mini.swf" />';
		object += '<param name="flashvars" value="mp3='+url+'" />';
		object += '<param name="wmode" value="transparent" />';
		object += '<!-- <param value="#336699" name="bgcolor"> -->';
		object += '</object>';
	document.getElementById(t).innerHTML = object;
}

function slideToggle ( id )
{
	if (jQuery("#"+id).css('display')=='none') {
		jQuery("#"+id).slideDown();
	} else {
		jQuery("#"+id).slideUp();
	}
}

function slideToggleClass ( className )
{
	if (jQuery("."+className).css('display')=='none') {
		jQuery("."+className).show(1000);
	} else {
		jQuery("."+className).hide(1000);
	}
}

function frontcover ( frontid, backid )
{
	jQuery("#covers").html('<img src="/multimedia/get-image-gallery/id/'+frontid+'/alc/2/width/400/height/400/force/1" />');
	jQuery("#coverslink").html('<a onclick="backcover(\''+frontid+'\', \''+backid+'\')" href="javascript:;">ver contraportada</a> <span class="icon icon-eye"></span>');
}

function backcover ( frontid, backid )
{
	jQuery("#covers").html('<img src="/multimedia/get-image-gallery/id/'+backid+'/alc/2/width/400/height/400/force/1" />');
	jQuery("#coverslink").html('<a onclick="frontcover(\''+frontid+'\', \''+backid+'\')" href="javascript:;">ver portada</a> <span class="icon icon-eye"></span>');
}

function censoring_comments ( id )
{
	$.post("/comments/censoring",{id: id},
    	function (data) {
    		$('#comments-message-'+id).html('<ul class="errors"><li>Comentario con contenido inapropiado.</li></ul>');
    	}
    );
}

function censoring_posts ( id )
{
	$.post("/forums/censoring/",{id: id},
    	function (data) {
    		$('#posts-body-'+id).html('<ul class="errors"><li>Comentario con contenido inapropiado.</li></ul>');
    	}
    );
}


