// global functions -----------------------------------------------------------------------------
function changeBG(obj, bgColor)
{
	obj.style.backgroundColor = bgColor;
}

function adjustComment(id)
{
	var currentH = parseInt(document.body.scrollHeight);
	
    parent.document.getElementById(id).style.height = currentH + 80 + 'px';
    document.getElementById('cmtMiddle').style.height = currentH  + 40 + 'px';
    document.getElementById('cmtBottom').style.top = currentH + 29 + 'px';
}

function img_on(imgName) { 
	document [imgName].src = eval(imgName + "on.src");
} 

function img_off(imgName) { 
	document [imgName].src = eval(imgName + "off.src"); 
} 

function openWindow(src) 
{
	newWin = window.open(src);
	if (parseInt(navigator.appVersion) >= 4) { newWin.window.focus(); }
}

function maxWindow(winH)
{
	winH.moveTo(0,0);
	winH.resizeTo(screen.availWidth, screen.availHeight);
	winH.focus();
}


//functions to get around the Microsoft/EOLAS patent issue ---------------------------------------------
function makeFlashButton(objName, objW, objH, objPath)
{
	var fo = new SWFObject(objPath, objName, objW, objH, "7", "#ffffff");
	fo.addParam("quality", "high");
	fo.addParam("wmode", "transparent");
	fo.write(objName);
}

function makeFlashSlideshow(objName, picDir)
{
	var fo = new SWFObject("slideshow.swf", objName, "100%", "100%", "8", "#000000");
	fo.addParam("quality", "high");
	fo.addParam("allowScriptAccess", "sameDomain");
	fo.addVariable("xmlFile", picDir+"/images.xml");
	fo.write(objName);
}

function makeWMVPlayer(vidID)
{
	document.write('<object id="MediaPlayer" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" height="100%" width="100%" ');
	document.write('standby="Loading Windows Media Player components..." type="application/x-oleobject" ');
	document.write('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">');
	document.write('<param name="autoStart" value="true">');
	document.write('<param name="filename" value="data/'+vidID+'/video.wvx">');
	document.write('<param name="uiMode" value="none">');
	document.write('<param name="showstatusbar" value="true">');
	document.write('<p>');
	document.write('<b>Firefox users:</b><br>');
	document.write('Streaming Video requires that you follow ');
	document.write('<a target="_blank" href="http://forums.mozillazine.org/viewtopic.php?t=206213">');
	document.write('this Step-By-Step Guide</a> published by MozillaZine.<br>');
	document.write('<br>');
	document.write('<b>Netscape users:</b><br>');
	document.write('Change these settings in the Site Controls Advanced tab for www.bergmark.com<br>');
	document.write('- Check "Enable ActiveX"<br>');
	document.write('- Set Rendering Engine to "Internet Explorer"<br>');
	document.write('</p>');
	document.write('</object>');
}

function makeFlashPlayer(vidID)
{
	document.write('<object id="FLVPlayer" ');
	document.write('classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="384px" height="312px" ');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">');
	document.write('<param name="movie" value="mediaplayer.swf">');
	document.write('<param name="allowscriptaccess" value="always">');
	document.write('<param name="allowfullscreen" value="true">');	
	document.write('<param name=FlashVars value="file=http://bergmark.com/video');
	document.write('/data/'+vidID+'/video.flv&autostart=true">');
	document.write('<embed src="mediaplayer.swf" flashvars="file=http://bergmark.com/video/data/'+vidID+'/video.flv');
	document.write('&autostart=true" allowfullscreen="true" allowscriptaccess="always" ');
	document.write('width="384" height="312" ');
	document.write('name="FLVPlayer" type="application/x-shockwave-flash" ');
	document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
}

