function cambiacss(id,propiedad,valor) 
{
	if (propiedad == 'fontSize')
	{
		document.getElementById(id).style.fontSize = valor;
	}
	if (propiedad == 'textAlign')
	{
		document.getElementById(id).style.textAlign = valor;
	}
} 
function anchotabla(id,valor) 
{
	document.getElementById(id).width=valor;
}

function cambiacsshasta(id,propiedad,valor,last) 
{
	cual=0;
	for(i=1;i<=last;i++)
	{
		cual=id+i;
	//	alert(cual);
		if (propiedad == 'fontSize')
		{
			document.getElementById(cual).style.fontSize = valor;
		}
		if (propiedad == 'textAlign')
		{
			document.getElementById(cual).style.textAlign = valor;
		}
	}
} 

function cargarseccion(frame,url){
 if ( frame != "this"){
    eval('parent.' + frame + '.location.href=\'' + url + '\';');
    return;
  }else{
    eval('this.location.href=\'' + url + '\';');
    return;
  }
}

function phptoform(formulario,variable,valor){
  eval('document.forms[\"'+formulario+'\"].'+variable+'.value=\"'+valor +'\";');
  return;
}

function enviarformulario(formulario){
  document.forms[formulario].submit();
  return;
}

function cambiaraction(formulario,action){
  document.forms[formulario].action=action;
  return;
}

function abrirventana(ventana,nombre,opciones){
  if (nombre=='')
  {
    nombre='nueva';
  }
  if (nombre=='duplicacion')
  {
    return;
  }

  if (opciones=='')
  {
 //    sventana= window.open(ventana,nombre,"location=no,menubar=no,resizable=yes,scrollbars=yes,width=800,height=768");
     sventana= window.open(ventana,nombre,"location=no,menubar=no,resizable=yes,scrollbars=yes");
  }
  else
  {
//     sventana= window.open(ventana,nombre,"location=no,menubar=no,resizable=yes,scrollbars=yes,width=800,height=768");
     sventana= window.open(ventana,nombre,"location=yes,menubar=yes,resizable=yes,scrollbars=yes");
  }
}
function abrirventana2(ventana,nombre,opciones){
  if (nombre=='')
  {
    nombre='nueva';
  }
  if (nombre=='duplicacion')
  {
    return;
  }

  if (opciones=='')
  {
     sventana= window.open(ventana,nombre,"location=no,menubar=no,resizable=yes,scrollbars=yes,width=800,height=600");
  }
  else
  {
      sventana= window.open(ventana,nombre,opciones);
  }
}
function abrirventana3(ventana,nombre,ancho,alto)
{
	if (nombre=='')
	{
		nombre='nueva';
	}
	if (nombre=='duplicacion')
	{
		return;
	}

		sventana= window.open(ventana,nombre,"location=no,menubar=no,resizable=yes,scrollbars=yes,width="+ancho+",height="+alto+" ");
}

function posy(e) {
  if (navigator.appName == "Microsoft Internet Explorer"){
     winY = document.body.scrollTop;
  }
  else {
    winY = window.pageYOffset;
  }
  return winY;

}

function maximizaventana()
{
	top.window.moveTo(0,0);
	if (document.all)
	{
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if(document.layers||document.getElementById)
	{
		if(top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
		{
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}



function isdatoonline()
{
	if(top.mihost!='')
	{
		return top.mihost;
	}
	else
	{
		top.mihost='0';
		return '0';
	}
	return '0';
}

function opendatoonline()
{
	if(top.mihost!='')
	{
		abrirventana2(top.mihost+'chatter.php?datousuario='+minick,'chatteresp','width=600,height=400,toolbar=0,status=0,location=0,scrollbars=0,resizable=0,menubar=0');
	}
	else
	{
		top.mihost='0';
	}
	return;
}

function clearField(field,value)
{
	if(value)
	{
		field.defaultValue=value;
		if(field.value==value)
		{
			field.value = '';
		}
	}
	else if(field.value!="")
	{
		field.defaultValue = field.value;
		field.value = '';
	}
}

