// 2008.05.02

// ===================================== data ========================================
pano = new Array(
new Array(0,"pano","20011024","ninomaru","Ninomaru Imperial Garden","0.9 Mb","970 Kb"),
new Array(0,"16x2","20020217","sanrinsha","Tricycle of Iwao","6.7 Mb","12 Kb"),
new Array(0,"pano","20020407","kabukiza","Kabukiza Theater in Ginza","1.4 Mb","920 Kb"),
new Array(0,"pano","20020525","futsal","Futsal in Futakotamagawa","0.5 Mb","950 Kb"),
new Array(0,"pano","20020912","marucube","Cube Hall in Maru Bldg","1.6 Mb","1030 Kb"),
new Array(0,"pano","20021001","uob","Singapore from UOB Bldg","1.0 Mb","890 Kb"),
new Array(0,"pano","20030208","nippori","North of Tokyo from Nippori","1.5 Mb","800 Kb"),
new Array(0,"pano","20030215","gpac","Give peace a chance - No to war on Iraq","1.1 Mb","550 Kb"),
new Array(0,"pano","20041104","kunda2","Kunda harbour - Kyoto pref.","1.6 Mb","330 Kb"),
new Array(0,"pano","20041104","kunda3","Kunda north beach - Kyoto pref.","1.5 Mb","240 Kb"),
new Array(0,"pano","20050228","harumifutoo","Harumi Marine Park","1.2 Mb","880 Kb"),
new Array(0,"pano","20050304","shioirinoike","Hamarikyu - Shioiri no ike","1.2 Mb","700 Kb"),
new Array(0,"pano","20050304","nakajima","Hamarikyu Nakajima","1.3 Mb","780 Kb"),
new Array(0,"pano","20050304","ochaya1","Hamarikyu Tea House","1.3 Mb","680 Kb"),
new Array(0,"pano","20050304","ochaya2","Hamarikyu Tea House","670 Kb","730 Kb"),
new Array(0,"pano","20050706","hillscafe","Hills Cafe, Roppongi","880 Kb","550 Kb"),
new Array(0,"pano","20051018","fareastcafe","Far East Cafe, San Francisco","830 Kb","620 Kb"),
new Array(0,"pano","20051230","millenario","Millenario from Otemachi / Yurakucho","760 Kb","520 Kb"),
new Array(0,"pano","20060121","yukigeshiki","Shirokane under the snow","840 Kb","650 Kb"),
new Array(0,"pano","20060803","sable","Sabl&eacute; sur Sarthe","1.8 Mb","320 Kb"),
new Array(0,"pano","20061022","nijuubashi","Palace Cycling","4.5 Mb","710 Kb"),
new Array(0,"pano","20070430","asukayama","Asukayama Park","1.8 Mb","760 Kb"),
new Array(2,"pano","--------------","---","---","--- Kb","--- Kb"),
new Array(1,"pano","20030505","asagohan","Sunrise breakfast","190 Kb","190 Kb"),
new Array(1,"pano","20050128","diner","Diner time","210 Kb","730 Kb"),
new Array(1,"pano","20050218","feutres","Crayons feutres","210 Kb","550 Kb"),
new Array(1,"pano","20051023","iwao","Sixth birthday of Iwao","240 Kb","720 Kb"),
new Array(1,"16x2","20051029","legocopter","Lego copter","unavailable","280 Kb"),
new Array(1,"pano","20051231","oatmeal","Oatmeal at breakfast","370 Kb","350 Kb"),
new Array(1,"pano","20060903","iwaoheya","Chambre de Iwao","2.8 Mb","710 Kb"),
new Array(1,"pano","20070902","zushi","Real Estate in Zushi","1.3 Mb","420 Kb")
);

// ==================================== browser =======================================
var browser = navigator.appName
var ver = navigator.appVersion
var thestart = parseFloat(ver.indexOf("MSIE"))+1
var brow_ver = parseFloat(ver.substring(thestart+4,thestart+7))