function makeBigFlashPlayer(vidID)
{
	document.write('<object id="FLVPlayer" ');
	document.write('classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="624px" height="352px" ');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">');
	document.write('<param name="movie" value="mediaplayer.swf">');
	document.write('<param name="allowscriptaccess" value="always">');
	document.write('<param name="allowfullscreen" value="true">');	
	document.write('<param name=FlashVars value="file=http://bergmark.com/misc');
	document.write('/ai8/'+vidID+'.flv&autostart=true">');
	document.write('<embed src="mediaplayer.swf" flashvars="file=http://bergmark.com/misc/ai8/'+vidID+'.flv');
	document.write('&autostart=true" allowfullscreen="true" allowscriptaccess="always" ');
	document.write('width="624" height="352" ');
	document.write('name="FLVPlayer" type="application/x-shockwave-flash" ');
	document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
	document.write('</object>');
}

function makeFPPViewer(objName, objPath, xmlPath)
{
	var fo = new SWFObject(objPath, objName, "100%", "100%", "7", "#ffffff");
	fo.addVariable("xml_file", xmlPath);
//	fo.addVariable("redirect", window.location);
	fo.addParam("allowFullScreen","true");
	fo.addParam("allowScriptAccess","sameDomain");
	fo.write(objName);
}

function makeKrpanoViewer(objName, objPath, xmlPath)
{
	var fo = new SWFObject(objPath, objName, "100%", "100%", "9.0.28", "#ffffff");
	fo.addVariable("xml", xmlPath);
	fo.addParam("allowFullScreen","true");
	if (fo.write(objName)) { var mousewheelfixes = new SWFkrpanoMouseWheel(fo); }
}

function makeFlashViewer(objName, objPath)
{
	var fo = new SWFObject(objPath, objName, "100%", "100%", "7", "#ffffff");
	fo.addParam("quality", "high");
	fo.write(objName);
}

function makeShockwaveViewer(swEngine, swFile, bgColor)
{
	document.write('<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" width="100%" height="100%"');
	document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0">');
	document.write('<param name="src" value="'+swEngine+'">');
	document.write('<param name="swURL" value="'+swFile+'">');
	document.write('<param name="swStretchStyle" value="stage">');
	document.write('<param name="progress" value="false">');
	document.write('<param name="logo" value="false">');
	document.write('<param name="bgColor" value="'+bgColor+'">');
	document.write('<embed width="100%" height="100%" type="application/x-director" ');
	document.write('pluginspage="http://www.macromedia.com/shockwave/download/" ');
	document.write('src="'+swEngine+'" swURL="'+swFile+'" swStretchStyle="stage" progress="false" ');
	document.write('logo="false" bgColor="'+bgColor+'">');
	document.write('</embed>');
	document.write('</object>');
}

function makeDevalViewer(panID, seqFile, dvFile)
{
	document.write('<object id="DevalVRPlugin" classid=clsid:5D2CF9D0-113A-476B-986F-288B54571614 width="100%" height="100%" ');
	document.write('codeBase="http://www.devalvr.com/instalacion/plugin/devalocx.cab#version=0,2,9,0">');
	document.write('<param name="src" value="'+dvFile+'">');
	document.write('<param name="filter" value="1">');
	document.write('<param name="postfilter" value="3">');
	document.write('<param name="resize" value="0">');
	document.write('<param name="bgcolor" value="#000000">');
	if (seqFile) {
		document.write('<param name="sequencefile" value="data/'+panID+'/sequence.txt">');
	}
	document.write('<embed name="devalPlugin" width="100%" height="100%" type="application/x-devalvrx" ');
	document.write('pluginspage="http://www.devalvr.com/instalacion/plugin/install.html" ');  
	document.write('src="'+dvFile+'" filter="1" postfilter="3" resize="0" bgcolor="#000000" ');
	if (seqFile) {
		document.write('sequencefile="data/'+panID+'/sequence.txt" ');
	}
	document.write('></embed>');
	document.write('</object>');
}

