/* Función para apertura en ventana emergente */

function OpenWindow(linkobj){
	try{
		var xtarget = new String(linkobj.getAttribute("xtarget"));

		if(xtarget == "")
			return true;
		var xhref = new String(linkobj.getAttribute("xhref"));
		var target = linkobj.href;
		var targetpos = xtarget.indexOf("target");
		if(targetpos > -1) {
			targetpos = xtarget.indexOf(",", targetpos);

			if(targetpos > -1)
				target = xtarget.substr(0, targetpos);
			else
				target = xtarget.substr(0);

			if(target == "target=contenido")
				return true;
			
			target = target != "target=" ? target : "_blank";
			target = target.replace("target=", "");
			targetpos += 1;
		}
		var opts = xtarget.substr(targetpos);
		window.open(xhref, target, opts);
		return false;
	}catch(Exception){
		alert(Exception.description);
		return true;
	}
}