// ==================================== functions =====================================
function openFullscreen(ww,wh,page) {
offset=1;
if (browser == "Microsoft Internet Explorer"){


  if (ww==0) {ww=screen.width-10}
  if (wh==0) {wh=screen.height-48}
  if (brow_ver>6) {wh=wh-24}
  window.open(page+'&aw='+(ww-offset)+'&ah='+(wh-1-offset), '_blank', 'width=' + ww + ',height=' + wh + ',scrollbars=no,resizable=no').focus();
}
else {
	if (ww==0) {ww=screen.width-6}
  if (wh==0) {wh=screen.height-49}
  window.open(page+'&aw='+(ww-offset)+'&ah='+(wh-offset),   '_blank', 'width=' + ww + ',height=' + wh + ',scrollbars=no,resizable=no').focus();
}
}
// ------------------------------------------------------------------------------------
function PanoPreview (i)
 {
   nhor=0;
	 nver=0;
	 view = pano[i][1];
	 if (view!="pano"){xpos=view.indexOf("x");nhor=parseInt(view.substr(0,xpos));nver=parseInt(view.substr(xpos+1));}	 	 	 
	 date = pano[i][2];
   date = date.substring(0,4) + "." + date.substring(4,6) + "." + date.substring(6,8);
   dir=pano[i][2]+pano[i][3];
   comment=pano[i][4];
   qtweight=pano[i][5];
   jvweight=pano[i][6];
   a1='a1'+i;
   a2='a2'+i;
   a3='a3'+i;
   htmlcode = "<td align='center'><table border='0' cellspacing='1' cellpadding='1'><tr><td align='center'><table width='120' border='0' cellspacing='1' cellpadding='1'><tr><td height='50' rowspan='3'><img class=thumb1 src='"+dir+"/thumb.jpg' title='"+comment+"' border='1' width='100' height='50' onMouseOver=\"window.status='"+comment+"';return true;\" onMouseOut=\"window.status='';return true;\"></td><td height='15'><a class=link2 href='#' onClick=\"openFullscreen(0,0,'http://www.360.mn/viewerq.php?f="+dir+"&t="+comment+" - "+date+"');return false;\" onMouseOver=\"MM_swapImage('"+a1+"','','img/a11.png',1);window.status='Quicktime Fullscreen ["+qtweight+"]';return true;\" onFocus=\"if(this.blur)this.blur()\" onMouseOut=\"MM_swapImgRestore();window.status='';return true;\"><img name='"+a1+"' src='img/a10.png' title='Quicktime Fullscreen ["+qtweight+"]' border='0' width='10' height='15' align='absmiddle'></a></td></tr><tr><td height='15'><a class=link2 href='#' onClick=\"openFullscreen(0,0,'http://www.360.mn/viewerj.php?f="+dir+"&t="+comment+" - "+date+"&nh="+nhor+"&nv="+nver+"');return false;\" onMouseOver=\"MM_swapImage('"+a2+"','','img/a21.png',1);window.status='Java Fullscreen ["+jvweight+"]';return true;\" onFocus=\"if(this.blur)this.blur()\" onMouseOut=\"MM_swapImgRestore();window.status='';return true;\"><img name='"+a2+"' src='img/a20.png' title='Java Fullscreen ["+jvweight+"]' border='0' width='10' height='15' align='absmiddle'></a></td></tr><tr><td height='15'><a class=link2 href='#' onClick=\"openFullscreen(400,230,'http://www.360.mn/viewerj.php?f="+dir+"&t="+comment+" - "+date+"&nh="+nhor+"&nv="+nver+"');return false;\" onMouseOver=\"MM_swapImage('"+a3+"','','img/a31.png',1);window.status='Java Preview ["+jvweight+"]';return true;\" onFocus=\"if(this.blur)this.blur()\" onMouseOut=\"MM_swapImgRestore();window.status='';return true;\"><img name='"+a3+"' src='img/a30.png' title='Java Preview ["+jvweight+"]' border='0' width='10' height='15' align='absmiddle'></a></td></tr></table></td></tr><tr><td align='center'><div class=link1>"+comment+"</div></td></tr><tr><td align='center'><div class=dateweight>"+date+"</div></td></tr></table></td>";
   document.write(htmlcode);
 }