function makeJavaViewer(panID, picLoading, x, y)
{
	document.write('<applet archive="jview.jar" codebase="/pano" code="a3d.ImageRenderApplet.class" width="695" height="489">');
	document.write('<param name="file" value="data/'+panID+'/java.jpg">');
	document.write('<param name="auto" value="3">');
	document.write('<param name="wait" value="img/'+picLoading+'">');
	document.write('<param name="inits" value="viewer:gotoView(179,0,320);startAutoPan();toggleQuality();">');
	document.write('<param name="shotspot0" value=" x'+(x+10)+' y'+(y+15)+' l1 p i\'img/pan_rotate_.gif\' m\'#ffffff\' u\'viewer:startAutoPan();\'">');
	document.write('<param name="shotspot1" value=" x'+(x+10)+' y'+(y+15)+' l0.6 q n\'Autorotate\' i\'img/pan_rotate.gif\' m\'#ffffff\'">');
	document.write('<param name="shotspot2" value=" x'+(x+40)+' y'+(y+15)+' l1 p i\'img/pan_stop_.gif\' m\'#ffffff\' u\'viewer:stopAutoPan();\'">');
	document.write('<param name="shotspot3" value=" x'+(x+40)+' y'+(y+15)+' l0.6 q n\'Stop Rotating\' i\'img/pan_stop.gif\' m\'#ffffff\'">'); 
	document.write('<param name="shotspot4" value=" x'+(x+75)+' y'+y+' l1 p i\'img/pan_up_.gif\' m\'#ffffff\' u\'viewer:panDown();\'">');
	document.write('<param name="shotspot5" value=" x'+(x+75)+' y'+y+' l0.6 q n\'Pan Up\' i\'img/pan_up.gif\' m\'#ffffff\'">');
	document.write('<param name="shotspot6" value=" x'+(x+75)+' y'+(y+23)+' l1 p i\'img/pan_down_.gif\' m\'#ffffff\' u\'viewer:panUp();\'">');
	document.write('<param name="shotspot7" value=" x'+(x+75)+' y'+(y+23)+' l0.6 q n\'Pan Down\' i\'img/pan_down.gif\' m\'#ffffff\'">');
	document.write('<param name="shotspot8" value=" x'+(x+70)+' y'+(y+5)+' l1 p i\'img/pan_left_.gif\' m\'#ffffff\' u\'viewer:panLeft();\'">');
	document.write('<param name="shotspot9" value=" x'+(x+70)+' y'+(y+5)+' l0.6 q n\'Pan Left\' i\'img/pan_left.gif\' m\'#ffffff\'">');
	document.write('<param name="shotspot10" value=" x'+(x+93)+' y'+(y+5)+' l1 p i\'img/pan_right_.gif\' m\'#ffffff\' u\'viewer:panRight();\'">');
	document.write('<param name="shotspot11" value=" x'+(x+93)+' y'+(y+5)+' l0.6 q n\'Pan Right\' i\'img/pan_right.gif\' m\'#ffffff\'">');
	document.write('<param name="shotspot12" value=" x'+(x+79)+' y'+(y+10)+' l1 p i\'img/pan_reset_.gif\' m\'#ffffff\' u\'viewer:gotoView(179,0,320);\'">');
	document.write('<param name="shotspot13" value=" x'+(x+79)+' y'+(y+10)+' l0.6 q n\'Pan Reset\' i\'img/pan_reset.gif\' m\'#ffffff\'">');
	document.write('</applet>');
}

function makePurePlayerViewer(vrFile)
{
	document.write('<applet archive="/pano/PurePlayerPro.jar" code="PurePlayerPro" width="735" height="475">');
	document.write('<param name="gui" value="/pano/gui.ivu">');
	document.write('<param name="panorama" value="'+vrFile+'">');
	document.write('<param name="singlepanorama" value="true">');
	document.write('<param name="protectfullscreen" value="true">');
	document.write('<param name="quality" value="300">');
	document.write('<param name="antialiasing" value="everytime">');
	document.write('<param name="lockzenithnadir" value="true">');
	document.write('</applet>');
}

