				var linea='c';
				var linea_old='z';
				var base_linea_old='z';


				function cambiaColor(id, src, color)
				{
				document.all[id].bgColor = color;
				src.style.cursor="hand";
				}

				function cambiaColor3(color) {
				if (linea_old!='z') {
				document.all[linea_old].bgColor = color;
				document.all[base_linea_old].bgColor = '#C0C0C0';
				}
				}



				function cambiaColor2(id, t, src, color1, color2) {

				if (id==linea) {
				document.all[id].bgColor = color2;
				//document.all[t].bgColor =  '#C0C0C0';
				}
				else {
				document.all[id].bgColor = color1;
				//document.all[t].bgColor =   '#C0C0C0';
				}

				src.style.cursor="hand";
				}
				
function valFormusuaris2() {
if (document.MyForm.p_username.value =='' ) {
alert ("Introduzca el nombre de usuario.");
return false;
}
else if (document.MyForm.p_clau.value =='' ) {
alert ("Introduzca el password.");
return false;
}
else if (document.MyForm.p_name.value =='' ) {
alert ("Introduzca el nombre de la persona de contacto.");
return false;
}
else if (document.MyForm.p_cognom.value =='' ) {
alert ("Introduzca los apellidos de la persona de contacto.");
return false;
}
else if (document.MyForm.p_tel.value =='' ) {
alert ("Introduzca el teléfono de la persona de contacto.");
return false;
}
else if (document.MyForm.p_mail.value =='' ) {
alert ("Introduzca el e-mail de contacto (Aquí se enviará el recordatorio de los datos).");
return false;
}
else {

return true;
}
}

function valFormServs() {
if (document.form1.p_des.value =='' ) {
alert ("Introduzca el nombre del servicio.");
return false;
}
else if (document.form1.p_link.value =='' ) {
alert ("Introduzca el enlace del servicio (p. ej. /visualweb/basquet/equips.asp).");
return false;
}
else if (document.form1.p_link2.value =='' ) {
alert ("Introduzca el enlace del servicio (p. ej. /visualweb/basquet/index.asp).");
return false;
}
else {
return true;
}
}


function valFormEquipos() {
if (document.form1.p_des.value =='' ) {
alert ("Introduzca el nombre del equipo.");
return false;
}
else {
return true;
}
}

function valFormPartidos() {
if (document.calData.salida.value =='' ) {
alert ("Introduzca la fecha del partido.");
return false;
}
else if (document.calData.p_a.value =='0' ) {
alert ("Seleccione el equipo 1 (local).");
return false;
}
else if (document.calData.p_b.value =='0' ) {
alert ("Seleccione el equipo 2 (visitante).");
return false;
}
else if (document.calData.p_a.value == document.calData.p_b.value) {
alert ("Un equipo no puede jugar contra él mismo.");
return false;
}
else {
return true;
}
}

function valFormLigas() {
if (document.form1.p_des.value =='' ) {
alert ("Introduzca el nombre o descripción de la liga.");
return false;
}
else if (document.form1.temp.value < 1 ) {
alert ("Seleccione la temporada.");
return false;
}
else {
return true;
}
}


function valFormLiga() {
if (document.form1.p_des.value =='' ) {
alert ("Introduzca el nombre o descripción de la liga.");
return false;
}
else {
return true;
}
}


