
var doOnce=0;
var win1 = null;
var theName = "win1";
var bgTbl = "#FFCC99";
var hiLite = "#FFDDAA";
function popWin(theFile,theName){
  // if (win1 && !win1.closed) {
   //   win1.close();
  // }
  win1=window.open(theFile,theName,"width=800,height=600,hotkeys=0,menubar=0,resizable=1");
  // win1.moveTo(0,0);
   win1.focus();
}
function popup(theFile,theName){
  // if (win1 && !win1.closed) {
   //   win1.close();
  // }
  win1=window.open('Maps/' + theFile,theName,"width=550,height=600,hotkeys=0,menubar=0,resizable=1");
  win1.moveTo(0,0);
  win1.focus();
}
function popJpg(theFile){
/*
   if (win1 && !win1.closed) {
      win1.close();
   }
  win1=window.open('jpg/' + theFile,theName,"width=350,height=541,hotkeys=0,menubar=0,resizeable=0");
    win1.moveTo(350,0);
*/
}
function closeWindow() {
/*
// alert("Closing Window");
     win1.close();
	 */
}


function setScreenSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    }
  }
 // window.alert( 'Width = ' + myWidth );
 // window.alert( 'Height = ' + myHeight );
  if( myWidth < 770){
  // alert(myWidth);
      if(doOnce==0)
	  {
	     doPopup();
	     doOnce=1;
	  }
      setSize();
   }
}
function setSize(){
  window.moveTo(0,0);
  window.resizeTo(810,600);
  } 
  
 closetime = 10; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds

function Start(URL, WIDTH, HEIGHT) {
windowprops = "left=50,top=50,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL, "preview", windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup() {
url = "800x800Required.htm";
width = 450;  // width of window in pixels
height = 200; // height of window in pixels
delay = 1;    // time in seconds before popup opens
timer = setTimeout("Start(url, width, height)", delay*1000);
} 