function makeQTSpinControl()
{
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab"');
	document.write('height="30" width="549">');
	document.write('<param name="controller" value="false" />');
	document.write('<param name="cache" value="false" />');
	document.write('<param name="MovieQTList" value="');
	document.write('<spincontrol>');
	document.write('<mainBackground>000000</mainBackground>');
	document.write('<outlineNormal>ffffff</outlineNormal>');
	document.write('<outlineOver>ffcc00</outlineOver>');
	document.write('<outlineDown>ffcc00</outlineDown>');
	document.write('<buttonNormal>000000</buttonNormal>');
	document.write('<buttonOver>ffffff</buttonOver>');
	document.write('<buttonDown>ffcc00</buttonDown>');
	document.write('<arrowNormal>ffcc00</arrowNormal>');
	document.write('<arrowOver>000000</arrowOver>');
	document.write('<arrowDown>ffffff</arrowDown>');
	document.write('<textColor>ffffff</textColor>');
	document.write('<spinDirection>.2</spinDirection>');
	document.write('<LanguageFlag>1</LanguageFlag>');
	document.write('<enableAutospinToggle>yes</enableAutospinToggle>');
	document.write('<enableHotspotToggle>yes</enableHotspotToggle>');
	document.write('<disabledTransparency>50</disabledTransparency>');
	document.write('<AutospinOnAtStart>1</AutospinOnAtStart>');
	document.write('<HotspotsOnAtStart>1</HotspotsOnAtStart>');
	document.write('</spincontrol>');
	document.write('" />');
	document.write('<param name="moviename" value="spinControl_hextended" />');
	document.write('<param name="src" value="spinControl.mov" />');
	document.write('<embed pluginspage="http://www.apple.com/quicktime/download/"');
	document.write('type="video/quicktime" height="30" width="549" controller="false" cache="false"');
	document.write('MovieQTList="');
	document.write('<spincontrol>');
	document.write('<mainBackground>000000</mainBackground>');
	document.write('<outlineNormal>ffffff</outlineNormal>');
	document.write('<outlineOver>ffcc00</outlineOver>');
	document.write('<outlineDown>ffcc00</outlineDown>');
	document.write('<buttonNormal>000000</buttonNormal>');
	document.write('<buttonOver>ffffff</buttonOver>');
	document.write('<buttonDown>ffcc00</buttonDown>');
	document.write('<arrowNormal>ffcc00</arrowNormal>');
	document.write('<arrowOver>000000</arrowOver>');
	document.write('<arrowDown>ffffff</arrowDown>');
	document.write('<textColor>ffffff</textColor>');
	document.write('<spinDirection>.2</spinDirection>');
	document.write('<LanguageFlag>1</LanguageFlag>');
	document.write('<enableAutospinToggle>yes</enableAutospinToggle>');
	document.write('<enableHotspotToggle>yes</enableHotspotToggle>');
	document.write('<disabledTransparency>50</disabledTransparency>');
	document.write('<AutospinOnAtStart>1</AutospinOnAtStart>');
	document.write('<HotspotsOnAtStart>1</HotspotsOnAtStart>');
	document.write('</spincontrol>" ');
	document.write('moviename="spinControl_hextended" src="spinControl.mov">');
	document.write('</embed>');
	document.write('</object>');
}

function makeQTViewer(panID)
{
	document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="100%" height="100%" ');
	document.write('codebase="http://www.apple.com/qtactivex/qtplugin.cab">');
	document.write('<param name="scale" value="tofit">');
	document.write('<param name="controller" value="false">');
	document.write('<param name="cache" value="false">');
	document.write('<param name="moviename" value="spincontrolled">');
	document.write('<param name="movieid" value="2">');
	document.write('<param name="src" value="data/'+panID+'/qt.mov">');
	document.write('<embed pluginspage="http://www.apple.com/quicktime/download/"');
	document.write('type="video/quicktime"');
	document.write('height="100%"');
	document.write('width="100%"');
	document.write('scale="tofit"');
	document.write('controller="false"');
	document.write('cache="false"');
	document.write('movieid="2"');
	document.write('moviename="spincontrolled"');
	document.write('src="data/'+panID+'/qt.mov">');
	document.write('</embed>');
	document.write('</object>');
}

