/* FILE: controls3.js */
/* ------------------ */
/* A slightly different version of the controls file. It is handles the JPG */
/* files by transmitting two different JPG files                            */

function checkBrowser()
{
/* check browser version */ bversion=navigator.appVersion.split(".");
/* alert(bversion[0]); */
/* alert(navigator.appName); */
NAV=false;  /* assume no layer support, global variable */
if (navigator.appName == "Netscape" && bversion[0] >= 4)
 NAV=true;
}


function publish(dgnName)
{ 
format=document.control.format.options[document.control.format.options.selectedIndex].value;

/*alert("publish " + dgnName + format + "&republish=1");  */
/*self.location=(dgnName + format + "&republish=1");*/

if (format == ".jpg")
{
 self.location=(dgnName + format);
}
else
{
if ( BrowserVersionOK() ) self.location=("http://www.mvn.usace.army.mil/msp/pmap/" + dgnName + format);
}
}



function BrowserVersionOK()
{
/* this function will check which version of Netscape or Microsoft browser the */
/* user is executing. If it is not JDK 1.1 compatible, it will not let them    */
/* attempt to execute the JAVA Applet. If the browser is unknowm, the user is  */
/* prompted whether to execute or not                                          */

j = navigator.appVersion.indexOf(" ");
verNum = navigator.appVersion.substring(0,j);

if (navigator.appName.indexOf("Microsoft") == -1 &&
    navigator.appName.indexOf("Netscape") == -1)
   {
   if(confirm("Your browser is not Microsoft Internet Explorer Version 4.x or " +
         "Netscape Version 4.03+. \nIt must support Sun JDK Version 1.1 " +
         "or greater to execute this JAVA-based Viewer. \n\n" +
         "PROCEED WITH VIEWER LOAD ANYWAY?"))  
      {   
      return true;
      }
   else
      {
      return false;
      }
   }

if (navigator.appName == "Netscape" && verNum <= 4.02) 
   {
   alert("You are using Netscape Browser Version "  + verNum + "\n" +
         "You need Version 4.03 (w/ JDK patch) or greater to access this JAVA-based Viewer.\n" +
         "It can be downloaded from WWW.NETSCAPE.COM");  
   return false;
   }
if (navigator.appName.indexOf("Microsoft") > -1 && verNum < 4.0)
   {
   alert("You are using Microsoft Internet Explorer Version "  + verNum + "\n" +
         "You need Version 4.0 or greater to access this JAVA-based Viewer.\n" +
         "It can be downloaded from WWW.MICROSOFT.COM");  
   return true;
   }
return true;
}




function MouseEventOn() {document.onmouseup=MouseEvent;}

function MouseEvent(e) 
{
  strMesg = "You clicked the " 
  if (e.which == 1) strMesg += "left ";
  if (e.which == 3) strMesg += "right ";
  strMesg += "mouse button, at position x = " + e.pageX; 
  strMesg += ", y = " + e.pageY;
  alert(strMesg);
}

