
function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      } 
   }
   return "";
}

function abrir (pag, nombre, w, h)
{
	posleft = (screen.availWidth / 2) - (w / 2);
	postop = (screen.availHeight / 2) - (h / 2);
	remote = window.open(pag,nombre);

//	remote = window.open('', 'BIWE','width=400,height=115,resizable=1', 'toolbar=yes');
	if (remote != null) {
	    if (remote.opener == null) 
		  remote.opener = self;
	    else		
	          remote.opener = window.parent;
//        remote.location.href = pag;
	}

}

function abrirPreEx(f)
{
	abrir ("http://www.chatear.com/inc/vacio.php", "chatearcom", 636, 395);
	f.target = "chatearcom";
	f.method = "GET";
	f.action = "http://www.chatear.com/prechat.php";
	f.submit();
}

function abrirPre(canal)
{
	//alert('hola');
	abrir ("http://www.chatear.com/chat_web.php?nc=Admin&n=" + "d" + "&p=" + "" + "&c=" + canal, "chat", 1024, 768);
}

function abrirParaChat(nombre, clave, canal)
{
	abrir ("http://www.chatear.com/chat_web.php?nc=Admin&n=" + "d" + "&p=" + "" + "&c=" + canal, "chat", 1024, 768);
}

function abrirChatEx(f)
{
	abrir ("http://www.chatear.com/inc/vacio.php", "chatearcom", 636, 395);
	f.target = "chatearcom";
	f.method = "GET";
	f.action = "http://www.chatear.com/chat_web.php";
	f.submit;
}
