function popupBasedOnInnerDimensions() {
   bump = open("about:blank","bump","width=100,height=100,locationbar=no,menubar=no,resizable=yes,scrollbars=no");
	bump.opener = window;	//for browser that don't know the opener op
	bump.focus();
}



var WINDOWFRAMEHORIZONTAL = 0;
var WINDOWFRAMEVERTICAL = 0;
var screenWidth = screen.width;
var screenHeight = screen.height;
var BROWSERMESSAGE;




switch(true)   {
   case (navigator.appName=="Microsoft Internet Explorer" && navigator.platform=="Win32"):
      WINDOWFRAMEHORIZONTAL=27;   
      WINDOWFRAMEVERTICAL=13;
      BROWSERMESSAGE="the web designers's nightmare! check out http://www.betterbrowser.org";
      break;
   case (navigator.appName=="Microsoft Internet Explorer" && navigator.platform=="MacPPC"):
      WINDOWFRAMEHORIZONTAL=0;
      WINDOWFRAMEVERTICAL=0;
      BROWSERMESSAGE="well, at least it can handle transparent pngs.";
      break;
   case (navigator.appName=="Netscape" && navigator.platform=="MacPPC"):
      WINDOWFRAMEHORIZONTAL=0;
      WINDOWFRAMEVERTICAL=3;
      BROWSERMESSAGE="good, choice.";
      break;
   case (navigator.appName=="Netscape" && navigator.platform=="Win32"):
      WINDOWFRAMEHORIZONTAL=25;
      WINDOWFRAMEVERTICAL=9;
      BROWSERMESSAGE="the browser: good choice. but the os?";
      break;
	case (navigator.appName=="Netscape" && navigator.platform.substr(0,5)=="Linux"):
      WINDOWFRAMEHORIZONTAL=2;   
      WINDOWFRAMEVERTICAL=0;
      BROWSERMESSAGE="Congratulations!";
      break;
   default:
      WINDOWFRAMEHORIZONTAL=25;
      WINDOWFRAMEVERTICAL=10;
      BROWSERMESSAGE="Don't know about that...";
}
var BROWSERINFO = navigator.appName+" "+parseInt(navigator.appVersion.substring(0,1))+" | "+navigator.platform+" | "+BROWSERMESSAGE;
window.defaultStatus = BROWSERINFO;
/*
bump = open("/install/blank.htm","bump","width="+100+",height="+100+",locationbar=no,menubar=no,resizable=yes,scrollbars=no");
bump.opener = window;	//for browser that don't know the opener op
bump.close();
bump.opener.focus();
*/
function init()   {
window.moveTo(0,0);
window.resizeTo(screen.width - 50,screen.height -50);
//window.setTimeout("hide_messages()",2000);
}
function hide_messages()   {
   hide_div("message");
}
function hide_div(id)	{
	if(document.getElementById)   {
      var myElement = document.getElementById(id);
      myElement.style.visibility = "hidden";
   }
}
function show_div(id)	{
	if(document.getElementById)   {
      var myElement = document.getElementById(id);
      myElement.style.visibility = "visible";
   }
}
function next(index)   {
   index = (index+1<FILES.length)? index+1 : 0;
   popUpThumb(index);
   return index;   
}
function previous(index)   {
   index = (index-1>=0)? index-1 : FILES.length-1;
   popUpThumb(index);
   return index;
}
function dirname(path)   {
   for(i=path.length;i>=0;i--)   {
      if(path.substr(i,1) == "/")   {
          break;
      }
   }
   return path.substr(0,i);
}
function popUpThumb(index)   {
   imgsrc=SOURCE + FILES[index][0];
   imgwidth = parseInt(FILES[index][1]);
   imgheight = parseInt(FILES[index][2]); 
   width=(imgwidth + WINDOWFRAMEHORIZONTAL<=screen.width - 50)? imgwidth + WINDOWFRAMEHORIZONTAL : screen.width - 50;
   height=(imgheight + WINDOWFRAMEVERTICAL < screen.height - 50)? imgheight + WINDOWFRAMEVERTICAL : screen.height - 50;   
   x=Math.floor((screen.width - width)/2);
   y=Math.floor((screen.height - height)/2);
   
   //alert(width + "/" + height);
   img = new Image(imgwidth,imgheight);
   img.src = imgsrc;
   
   mapCode = "<map name=\"remotecontrol\"><area shape=\"rect\" coords=\"0,0,"+Math.floor(imgwidth/2)+","+imgheight+"\" href=\"javascript:opener.previous("+index+");\" alt=\"previous\"><area shape=\"rect\" coords=\""+Math.floor(imgwidth/2)+",0,"+imgwidth+","+imgheight+"\" href=\"javascript:opener.next("+index+");\" alt=\"next\"></map>";
   
   bump = open("","bump","width="+32+",height="+32+",screenX="+x+",screenY="+y+"locationbar=no,menubar=no,resizable=yes,scrollbars=no,status=no");
	bump.opener = window;	//for browser that don't know the opener op
   bump.document.open();
   bump.document.write("<html><head><title>"+dirname(FILES[index][0])+"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"/install/photodump_styles.css\" /></head><body style=\"margin:0;padding:0;\" onload=\"moveTo("+x+","+y+");\"><script type=\"text/JavaScript\">window.resizeTo("+width+","+height+")</script>"+mapCode+"<img usemap=\"remotecontrol\" border=\"0\" src=\""+imgsrc+"\" width=\"100%\" height=\"100%\" border=\"0\"/></body></html>");
   bump.document.close();
   bump.focus();
}