function valFormusuaris() {
var countChecked = 0;
for(i=0;i<document.MyForm.p_idiomas.length;i++) {
if(document.MyForm.p_idiomas[i].checked==true)
{ countChecked++; }
	}
if (document.MyForm.p_emp.value =='' ) {
alert ("Introduzca el directorio de la web.");
return false;
}
else if (document.MyForm.p_Nomemp.value =='' ) {
alert ("Introduzca el nombre de la empresa.");
return false;
}
else if (document.MyForm.p_username.value =='' ) {
alert ("Introduzca el nombre de usuario.");
return false;
}
else if (document.MyForm.p_clau.value =='' ) {
alert ("Introduzca el password.");
return false;
}
else if (document.MyForm.p_source.value =='' ) {
alert ("Introduzca el source.");
return false;
}
else if (document.MyForm.p_gral.value =='' ) {
alert ("Si no se activa la casilla Acceso gral., este usuario no tendrá acceso.");
return false;
}
else if (document.MyForm.p_ok.value =='' ) {
alert ("Si no se activa la casilla Visualweb, este usuario no tendrá acceso.");
return false;
}
else if (document.MyForm.p_name.value =='' ) {
alert ("Introduzca el nombre de la persona de contacto.");
return false;
}
else if (document.MyForm.p_cognom.value =='' ) {
alert ("Introduzca los apellidos de la persona de contacto.");
return false;
}
else if (document.MyForm.p_tel.value =='' ) {
alert ("Introduzca el teléfono de la persona de contacto.");
return false;
}
else if (document.MyForm.p_mail.value =='' ) {
alert ("Introduzca el e-mail de contacto (Aquí se enviará el recordatorio de los datos).");
return false;
}
else if (countChecked==0 ) {
alert ("Seleccione al menos un idioma");
return false;
}
else {

return true;
}
}


function valFormusuaris1() {
var countChecked = 0;
for(i=0;i<document.MyForm.p_idiomas.length;i++) {
if(document.MyForm.p_idiomas[i].checked==true)
{ countChecked++; }
	}
if (document.MyForm.p_Nomemp.value =='' ) {
alert ("Introduzca el titulo de la web.");
return false;
}
else if (document.MyForm.p_username.value =='' ) {
alert ("Introduzca el nombre de usuario.");
return false;
}
else if (document.MyForm.p_clau.value =='' ) {
alert ("Introduzca el password.");
return false;
}
else if (document.MyForm.p_name.value =='' ) {
alert ("Introduzca el nombre de la persona de contacto.");
return false;
}
else if (document.MyForm.p_cognom.value =='' ) {
alert ("Introduzca los apellidos de la persona de contacto.");
return false;
}
else if (document.MyForm.p_tel.value =='' ) {
alert ("Introduzca el teléfono de la persona de contacto.");
return false;
}
else if (document.MyForm.p_mail.value =='' ) {
alert ("Introduzca el e-mail de contacto (A esta dirección se enviará el recordatorio de los datos).");
return false;
}
else if (countChecked==0 ) {
alert ("Seleccione al menos un idioma");
return false;
}
else {

return true;
}
}


function ValWebDatos() {
if (document.MyForm.tit.value =='' ) {
alert ("Introduzca el título de la web.");
return false;
}
else if (document.MyForm.slo.value =='' ) {
alert ("Introduzca el subtítulo o slogan de la web.\nPuede introducir un espacio en blanco si lo desea.");
return false;
}
//else if (document.MyForm.pie.value =='' ) {
//alert ("Introduzca el texto que aparecerá al pié de las páginas.");
//return false;
//}
else {
//return checkRadios();
return true;
}
}

function ValJug1() {
if (document.MyForm.id_jug.value =='' ) {
alert ("Selecciona un jugador");
return false;
}
else {
return true;
}
}



function ValEnt1() {
if (document.MyForm.id_ent.value =='' ) {
alert ("Selecciona un entrenador");
return false;
}
else {
return true;
}
}



function confirma_borrar0(msg,url) {
if (confirm(msg)) {
ventana0(url);
}  
}


function ventana0(myurl) {
var w = 0
var h = 0
var winleft = screen.width;
var wint = screen.height;
var props = 'height='+h+',width='+w+',top='+wint+',left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "aa2", props);
newWindow2.window.focus();
}


function ventana2(myurl) {
var w = 500
var h = 200
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b2", props);
newWindow2.window.focus();
}

