	nAlto_inicial=0
	function FNpopup(p_url,p_id,p_ancho,p_alto,p_carac){
		car="width="+p_ancho+",height="+p_alto+",left="+((screen.width/2)-(parseInt(p_ancho)/2))+",top="+((screen.height/2)-(parseInt(p_ancho)/2))+","+p_carac
		window.open(p_url,p_id,car)
	}
	
// Funciones para que los botones se iluminen al pasar el ratón por encima
function goLite(FRM,BTN)
{
   window.document.forms[FRM].elements[BTN].style.color = "#FFFFFF";
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "#FF6633";
}

function goDim(FRM,BTN)
{
   window.document.forms[FRM].elements[BTN].style.color = "#FF6633";
   window.document.forms[FRM].elements[BTN].style.backgroundColor = "transparent";
}


/* Cierra un ticket. En "backpage" se especifica la página a la que tiene que volver (opentickets o alltickets) y
   si se especifica un showticket (el id)  entonces abre la página del ticket que acabamos de cerrar */
   
function confirmCloseTicket(id, backpage, ticket, texto,fin_http) {
    if (confirm (texto)) {
		window.location.href = "docloseticket.php?ticket="+id+"&costumertab="+backpage+"&showticket="+ticket+fin_http;
    }
}



function openNewTicketWindow(id, name, account_id, account_name,fin_http) {
	leftVal = (screen.width - 500) / 2;
	topVal = (screen.height - 330) / 2;

	openwindow_conf = 'width=500,height=330,scrollbars=0,resizable=0,menubar=0,directories=0,status=0,toolbar=0, left='+leftVal+',top='+topVal;
	window.open('newticket.php?site_id='+id+'&site_name='+name+'&account_id='+account_id+'&account_name='+account_name+fin_http,
				'', openwindow_conf);
}

/*Nueva función para tickets internos y que no cargue formulario */
function openNewInternalTicketWindow(id, name, account_id, account_name,fin_http) {
	leftVal = (screen.width - 500) / 2;
	topVal = (screen.height - 330) / 2;

	openwindow_conf = 'width=500,height=330,scrollbars=0,resizable=0,menubar=0,directories=0,status=0,toolbar=0, left='+leftVal+',top='+topVal;
	window.open('newinternalticket.php?site_id='+id+'&site_name='+name+'&account_id='+account_id+'&account_name='+account_name+fin_http,
				'', openwindow_conf);
}


function openNewNoteWindow(ticket_id, ticket_name, reload,fin_http) {
	leftVal = (screen.width - 500) / 2;
	topVal = (screen.height - 375) / 2;

	openwindow_conf = 'width=500,height=375,scrollbars=0,resizable=0,menubar=0,directories=0,status=0,toolbar=0, left='+leftVal+',top='+topVal;
	window.open('newnote.php?ticket_id='+ticket_id+'&ticket_name='+ticket_name+'&reload='+reload+fin_http,'', openwindow_conf);
}

function openEditContactWindow(fin_http) {
	leftVal = (screen.width - 500) / 2;
	topVal = (screen.height - 280) / 2;

	openwindow_conf = 'width=500,height=280,scrollbars=0,resizable=0,menubar=0,directories=0,status=0,toolbar=0, left='+leftVal+',top='+topVal;
	window.open('editcontact.php?'+fin_http,'', openwindow_conf);
}

function openSiteDetailsWindow(id, fin_http) {
	leftVal = (screen.width - 500) / 2;
	topVal = (screen.height - 310) / 2;

	openwindow_conf = 'width=500,height=310,scrollbars=0,resizable=0,menubar=0,directories=0,status=0,toolbar=0, left='+leftVal+',top='+topVal;
	window.open('sitedetail.php?id='+id+fin_http,'', openwindow_conf);
}
function EliminarTildes(cadena) {
		cadena = cadena.replace(/á/,"a");
		cadena = cadena.replace(/é/,"e");
		cadena = cadena.replace(/í/,"i");
		cadena = cadena.replace(/ó/,"o");
		cadena = cadena.replace(/ú/,"u");

		cadena = cadena.replace(/Á/,"A");
		cadena = cadena.replace(/É/,"E");
		cadena = cadena.replace(/Í/,"I");
		cadena = cadena.replace(/Ó/,"O");
		cadena = cadena.replace(/Ú/,"U");

		cadena = cadena.replace(/ñ/,"%CD");

		return cadena;
}