


	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 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 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 valFormServs() {
if (document.form1.tit.value =='' ) {
alert ("Introduzca el nombre del servicio.");
return false;
}
else if (document.form1.slo.value =='' ) {
alert ("Introduzca el enlace del servicio (p. ej. /visualweb/basquet/equips.asp).");
return false;
}
else if (document.form1.pie.value =='' ) {
alert ("Introduzca el enlace del servicio (p. ej. /visualweb/basquet/index.asp).");
return false;
}
else {
return true;
}
}



function ventana2(myurl) {
var w = 450
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 = 450
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=no, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b3", props);
newWindow2.window.focus();
}

function ventana4(myurl) {
var w = 450
var h = 400
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, "b4", props);
newWindow2.window.focus();
}

function ventana4b(myurl) {
var w = 450
var h = 500
var winleft = (screen.width-w) / 2-10;
var wint = (screen.height-h) / 2;
var props = 'height='+h+',width='+w+',top=20,left='+winleft+',scrollbars=yes, resizable=no, status=no'
var newWindow2;
newWindow2 = window.open(myurl, "b4", 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=120,left='+winleft+',scrollbars=no, 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, "b5", props);
newWindow2.window.focus();
}

function calcular2(f1,f2,nomCamp, max){
	ncaracteres=f1.value.length;
	if (!(ncaracteres > 0)) ncaracteres=0;
	f2.value=ncaracteres;
if (f1.value.length>max){
alert ("No pueden escribir más de "+max+" caracteres en el campo "+nomCamp)
return false;
}
}

function confirma_borrar(msg,url) {
if (confirm(msg)) {
window.location = (url);
}  
}

function avisar() {
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
url="avisar.asp?sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedpublicarAVISAR
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChangedpublicarAVISAR() { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
//alert (xmlHttp.responseText )
} 
} 




function cambiardatos(url) {
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChangedpublicar 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChangedpublicar() { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
//alert ("Canvis fets!")
} 
} 




function isEmpty(s) {
	return ((s == null) || (s.length == 0));
}

function isDigit(c)
{
	return ((c >=0) && (c <=9));
}

function isInteger (s)
{
	if (isEmpty(s.value)) return false;
	for (var i = 0; i < s.value.length; i++)
		if (!isDigit(s.value.charAt(i))) return false;
	return true;
}

function isFloat(s)
{
	if (isEmpty(s.value))return false;
	if (isNaN(parseFloat(s.value))) return false;
	return true;
}


function isDecimalComa(s)
{
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (c==".") return false;
	}
	data = s.split(",");
	if (data.length > 2) return false;
	parteEntera = data[0];
	if (isEmpty(parteEntera)) return false;
	for (i = 0; i < parteEntera.length; i++)
	{
		var c = parteEntera.charAt(i);
		if (!isDigit(c)) return false;
	}
	if (data.length > 1)
	{
		parteDecimal = data[1];
		if(parteDecimal.length > 2) //numero de decimales
			//return false;
		if (isEmpty(parteDecimal)) return false;
		for (i = 0; i < parteDecimal.length; i++)
		{
			var c = parteDecimal.charAt(i);
			if (!isDigit(c)) return false;
		}
	}
	return true;
}