function backgroundMusic(panID)
{
	document.write('<object id="PanoMusic" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" ');
	document.write('codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab# Version=5,1,52,701" ');
	document.write('standby="Loading Microsoft Windows¢ç Media Player components..." ');
	document.write('type="application/x-oleobject" width="0" height="0">');
	document.write('<param name="fileName" value="data/'+panID+'/default_music.m3u">');
	document.write('<param name="animationatStart" value="true">');
	document.write('<param name="transparentatStart" value="true">');
	document.write('<param name="autoStart" value="true">');
	document.write('<param name="showControls" value="false">');
	document.write('<param name="Volume" value="-300">');
	document.write('<embed type="application/x-mplayer2" ');
	document.write('pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ');
	document.write('src="data/'+panID+'/default_music.m3u" name="PanoMusic"  width="0" height="0" ');
	document.write('autostart="1" showcontrols="0" volume="-300">');
	document.write('</object>');
}
// Album ----------------------------------------------------------------------------------------

function displayAlbum(src)
{	
	document.getElementById('albumFrame').style.visibility="visible";
	document.getElementById('albumComments').style.visibility="visible";	
	document.getElementById('pagePlate').style.visibility="hidden";
	document.getElementById('albumBorder').style.visibility="hidden";
	document.getElementById('albumList').style.visibility="hidden";
	document.getElementById('bottomShadow').style.visibility="hidden";
	document.getElementById('albumWindow').src="/album/showAlbum.php?"+src;	
	document.getElementById('albumComments').src="/album/showAlbumCmts.php?"+src;
}

function displayAlbumList()
{
	parent.document.getElementById('albumList').style.visibility="visible";
	parent.document.getElementById('albumBorder').style.visibility="visible";
	parent.document.getElementById('pagePlate').style.visibility="visible";
	parent.document.getElementById('bottomShadow').style.visibility="visible";
	parent.document.getElementById('albumFrame').style.visibility="hidden";
	parent.document.getElementById('albumComments').style.visibility="hidden";	
	parent.document.getElementById('albumWindow').src="about:blank";
	parent.document.getElementById('albumComments').src="about:blank";
	parent.document.getElementById('albumComments').style.height=0+'px';
}

// Contact/Forum ----------------------------------------------------------------------------------------
function displayForum(src)
{
	document.getElementById('forumList').src="/showForumList.php?"+src;
}

function displayForumDetail(src)
{
	parent.document.getElementById('forumList').style.visibility="hidden";
	parent.document.getElementById('forumDetail').style.visibility="visible";
	parent.document.getElementById('forumDetail').src="/showForumDetail.php?"+src;
}

function displayForumList()
{
	parent.document.getElementById('forumList').style.visibility="visible";
	parent.document.getElementById('forumDetail').style.visibility="hidden";
	parent.document.getElementById('forumDetail').src="about:blank";
	parent.document.getElementById('forumDetail').style.height=0+'px';
}

// Video ----------------------------------------------------------------------------------------

function displayVideo(src)
{
	document.getElementById('videoList').style.visibility="hidden";
	document.getElementById('videoBorder').style.visibility="hidden";
	document.getElementById('bottomShadow').style.visibility="hidden";
	document.getElementById('pagePlate').style.visibility="hidden";
	document.getElementById('videoFrame').style.visibility="visible";
	document.getElementById('videoComments').style.visibility="visible";
	document.getElementById('videoWindow').src="/video/showVideo.php?"+src;
	document.getElementById('videoComments').src="/video/showVideoCmts.php?"+src;
}

function displayVideoList()
{
	document.getElementById('videoBorder').style.visibility="visible";
	document.getElementById('videoList').style.visibility="visible";
	document.getElementById('bottomShadow').style.visibility="visible";
	document.getElementById('pagePlate').style.visibility="visible";
	document.getElementById('videoFrame').style.visibility="hidden";
	document.getElementById('videoComments').style.visibility="hidden";	
	document.getElementById('videoWindow').src="about:blank";
	document.getElementById('videoComments').src="about:blank";
	document.getElementById('videoComments').style.height=0+'px';
}

// Panorama ----------------------------------------------------------------------------------------
function showMap(panid, id, lang)
{
	document.location.href = "showMap.php?panid="+panid+"&id="+id+"&lang="+lang;
}

function hideMap(src)
{
	document.location.href = "showPano.php?"+src+"&viewer=index&logo=0";
}

function showPanoTitle(title)
{
	if (parent.document.getElementById('panoTitle') != null)
		parent.document.getElementById('panoTitle').innerHTML=title;
}

