var anchoPantallas = 760;

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function escribirPie()
{
	document.write('<table width="100%"  border="0">');
	document.write('<tr>');
	document.write('  <td align="center" class="textoPie">(c) Cl&iacute;nica Dental Raul Portes. <img src="imagenes/b.gif" border="0" width="60" height="1"> P&aacute;gina optimizada para Internet Explorer 800x600. <img src="imagenes/b.gif" border="0" width="60" height="1"><a href="http://www.dsa5.com" class="textoPieLink" target="_blank">Web Desarrollada por DSA5</a></td>');
	document.write('</tr>');
	document.write('</table>');
}

function separarVertical(numPixels)
{
	document.write('<table cellpadding=\"0\" cellspacing=\"0\">');
	document.write('  <tr>');
	document.write('    <td><img src=\"' + CKVIR_PathImagen + 'b.gif\" height=\"' + numPixels + '\"/></td>');
	document.write('  </tr>');
	document.write('</table>');
}

function escribirTituloEnlaces()
{
    ancho = anchoPantallas;
	var posUltima = arguments.length - 1;
	if (!isNaN(arguments[arguments.length-1]))
	{
		ancho = arguments[arguments.length - 1];
		posUltima--;
	}

	var lsEnlaces = '';
	var i = 0;
	var sep = "";
	while (i <= posUltima)
	{
		texto = arguments[i++];
		if (i > posUltima)
		{
			hrefIni = "";
			hrefFin = "";
			clase = "tituloActual";
		}
		else
		{
			hrefIni = '<a href="javascript:redirecciona(' + "'" + arguments[i++] + "'" + ');" class="tituloEnlace">';
			hrefFin = '</a>';
			clase = 'tituloEnlace';
		}
		lsEnlaces += sep + '<span class="' + clase + '">' + hrefIni + texto + hrefFin + '</span>';
		sep = '&nbsp;<img src="' + CKVIR_PathImagen + 'flechaTituloSep.gif" border="0" align="absmiddle">&nbsp;';
	}

	document.write('<table cellpadding="0" cellspacing="0" width="' + ancho + '" border="0">');
	document.write('  <tr>');
	document.write('    <td class="tituloEnlace" height="17"><img src="' + CKVIR_PathImagen + 'flechaTitulo.gif" align="absmiddle" border="0">&nbsp;&nbsp;' + lsEnlaces + '</td>');
    if (DSA5GEN_CodUsuario != "")
    {
 	  document.write('    <td align="right" valign="baseline" class="tituloEnlace"><img src="' + CKVIR_PathImagen + 'icoPersonasPeque.gif" border="0">&nbsp;' + DSA5GEN_CodUsuario + '&nbsp;&nbsp;</td>');
    }
	document.write('  </tr>');
	document.write('</table>');
}

function escribirSeccionDatosIni()
{
	document.write('<table cellpadding="0" width="' + anchoPantallas + '" cellspacing="0" border="0">');
	document.write('  <tr>');
	document.write('    <td width="9"><img src="' + CKVIR_PathImagen + 'borDatSupIzq.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borDatSup.gif"></td>');
	document.write('    <td width="9"><img src="' + CKVIR_PathImagen + 'borDatSupDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borDatIzq.gif"></td>');
	document.write('    <td class="fondoDatos">');
}

function escribirSeccionDatosFin()
{
	document.write('    </td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borDatDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td height="5" background="' + CKVIR_PathImagen + 'borDatIzq.gif"></td>');
	document.write('    <td class="fondoDatos"><img src="' + CKVIR_PathImagen + 'b.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borDatDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td><img src="' + CKVIR_PathImagen + 'borDatInfIzq.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borDatInf.gif"></td>');
	document.write('    <td><img src="' + CKVIR_PathImagen + 'borDatInfDer.gif"></td>');
	document.write('  </tr>');
	document.write('</table>');
}

function escribirSeccionFiltroIni()
{
	document.write('<table cellpadding="0" width="' + anchoPantallas + '" cellspacing="0" border="0">');
	document.write('  <tr>');
	document.write('    <td width="9"><img src="' + CKVIR_PathImagen + 'borFilSupIzq.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borFilSup.gif"></td>');
	document.write('    <td width="9"><img src="' + CKVIR_PathImagen + 'borFilSupDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borFilIzq.gif"></td>');
	document.write('    <td class="fondoFiltro">');
}

function escribirSeccionFiltroFin()
{
	document.write('    </td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borFilDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td height="5" background="' + CKVIR_PathImagen + 'borFilIzq.gif"></td>');
	document.write('    <td class="fondoFiltro"><img src="' + CKVIR_PathImagen + 'b.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borFilDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr>');
	document.write('    <td><img src="' + CKVIR_PathImagen + 'borFilInfIzq.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borFilInf.gif"></td>');
	document.write('    <td><img src="' + CKVIR_PathImagen + 'borFilInfDer.gif"></td>');
	document.write('  </tr>');
	document.write('</table>');
}

function escribirSeccionListaIni()
{
	document.write('<table width="' + anchoPantallas + '" cellpadding="0" cellspacing="0" border="0">');
}

function escribirSeccionListaFin()
{
	document.write('</table>');
	escribirSeccionListaIni();
	document.write('  <tr height="9">');
	document.write('    <td width="9" background="' + CKVIR_PathImagen + 'borLisInfIzq.gif"><img src="' + CKVIR_PathImagen + 'b.gif"></td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borLisInf.gif"><img src="' + CKVIR_PathImagen + 'b.gif"></td>');
	document.write('    <td width="9" background="' + CKVIR_PathImagen + 'borLisInfDer.gif"><img src="' + CKVIR_PathImagen + 'b.gif"></td>');
	document.write('  </tr>');
	document.write('</table>');
}

function escribirSeccionMensajeNoHayRegistros(mensaje)
{
	document.write('</table>');
	document.write('<table width="' + anchoPantallas + '" cellpadding="0" cellspacing="0" border="0">');
	document.write('  <tr class="fondoListaImpar">');
	document.write('    <td width="9" background="' + CKVIR_PathImagen + 'borLisIzq.gif"></td>');
	document.write('    <td height="5"><img src="' + CKVIR_PathImagen + 'b.gif"></img></td>');
	document.write('    <td width="9" background="' + CKVIR_PathImagen + 'borLisDer.gif"></td>');
	document.write('  </tr>');
	document.write('  <tr class="fondoListaImpar">');
	document.write('    <td background="' + CKVIR_PathImagen + 'borLisIzq.gif"></td>');
	document.write('    <td align="center">&nbsp;' + mensaje + '</td>');
	document.write('    <td background="' + CKVIR_PathImagen + 'borLisDer.gif"></td>');
	document.write('  </tr>');
}
