//Para validación
function Blancos(Cadena){
	if (Cadena.split(" ").join("").length == 0)
		return true;
	else
		return false;
}

//General
function nuevoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

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);
	}
	
	URL = escape(URL);
	var titleURL = encodeURIComponent(window.document.title);
	var resumenURL = encodeURIComponent($(".ab_resumen").html());

	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?t='+resumenURL+'&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/';
	} else if (identifier == 'blogger.com') {
		shareURL = 'http://www.blogger.com/blog_this.pyra?t='+resumenURL+'&u='+URL+'&n='+titleURL;
	}
	
	if (shareURL != "") {
		window.open(shareURL);
	}
	return false;
}