function ventana3(myurl) {
var w = 500
var h = 300
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=yes, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b3", props);
newWindow2.window.focus();
}

function ventana3B(myurl) {
var w = 650
var h = 410
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b3b", props);
newWindow2.window.focus();
}


function ventana4(myurl) {
var w = 500
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b4", props);
newWindow2.window.focus();
}

function ventana4b(myurl) {
var w = 500
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b4b", props);
newWindow2.window.focus();
}

function ventana5(myurl) {
var w = 550
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5", props);
newWindow2.window.focus();
}

function ventana5sc(myurl) {
var w = 550
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=60,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5", props);
newWindow2.window.focus();
}


function ventana5PRO(myurl) {
var w = 780
var h = 600
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b5pro", props);
newWindow2.window.focus();
}

function ventana5PRO(myurl) {
window.location=(myurl);
}

function ventana6(myurl) {
var w = 640
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=120,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b6", props);
newWindow2.window.focus();
}


function confirma_borrar(msg,url) {
if (confirm(msg)) {
window.location = (url);
}  
}

	function cambiaBandera() {
	document.flag.src='/images/'+document.MyForm.p_idioma.value+'a.gif';
	}
	
function changeBox(cbox) {
box = eval(cbox);
box.checked = !box.checked;
}

function mostrar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="visible"; 
} 
function ocultar(nombreCapa){ 
document.getElementById(nombreCapa).style.visibility="hidden"; 
} 


function getOffsetLeft (el) {
    var ol = el.offsetLeft;
    while ((el = el.offsetParent) != null)
        ol += el.offsetLeft;
    return ol;
}

function getOffsetTop (el) {
    var ot = el.offsetTop;
    while((el = el.offsetParent) != null)
        ot += el.offsetTop;
    return ot;
}

function ocultarTodo() {
var caps=document.getElementsByTagName("div");
//alert(caps.length);
for (xp=0; xp < caps.length; xp++) {
var capaANT = caps[xp].id;
if (capaANT!=''){
ocultar(capaANT);
}
}
}

var ppcIE=((navigator.appName == "Microsoft Internet Explorer") || ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5)));
var ppcNN6=((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)==5));
var ppcNN=((navigator.appName == "Netscape")&&(document.layers));

function showMini(btnImg,capa) {
//ocultar capa anterior
ocultarTodo();

        if ( ppcIE ) {
            ppcX = getOffsetLeft(document.images[btnImg]) - 396;    
            ppcY = getOffsetTop(document.images[btnImg]) + document.images[btnImg].height + 8;
        }
        else if (ppcNN){
            ppcX = document.images[btnImg].x; 
            ppcY = document.images[btnImg].y + document.images[btnImg].height;
            
        }
domlay(capa,1,ppcX,ppcY);       

}




function domlay(id,trigger,lax,lay) {
    if (trigger=="1"){
        if (document.layers) document.layers[''+id+''].visibility = "show"
        else if (document.all) document.all[''+id+''].style.visibility = "visible"
        else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"

        }
    // Layer hidden
    else if (trigger=="0"){
        if (document.layers) document.layers[''+id+''].visibility = "hide"
        else if (document.all) document.all[''+id+''].style.visibility = "hidden"
        else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"             
        }
    // Set horizontal position  
    if (lax){
        if (document.layers){document.layers[''+id+''].left = lax}
        else if (document.all){document.all[''+id+''].style.left=lax}
        else if (document.getElementById){document.getElementById(''+id+'').style.left=lax+"px"}
        }
    // Set vertical position
    if (lay){
        if (document.layers){document.layers[''+id+''].top = lay}
        else if (document.all){document.all[''+id+''].style.top=lay}
        else if (document.getElementById){document.getElementById(''+id+'').style.top=lay+"px"}
        }
    // change content


}

function recibo(url) {
popupWin = window.open(url,'','width=640,height=360,left=20,top=40')
}
