function Insert_QTVR_FS ( TheFileName, TheWidth, TheFooterSpace, TheBgColor, TheScaleType, TheController, TheAutoPlay, TheCache, TheKioskMode, TheVolume )
                        {
                          if (window.innerHeight)
                              TheHeight = window.innerHeight - TheFooterSpace;  // IE check
                          else
                              TheHeight = document.body.offsetHeight - TheFooterSpace;

                          TheHeight = TheHeight.toString(10);

                          theEmbedStr='';
                          theEmbedStr+='<object id="TheObjectPano" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ';
                          theEmbedStr+='codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
                          theEmbedStr+='width="' + TheWidth + '" ';
                          theEmbedStr+='height="' + TheHeight + '">\n';

                          theEmbedStr+='<param name="src"        value="'  + TheFileName   + '">\n';
                          theEmbedStr+='<param name="moviename"  value="pleinpotVR">\n';
                          theEmbedStr+='<param name="bgcolor"    value="#' + TheBgColor    + '">\n';
                          theEmbedStr+='<param name="scale"      value="'  + TheScaleType  + '">\n';
                          theEmbedStr+='<param name="controller" value="'  + TheController + '">\n';
                          theEmbedStr+='<param name="autoplay"   value="'  + TheAutoPlay   + '">\n';
                          theEmbedStr+='<param name="cache"      value="'  + TheCache      + '">\n';
                          theEmbedStr+='<param name="kioskmode"  value="'  + TheKioskMode  + '">\n';
                          theEmbedStr+='<param name="volume"     value="'  + TheVolume     + '">\n';

                          theEmbedStr+='<embed ';
                          theEmbedStr+='width="' + TheWidth           + '" '; 
                          theEmbedStr+='height="' + TheHeight         + '" ';
                          theEmbedStr+='src="' + TheFileName          + '" ';
                          theEmbedStr+='type="video/quicktime" ';
                          theEmbedStr+='id="TheEmbedPano" ';
                          theEmbedStr+='moviename="pleinpotVR" ';
                          theEmbedStr+='bgcolor="#' + TheBgColor      + '" ';
                          theEmbedStr+='scale="' + TheScaleType       + '" ';
                          theEmbedStr+='controller="' + TheController + '" ';
                          theEmbedStr+='autoplay="' + TheAutoPlay     + '" ';
                          theEmbedStr+='cache="' + TheCache           + '" ';
                          theEmbedStr+='kioskmode="' + TheKioskMode   + '" ';
                          theEmbedStr+='volume="' + TheVolume         + '" ';
                          theEmbedStr+='pluginspage="http://www.apple.com/quicktime/download/" />\n';

                          theEmbedStr+='</object>\n';
                          document.write(theEmbedStr);
                          }


function Insert_QTVR_Control ( TheBackColor, TheFrontColor, TheAudio, TheAutoRotate, TheHotSpots )
                             {
                               theEmbedStr='';
                               theEmbedStr+='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ';
                               theEmbedStr+='codebase="http://www.apple.com/qtactivex/qtplugin.cab" ';
                               theEmbedStr+='width="220" ';
                               theEmbedStr+='height="20">\n';

                               theEmbedStr+='<param name="src"         value="control.mov">\n';
                               theEmbedStr+='<param name="controller"  value="false">\n';
                               theEmbedStr+='<param name="autoplay"    value="false">\n';
                               theEmbedStr+='<param name="cache"       value="false">\n';
                               theEmbedStr+='<param name="kioskmode"   value="true">\n';

                               theEmbedStr+='<param name="MovieQTList" value="<movielist>';
                               theEmbedStr+='<backcolor>' + TheBackColor + '</backcolor>';
                               theEmbedStr+='<frontcolor>' + TheFrontColor + '</frontcolor>';
                               theEmbedStr+='<hasaudio>' + TheAudio + '</hasaudio>';
                               theEmbedStr+='<autorotate>' + TheAutoRotate + '</autorotate>';
                               theEmbedStr+='<hotspot>' + TheHotSpots + '</hotspot>';
                               theEmbedStr+='<backimage>control.jpg</backimage>';
                               theEmbedStr+='</movielist> />"\n';

                               theEmbedStr+='<embed ';
                               theEmbedStr+='width=220 ';
                               theEmbedStr+='height=20 ';
                               theEmbedStr+='src="control.mov" ';
                               theEmbedStr+='type="video/quicktime" ';
                               theEmbedStr+='controller="false" ';
                               theEmbedStr+='autoplay="false" ';
                               theEmbedStr+='cache ="false" ';
                               theEmbedStr+='kioskmode="true" ';
                               theEmbedStr+='movieqtlist="<movielist>';
                               theEmbedStr+='<backcolor>' + TheBackColor + '</backcolor>';
                               theEmbedStr+='<frontcolor>' + TheFrontColor + '</frontcolor>';
                               theEmbedStr+='<hasaudio>' + TheAudio + '</hasaudio>';
                               theEmbedStr+='<autorotate>' + TheAutoRotate + '</autorotate>';
                               theEmbedStr+='<hotspot>' + TheHotSpots + '</hotspot>';
                               theEmbedStr+='<backimage>control.jpg</backimage>';
                               theEmbedStr+='</movielist>" ';
                               theEmbedStr+='pluginspage="http://www.apple.com/quicktime/download/" />\n';

                               theEmbedStr+='</object>\n';
                               document.writeln(theEmbedStr);
                               }


