/* 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);

			target = target != "target=" ? target : "_blank";
			target = target.replace("target=", "");
			targetpos += 1;
		}
		var opts = xtarget.substr(targetpos);
		fr = document.getElementById('iframe_contenido');
		if(fr) {
			fr.style.display= '';
			document.getElementById('flipbox').style.display='none';
		}
		window.open(xhref, target, opts);
		return false;
	}catch(Exception){
		alert(Exception.description);
		return true;
	}
}
