﻿// Archivo JScript
function SaltarComentarios(id)
{
    window.location.href="revcms_render.aspx?l_n=noticia&b_p=block_noticia:ct_id:"+id+";#comentarios";
}


// FORMULARIO DE ENVIO DE NOTICIA A UN AMIGO **********************
function MostrarFormularioEnvio()
{
    ScrollTop();
    var obj=document.getElementById("formEnvio");
    
    obj.style.display="block";
}
function OcultarFormularioEnvio()
{
    window.parent.OcultarFormulario();
}

function OcultarFormulario()
{
    var obj=document.getElementById("formEnvio");
    
    obj.style.display="none";
}
// ***************************************************************

function SaltarA(url)
{
    window.location.href=url;
}

function ScrollTop()
{
    window.location.href="#top"
}

function ScrollLogin()
{
    window.location.href="#aLogin"
}

function share(identifier) {
	var shareURL = "";
	var URL = window.document.location.href;

	//se quita la posible # del final
	if (URL.charAt(URL.length-1) == "#")
	{
		URL = URL.substring(0,URL.length-1);
	}
	
	var titleURL = encodeURIComponent(window.document.title);

	if (identifier == 'meneame.net') {
		shareURL = 'http://meneame.net/submit.php?url='+URL;
	} else if (identifier == 'del.icio.us') {
		shareURL = 'http://del.icio.us/post?title='+titleURL+'&url='+URL;
	} else if (identifier == 'digg.com') {
		shareURL = 'http://digg.com/submit?phase=2&url='+URL+'&title='+titleURL;
	} else if (identifier == 'facebook.com') {
		shareURL = 'http://www.facebook.com/sharer.php?u='+URL;
	} else if (identifier == 'yahoo.es') {
		shareURL = 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+URL+'&t='+titleURL;
	} else if (identifier == 'fresqui') {
		shareURL = 'http://tec.fresqui.com/post?url='+URL+'&title='+titleURL;
	} else if (identifier == 'technorati') {
		shareURL = 'http://www.technorati.com/search/'+URL;
	} else if (identifier == 'twitter.com') {
		shareURL = 'http://www.twitter.com/home?status='+URL;
	} else if (identifier == 'buzz') {
		shareURL = 'http://www.google.com/reader/link?url='+URL+'&title='+titleURL;
	}
	   
	   
	if (shareURL != "") {
		window.open(shareURL);
	}
	return false;
}


function ComprobarTamanyMaximo(obj,max)
{
    if(obj.value.length>max){
        obj.value=obj.value.substring(0,max);

    }
}