function Insert_Icon_Map_Link ( TheLat1, TheLat2, TheLat3, TheLat4, TheLon1, TheLon2, TheLon3, TheLon4)
                              {
                                TheLatitud = 0.0;
                                TheLatitud = TheLat1 + ((TheLat2 + (TheLat3/60))/60);

                                TheLongitud = 0.0;
                                TheLongitud = TheLon1 + ((TheLon2 + (TheLon3/60))/60);

                                TheMapStr='';
                                TheMapStr+='http://maps.google.com/maps?ie=UTF8&hl=en&q=' + TheLatitud.toString(10) + '+' + TheLat4 + '+' + TheLongitud.toString(10) + '+' + TheLon4 + '&z=5&t=k';

                                theEmbedStr='';
                                theEmbedStr+='<A href="' + TheMapStr + '" target="_blank"><IMG src="mapa.gif" alt=" Ver mapa " title=" Ver mapa "></A>';
                                document.writeln(theEmbedStr);
                                }


function Insert_Text_Map_Link ( TheLat1, TheLat2, TheLat3, TheLat4, TheLon1, TheLon2, TheLon3, TheLon4)
                              {
                                TheLatitud = 0.0;
                                TheLatitud = TheLat1 + ((TheLat2 + (TheLat3/60))/60);

                                TheLongitud = 0.0;
                                TheLongitud = TheLon1 + ((TheLon2 + (TheLon3/60))/60);

                                TheMapStr='';
                                TheMapStr+='http://maps.google.com/maps?ie=UTF8&hl=en&q=' + TheLatitud.toString(10) + '+' + TheLat4 + '+' + TheLongitud.toString(10) + '+' + TheLon4 + '&z=5&t=k';

                                theEmbedStr='';
                                theEmbedStr+='<A href="' + TheMapStr + '" target="_blank">' + 'Ver mapa' + '</A>';
                                document.writeln(theEmbedStr);
                                }


function Resize_QTVR_FS (TheFooterSpace)
                        {
                         if (document.getElementById)
                            {
                             var TheNewWidth  = 320;
                             var TheNewHeight = 240;

                             if (window.innerHeight)
                                {
                                 TheNewWidth  = window.innerWidth;
                                 TheNewHeight = window.innerHeight - TheFooterSpace;  // IE check
                                 }
                             else
                                {
                                 TheNewWidth  = document.body.offsetWidth;
                                 TheNewHeight = document.body.offsetHeight - TheFooterSpace; // educated guesstimate for IE
                                 }

                             if (TheNewWidth < 320)
                                 TheNewWidth = 320;

                             if (TheNewHeight < 240)
                                 TheNewHeight = 240;

                             TheNewWidth  = TheNewWidth.toString(10)  + "Px";
                             TheNewHeight = TheNewHeight.toString(10) + "Px";

                             if (document.getElementById('TheObjectPano'))
                                {
                                 var ThePano = document.getElementById('TheObjectPano');
                                 ThePano.style.height = TheNewHeight;
                                 }

                             if (document.getElementById('TheEmbedPano'))
                                {
                                 var ThePano = document.getElementById('TheEmbedPano');
                                 ThePano.style.height = TheNewHeight;
                                 }
                             }
                         }


function theFullScreen(theURL)
         {
          window.open(theURL,"_blank","menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0,titlebar=0");
          }


function window_close ()
                      {
                       window.close();
                       window.setTimeout("cant_close()", 1000); // notify if close fails
                       }


function cant_close ()
                    {
                     alert('No ha sido posible cerrar esta ventana.\nEl usuario no ha permitido cerrar la ventana\n o la configuración del presente navegador lo impide.');
                     }


function SecureEmail (TheUser, TheDomain, TheSuffix)
                     {
                      document.write('<a href="' + 'mailto:' + TheUser + '@' + TheDomain + '.' + TheSuffix + '">' + ' Roberto Gómez Torres ' + '<\/a>');
                      }


function WriteCaption (whichcaption)
                      {
                       switch (whichcaption)
                              {
                               case '0':  whichcaption = 'Da click en la imagen y avanza hacia los extremos'
                                          break
                               case '1':  whichcaption = 'Mirar a la izquierda'
                                          break
                               case '2':  whichcaption = 'Mirar a la derecha'
                                          break
                               case '3':  whichcaption = 'Mirar hacia arriba'
                                          break
                               case '4':  whichcaption = 'Mirar hacia abajo'
                                          break
                               case '5':  whichcaption = 'Realizar alejamiento'
                                          break
                               case '6':  whichcaption = 'Realizar acercamiento'
                                          break
                               case '7':  whichcaption = 'Iniciar auto giro'
                                          break
                               case '8':  whichcaption = 'Detener auto giro'
                                          break
                               case '9':  whichcaption = 'Apagar sonido'
                                          break
                               case '10': whichcaption = 'Reproducir sonido'
                                          break
                               case '11': whichcaption = 'Mostrar zonas activas'
                                          break
                               case '12': whichcaption = 'Ocultar zonas activas'
                                          break
                               }
                       document.getElementById('MyCaption').innerHTML = whichcaption;
                      }