function getArgs() {
   var args = new Object();
   var query = location.search.substring(1);
   var pairs = query.split("&");

   for (var i = 0; i < pairs.length; i++) {
      var pos = pairs[i].indexOf('=');
      if (pos == -1) continue;
      var argname = pairs[i].substring(0,pos);
      var value = pairs[i].substring(pos + 1);
      value = decodeURIComponent(value);
      args[argname] = value;
   }
   return args;
}

function replaceAll(Source,stringToFind,stringToReplace) {
  var temp = Source;
  var index = temp.indexOf(stringToFind);
  while(index != -1) {
    temp = temp.replace(stringToFind,stringToReplace);
    index = temp.indexOf(stringToFind);
  }
  return temp;
}

function capturaEvento(evento){
  var iAscii = "";
  if (evento.keyCode) iAscii = evento.keyCode;
  else if (evento.which) iAscii = evento.which;
  if (iAscii == 13) buscar();
}

function buscar() {
  var cad = document.getElementById("inp_buscar").value;
  if (cad.length > 0) {
    document.location.href = "http://www.google.es/search?as_q=" + replaceAll(cad," ","+") + "&as_sitesearch=vsoledadguada.es";
  }
}

function gFoco(obj) {
   if (obj.value == "en vsoledadguada.es") obj.value = "";
   obj.style.color = "#000000";
}

function dFoco(obj) {
   if (obj.value == "") obj.value = "en vsoledadguada.es";
   obj.style.color = "#666666";
}

function montar_superior(sitios,nombre) {
  document.write ('<table id="superior" width="100%" cellpadding="0px" cellspacing="0px">');
  if (sitios == "") {
    document.write ('<tr><td width="140px"><IMG src=".\/imagenes\/esquina2.jpg"><\/td>');
    document.write ('<td width="98%" style="background-color:#c497ff;padding-top:3px;border-top:1px #dddddd solid;">');
    document.write ('<i>Fundada el 7 de Octubre de 1.469 en la ciudad de Guadalajara, España<\/i><\/td>');
  } else {
    document.write ('<tr><td width="140px"><IMG src=".\/imagenes\/esquina.jpg"><\/td>');
    document.write ('<td width="98%" style="background-color:#c497ff;padding-top:3px;border-top:1px #dddddd solid;">');
    document.write ('<B>&nbsp;Est&aacute;s en:&nbsp;&nbsp;');
    if (sitios != "") document.write (sitios + '&nbsp;');
    document.write ('<span style="color:#400000;">' + nombre + '<\/span><\/B><\/td>');
  }
  document.write ('<td width="1%" nowrap style="text-align:right;background-color:#c497ff;border-top:1px #dddddd solid;">');
  document.write ('<a href="javascript:buscar();">Buscar<\/a>&nbsp;<\/td>');
  document.write ('<td width="1%" nowrap style="text-align:right;background-color:#c497ff;border-top:1px #dddddd solid;">');
  document.write ('<input id="inp_buscar" name="inp_buscar" class="input2" type="text" size="20" maxLength="128"');
  document.write (' onkeypress="capturaEvento(event);" onFocus="gFoco(this);" onBlur="dFoco(this);" value="en vsoledadguada.es">');
  document.write ('<\/td><td width="1%" nowrap style="text-align:right;background-color:#c497ff;border-top:1px #dddddd solid;">');
  document.write ('<a href="javascript:buscar();"><img src=".\/imagenes\/google.gif" alt="Buscar con Google"><\/a><\/td>');
  document.write ('<\/tr><\/table>');
}

function montar_menus() {
  document.write('<div id="menus" class="div_mizq">');
  document.write('<UL>');
  document.write('<LI><a href=".\/bienvenida.html" class="a_menu">Bienvenida<\/a><\/LI>');
  document.write('<LI><a href=".\/historia.html" class="a_menu">Historia<\/a><\/LI>');
  document.write('<LI><a href=".\/sede.html" class="a_menu">Sede<\/a><\/LI>');
  document.write('<LI><a href=".\/galeria.html" class="a_menu">Galería<\/a><\/LI>');
  document.write('<LI><a href=".\/estatutos.html" class="a_menu">Estatutos<\/a><\/LI>');
  document.write('<LI><a href=".\/semsanta.html" class="a_menu">Semana Santa<\/a><\/LI>');
  document.write('<LI><a href=".\/cargadores.html" class="a_menu">Cargadores<\/a><\/LI>');
  document.write('<LI><a href=".\/camareras.html" class="a_menu">Camareras<\/a><\/LI>');
  document.write('<LI><a href=".\/tienda.html" class="a_menu">Tienda<\/a><\/LI>');
  document.write('<LI><a href=".\/noticias.html" class="a_menu">Noticias<\/a><\/LI>');
  document.write('<LI><a href=".\/enlaces.html" class="a_menu">Enlaces<\/a><\/LI>');
  document.write('<LI><a href=".\/contacto.html" class="a_menu">Contacto<\/a><\/LI>');
  document.write('<\/UL><\/div>');
}

