<!--
// OJO el fichero esta delimitado como comentario
// OJO no incluir ACENTOS

// Utilidades
var pPan=0;
var pTilt=0;
var debug=0;

function AdecuarQTaVentana(pPanorama, pPan, pTilt, pFov)
{
  fov="75";
  // alert(width + " " +height);
  //alert(window.width + " - " +window.height);
  // window.focus();

//  window.resizeTo(screen.width-10,screen.height-55);
//  window.moveTo(5,5);

//  window.moveTo(window.screen.availLeft, window.screen.avail.Top);
    window.resizeTo(window.screen.availWidth, window.screen.availHeight);
    window.moveTo(0,0);


//  alert('window.screen.availWidth '+ screen.availWidth + ' window.screen.availHeight ' + window.screen.availHeight); 

  width=screen.width -30;
  height= window.screen.availHeight - 90; 
//  height=screen.height - 20;
//  alert('width ' + width + ' height ' + height);

  versionQT = getQuicktimeVersion();
  if (versionQT == null) alert("Your computer seems that has not installed QuickTime. Please follow the instructions if you like. Su ordenador aparentemente no dispone de QuickTime. Si lo desea siga las instrucciones para su instalacion.");

  if (screen.width>1280)
  {
    swidth = 1280;
  }
  else
  {
    swidth = screen.width;
  }

  if (swidth==1280)
  {
    fov="75";
  }
  else if (swidth==1024)
  {
    fov="85";
  }
  else if (swidth==800)
  {
    fov="85";
  }
  if (pFov != null)  // Si se pide uno en concreto, ese es el que vale
  {
    fov=pFov;
  }
  //alert(fov);
 
  // Pié de página
  document.write('  <table width="100%" border="0"> ');
  document.write('    <tr> ');
  document.write('      <td> ');
  document.write('        <div align="left"><a href="javascript:VentanaHome()"><font style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#FF9900"><BOLD>HOME</BOLD></font></a></div> ');
  document.write('      </td> ');
  document.write('      <td> ');
  document.write('        <div align="center"><font style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#FFFF00">Click and drag to move, and Shift and Ctrl Keys to zoom it. Haga ');
  document.write('          click y arrastre para mover la imagen y use las teclas Control y May para hacer zoom.</font></div> ');
  document.write('      </td> ');
  document.write('      <td> ');
  document.write('        <div align="right"><a href="javascript:VentanaCerrar()"><font style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#FF9900"><BOLD>CLOSE/CERRAR</BOLD></font></a></div> ');
  document.write('      </td> ');
  document.write('  </table> ');

  // Invocar QT
  document.write('<center>');
  document.write('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="'+width+'"HEIGHT="'+height+'" ');
  document.write('CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"> ');
  document.write('<PARAM name="SRC" VALUE="'+pPanorama+'"> ');
  document.write('<PARAM name="AUTOPLAY" VALUE="false"> ');
  document.write('<PARAM name="CACHE" VALUE="false"> ');
  document.write('<PARAM name="CONTROLLER" VALUE="false"> ');
  document.write('<PARAM name="SCALE" VALUE="tofit"> ');
  document.write('<PARAM name="FOV" VALUE="'+fov+'"> ');
  document.write('<PARAM name="PAN" VALUE="'+pPan+'"> ');
  document.write('<PARAM name="TILT" VALUE="'+pTilt+'"> ');
  document.write('<PARAM name="bgcolor" VALUE="#000000"> ');
  document.write('<embed src="'+pPanorama+'"type="video/quicktime" ');
  document.write('width="'+width+'" height="'+height+'" fov="'+fov+'" tilt="'+pTilt+'" pan="'+pPan+'" cache="false" ');
  document.write('controller="false" bgcolor="#000000" scale="tofit" PLUGINSPAGE="http://www.apple.com/quicktime/download/"></embed>'); 
  document.write('</OBJECT>');
  document.write('</center>');
							   
}

function VentanaCerrar(pURL)
{
  window.close();
}

function abrirVentana(pURL, pAncho, pAlto, pPosX, pPosY)
{
	var PosX="100";
	var PosY="100";
	var Ancho="680";
	var Alto="550";
	var extras="resizable=yes, status=no, scrollbars=yes, status=no, titlebar=no, toolbar=no, menubar=no, location=no";

	if (pAncho != null) {
		Ancho=pAncho;
	}
	if (pAlto != null) {
		Alto=pAlto;
	}
	if (pPosX != null) {
		PosX=pPosX;
	}
	if (pPosY != null) {
		PosY=pPosY;
	}
	
	parametros="width="+Ancho+" ,height="+Alto+" ,left="+PosX+ " ,top="+PosY;
	parametros = parametros + ", "+ extras;
	if (debug) alert("Parametros abrirVentana "+parametros);
	window.open(pURL, null, parametros);
}

function Ventana(pURL)
{
	window.open(pURL,"",'scrollbars=yes,resizable=yes');
}
function VentanaHome()
{
	window.open("http://www.panorama360.es","",'scrollbars=yes,resizable=yes,fullscreen=no');
}


function VentanaFullScreen(pURL)
{
//	window.open(pURL,"",'location=no,menubar=no,channelmode=yes,status=no,titlebar=no');
	window.open(pURL,"",'fullscreen=yes,location=no,menubar=no,channelmode=yes,status=no,titlebar=no');
}


var quicktimeVersion = 0;
function getQuicktimeVersion() {
	var agent = navigator.userAgent.toLowerCase(); 
	
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Quicktime plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
      for (i=0; i < navigator.plugins.length; i++ ) {
         var plugin =navigator.plugins[i];
         if (plugin.name.indexOf("QuickTime") > -1) {
            quicktimeVersion = parseFloat(plugin.name.substring(18));
         }
      }
	}
   
	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	  document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('dim obQuicktime \n');
		document.write('set obQuicktime = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") \n');
		document.write('if IsObject(obQuicktime) then \n');
		document.write('   if obQuicktime.IsQuickTimeAvailable(0) then \n');
		document.write('      quicktimeVersion = CInt(Hex(obQuicktime.QuickTimeVersion) / 1000000) \n');
		document.write('   end if \n');
		document.write('end if \n');
		document.write('</scr' + 'ipt\> \n');
  }

	// Can't detect in all other cases
	else {
		quicktimeVersion = quicktimeVersion_DONTKNOW;
	}

	return quicktimeVersion;
}

var quicktimeVersion_DONTKNOW = -1;

// Scripts para GIGAPAN

function mostrarGigapan(url)
{
    document.write('<script language="javascript">  '); 
    document.write('  function FlashProxy() {}  '); 
    document.write('  FlashProxy.callJS = function() {}  '); 
    document.write('</SCRIPT>  '); 
    window.resizeTo(window.screen.availWidth, window.screen.availHeight);
    window.moveTo(0,0);
    width=screen.width -30;
    height= window.screen.availHeight - 100; 

    document.write('  <embed type="application/x-shockwave-flash"  ');  
    document.write('       src="http://gigapan.org/viewer/PanoramaViewer.swf?url='+url+'" ');
    document.write('       height="'+height+'" width="'+width+'">  '); 
}


//-->