function displayPano(src)
{
	document.getElementById('panoList').style.visibility="hidden";
	document.getElementById('panoBorder').style.visibility="hidden";
	document.getElementById('panoHeader').style.visibility="hidden";
	document.getElementById('pagePlate').style.visibility="hidden";
	document.getElementById('bottomShadow').style.visibility="hidden";
	document.getElementById('panoFrame').style.visibility="visible";
	document.getElementById('panoComments').style.visibility="visible";
	document.getElementById('panoWindow').src="/pano/showPano.php?"+src+"&viewer=goflash&logo=0";
	document.getElementById('panoComments').src="/pano/showPanoCmts.php?"+src;
	document.getElementById('webpageOuter').style.height=700+'px';
	document.getElementById('webpageInner').style.height=700+'px';
	document.getElementById('webpageContent').style.height=700+'px';
}

function displayKrPano(src)
{
	document.getElementById('panoList').style.visibility="hidden";
	document.getElementById('panoBorder').style.visibility="hidden";
	document.getElementById('panoHeader').style.visibility="hidden";
	document.getElementById('pagePlate').style.visibility="hidden";
	document.getElementById('bottomShadow').style.visibility="hidden";
	document.getElementById('panoFrame').style.visibility="visible";
	document.getElementById('panoComments').style.visibility="visible";
	document.getElementById('panoWindow').src="/pano/showPano.php?"+src+"&viewer=krpano&logo=0";
	document.getElementById('panoComments').src="/pano/showPanoCmts.php?"+src;
	document.getElementById('webpageOuter').style.height=700+'px';
	document.getElementById('webpageInner').style.height=700+'px';
	document.getElementById('webpageContent').style.height=700+'px';
}

function displayPanoLink(src)
{
	document.getElementById('panoWindow').src="/pano/showPano.php?id="+src+"&viewer=index";
}


function displayPanoList()
{
	document.getElementById('panoFrame').style.visibility="hidden";
	document.getElementById('panoComments').style.visibility="hidden";
	document.getElementById('panoList').style.visibility="visible";
	document.getElementById('panoHeader').style.visibility="visible";
	document.getElementById('panoBorder').style.visibility="visible";
	document.getElementById('pagePlate').style.visibility="visible";
	document.getElementById('bottomShadow').style.visibility="visible";
	document.getElementById('panoWindow').src="about:blank";
	document.getElementById('panoComments').src="about:blank";
	document.getElementById('panoComments').style.height=0+'px';
	document.getElementById('webpageInner').style.height=560+'px';
	document.getElementById('webpageOuter').style.height=560+'px';
	document.getElementById('webpageContent').style.height=560+'px';
	showPanoTitle(" ");
}

function displayPanoGroup(src)
{
	window.location='/showPage.php?'+src;
}

function openPano(id, viewer, lang) 
{
  var winW, winH
  var tmpX, maxPanoX;
  var winAttr;
  var newPage;
  var newWin;
  var maxWinRatio = 4/3;
  
  switch (viewer)
  {
    case "Java":
      winW = 745; 
      winH = 570;
	  winAttr = "height="+winH+",width="+winW+",scrollbars=no";
	  break;

	default:	  
	  winAttr = "scrollbars=no";
	  //winAttr = "scrollbars=0,fullscreen=1,type=fullwindow"; //type=fullwindow for NetScape
	  break;
  }

  tmpX = screen.availHeight * maxWinRatio;
  maxPanoX = (tmpX / screen.availWidth * 100) + 10;
  if (maxPanoX > 100) maxPanoX = 100;

  //don't scale fullscreen window //newPage = "/pano/showPano.php?id="+id+"&viewer="+viewer+"&lang="+lang+"&px="+maxPanoX;
  newPage = "/pano/showPano.php?id="+id+"&viewer="+viewer+"&lang="+lang;
  newWin = window.open(newPage,"pano",winAttr);
  if (parseInt(navigator.appVersion) >= 4) { newWin.window.focus(); }
  if (viewer != "Java") maxWindow(newWin);
}