var indice=0;

function setColor(objName, fg, bg)
{
  obj = findObj(objName);
  if (obj.style)
  {
    obj.style.color = fg;
    obj.style.backgroundColor = bg;
  }
}

function setTextoColor(objName, fg)
{
		alert('OO');
  obj = findObj(objName);
  if (obj.style)
    obj.style.color = fg;
}

function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}

function SetFrame(Name, Url)
{
	var frame;
	if (document.all)
		frame = frames[Name].document;
	else
		frame = document.getElementById(Name).document;
	frame.location.href = Url;
}

function Navegar(Name, Url, tIndice)
{
	indice = tIndice;
	var frame;
	if (document.all)
		frame = frames[Name].document;
	else
		frame = document.getElementById(Name).document;
	frame.location.href = Url+'indice='+indice;
}

function PopUp(Url, Name, Params)
{
	window.open(Url, Name, Params);
}

// Example:
// simplePreload( '01.gif', '02.gif' ); 
function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function __ocultar_mostrar(seccion)
{
	if(document.getElementById(seccion).style.display == "none")
	{document.getElementById(seccion).style.display="inline";}
	else
	{document.getElementById(seccion).style.display="none";}
}

function ocultar_mostrar(seccion, imagen)
{
	if(document.getElementById(seccion).style.display == "none")
	{
		document.getElementById(seccion).style.display="inline";
		switchImage(imagen, 'imagenes/escritura_007_flechasubtitul_invert.jpg');
	}
	else
	{
		document.getElementById(seccion).style.display="none";
		switchImage(imagen, 'imagenes/escritura_007_flechasubtitul.jpg');
	}
}
function pintar(n,color){
	var f = document.all('f'+n);
	f.style.backgroundColor=color;
}
function	despintar(n,color){
	var f = document.all('f'+n);
	f.style.backgroundColor=color;
}

function isObject(a) 
 {
     return (typeof a == 'object' && !!a) || isFunction(a);
 }
function isUndefined(a) 
 {
     return typeof a == 'undefined';
 } 
function isFunction(a) 
 {
      return typeof a == 'function';
 }
 
function InCutMail(idtd)
{
var mailcut=document.getElementById(idtd);
var fragmentos=mailcut.childNodes[0].nodeValue.split('\n');

mailcut.childNodes[0].nodeValue+=mailcut.childNodes[2].nodeValue;
mailcut.childNodes[2].nodeValue='';
}