// ------------------------------------------------------------------------------------
function ptviewerParams(folder,view)
 {
	 nhor=0;
	 nver=0;
	 if (view=="pano")
	  {
	 	 ptcode="<param name=\"file\" value=\"ptviewer:0\"><param name=\"pano0\" value=\"{file="+folder+"/pano.jvr}{inits=ptviewer:moveTo(0,0,95,40);waitWhilePanning();startAutoPan(.4,0,1);}\">";
	 	}
	 else
	 	{
	 	 xpos=view.indexOf("x"); 
	 	 nhor=parseInt(view.substr(0,xpos)); 
	 	 nver=parseInt(view.substr(xpos+1));
		 ptcode="<param name=\"applet0\" value=\"{code=ptobject.class}{file="+folder+"/pano#.jvr}{nhor="+nhor+"}{nver="+nver+"}\"><param name=inits	value=\"ptviewer:startApplet(0)\">";
		}
   document.write(ptcode);
}
// ------------------------------------------------------------------------------------
function PanoThumbs (columns,user)
 {
 	  total=pano.length;
 	  tablecode="<table border='0' cellspacing='0' cellpadding='5' width='90%'>";
 	  rowcode="";
 	  column=0;
		for (var i = 0; i < total; i++)
     {
      if (pano[i][0]<=user) 
			 {
			 	if (rowcode=="") { rowcode = "<tr align='center'>";}
			 	if (column<columns)
			 	 {
			 	 	rowcode += "<script language='JavaScript'>PanoPreview("+i+")</script>";
			 	 }
			 	column++;
			 	if (column==columns)
			 	 {
			 	 	rowcode += "</tr>";
			 	 	tablecode+=rowcode;
			 	 	rowcode="";
			 	 	column=0;		 	  
			   }
			 }
     }
		if (column!=0)
		 {
			for (var j = column; j < columns; j++)
       {
         rowcode += "<td>&nbsp;</td>";
			 }
			rowcode += "</tr>";
	 	 	tablecode+=rowcode;
		 }
    tablecode+="</table>";
		document.write(tablecode);
}
// ------------------------------------------------------------------------------------
function PanoDescription(DisplayType,PanoTitle,PanoSound)
 {
var theDate=new Date()
 	if (PanoSound==1) {verb='and music are'} else {verb='is'}
  if (DisplayType==1) {htmlcode="<div align='center'><b><font class='small4'>"+PanoTitle+"</font></b><img src='1x1.gif' width='50' height='1'><font class=small2>Copyright &copy; 1999-"+theDate.getFullYear()+" Nicolas Miyamoto. All rights reserved.</font><br><font class='small5'>Please wait while the image "+verb+" loading ... Then click and drag the mouse in any direction or zoom using the <i>Shift</i> and <i>Ctrl</i> keys.</font></div></td>";}
  if (DisplayType==2) {htmlcode="<div align='center'><b><font class='small4'>"+PanoTitle+"</font></b><img src='1x1.gif' width='50' height='1'><font class=small2>Copyright &copy; 1999-"+theDate.getFullYear()+" Nicolas Miyamoto. All rights reserved.</font><br><font class='small5'>Please wait while the image "+verb+" loading ... Then click and drag the mouse in any direction or zoom using the <i>A</i> and <i>Z</i> keys.</font></div></td>";}
  if (DisplayType==3) {htmlcode="<div align='center'><b><font class='small3'>"+PanoTitle+"</b></font><br><font class=small2>Please wait while the image "+verb+" loading ...</font></div></td>";}
  return(htmlcode);
}
// ------------------------------------------------------------------------------------
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 MM_swapImageStatusBar() { //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];}
  return true;
}
// ------------------------------------------------------------------------------------
function OpenInfo() {
	window.open('http://www.360.mn/screencheck/','','width=600,height=600,menubar=no,scrollbar=no');
	return(false);
}
// ------------------------------------------------------------------------------------
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if (document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
//if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
//else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
//document.oncontextmenu=new Function("return false")
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------