function montar_enlaces() {
  document.write('<div style="padding-left:5px"><hr></div>');
  document.write('<table width="100%" cellpadding="0" cellspacing="0">');
  document.write('<tr><td class="td_izq" width="1%"><a target="_blank" href="http:\/\/www.guadalajara.es\/recursos\/doc\/Fiestas\/SemanaSanta\/1086_74742011133723.pdf">');
  document.write('<img src=".\/imagenes\/sem2011.jpg" height="70px" style="border:1px solid #333333" alt="Programa Semana Santa 2011"><\/a><\/td>');
  document.write('<td class="td_cen" width="17%" align="left" valign="bottom" style="text-align:justify">');
  document.write('<img src=".\/imagenes\/flecha4.gif" alt="">Click para descargar el programa de Semana Santa 2011');
  document.write(' publicado por el Ayuntamiento de Guadalajara (pdf)<\/td>');
  document.write('<td class="td_izq" width="1%"><a target="_blank" href="http:\/\/www.aemet.es\/es\/eltiempo\/prediccion\/localidades\/guadalajara-19001">');
  document.write('<img src=".\/imagenes\/aemet.gif" height="70px" style="border:1px solid #333333" alt="El tiempo en Guadalajara"><\/a><\/td>');
  document.write('<td class="td_izq" width="1%"><a target="_blank" href="http:\/\/guadalajara.isig.es\/\/guada2008\/">');
  document.write('<img src=".\/imagenes\/callejero.jpg" height="70px" style="border:1px solid #333333" alt="Callejero de Guadalajara"><\/a><\/td>');
  document.write('<td class="td_cen" width="1%"><a target="_blank" href="http:\/\/www.guadalajara.es\/es\/index.asp?MP=57&MS=596&MN=2">');
  document.write('<img src=".\/imagenes\/500ani.png" height="70px" style="border:1px solid #333333" alt="550 aniversario de la Ciudad de Guadalajara"><\/a><\/td>');
  document.write('<\/tr><\/table>');
  document.write('<div style="padding-left:5px"><hr></div>');
  document.write('<table width="100%" cellpadding="0" cellspacing="0">');
  document.write('<tr><td class="td_izq" width="1%" align="left">');
  document.write('<a target="_blank" href="http:\/\/get.adobe.com\/es\/flashplayer\/"><img src=".\/imagenes\/get_adobe_fp.png" class="img_block"');
  document.write(' alt="Descargar Adobe Flash Player"><\/a><\/td>');
  document.write('<td class="td_izq" width="1%" align="left">');
  document.write('<a target="_blank" href="http:\/\/get.adobe.com\/es\/reader\/"><img src=".\/imagenes\/get_adobe_reader.png" class="img_block"');
  document.write(' alt="Descargar Adobe Acrobat Reader"><\/a><\/td>');
  document.write('<td class="td_izq" width="98%" align="right" valign="bottom" nowrap style="text-align: right">');
  document.write('<a href="http:\/\/validator.w3.org\/check?uri=referer">');
  document.write('<img src="http:\/\/www.w3.org\/Icons\/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"><\/a>');
  document.write('<\/td><\/tr><tr><td coslpan="3" style="padding-bottom:2px"><\/td><\/tr><\/table>');
}

function montar_inferior() {

  document.write('<table id="inferior" width="100%" cellpadding="0px" cellspacing="0px" style="border-top: 2px #000000 solid;border-bottom: 1px #dddddd solid;">');
  document.write('<tr><td align="left" style="border-top: 1px #dddddd solid;" nowrap>');
  document.write('&nbsp;Hermandad de Nuestra Señora de la Soledad. Guadalajara. España. Actualizado a 02 de Febrero de 2012.<\/td>');
  document.write('<td width="100%" style="text-align:right; border-top: 1px #dddddd solid;">');
  document.write('<a href=".\/condiciones.html" class="a_gris">Condiciones de uso<\/a> | <a href=".\/condiciones.html#privacidad" class="a_gris">Privacidad<\/a>&nbsp;');
  document.write('<\/td><\/tr><\/table>');
}

function publicidad_tienda(n) {
  var k = Math.round(Math.random(objetos_tienda)*objetos_tienda);
  for (var i = 0; i < n; i++) {
    document.write('<div class="div_mizq"><br><br><\/div>');
    document.write('<div class="div_mizq">');
    document.write('<a href=".\/tienda.html#tienda' + k + '"><img src="' + objt[k][8] + '" alt="' + objt[k][0] + ': Pinche aquí para visitar nuestra tienda virtual..."><\/a>');
    document.write('<\/div>');
    if (k == (objetos_tienda-1)) {k = 0;} else k++;
  }
}

// Esto sólo es necesario para navegadores Netscape.
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }



