/*  ***********************************************************************
Functions for browser detection and redirection if not up to par:
***************************************************************************
Requires GetIE.htm

SniffBrowser{)
versionNumber()
TestBrowser()

*/

function LoadFlash(fv1,fv2,fv3,fv4,fv5,fv6){ 
 document.write(fv1 + '\n');
 document.write(fv2 + '\n');
 document.write(fv3 + '\n');
 document.write(fv4 + '\n');
 document.write(fv5 + '\n');
 document.write(fv6 + '\n');
 document.write('</object>\n');
}

function SniffBrowser(){
/*  Sniffs the browser and returns "OK" if at least a 4.0 browser, which we need.
	If not, returns a message designed to put in an alert box.
*/
	browser = navigator.appName;
	var version = versionNumber();
// ** FOR TESTING **	var version =1
	if (browser == "Microsoft Internet Explorer"){	// Abbreviate if IE
		browser = "IE";
	}
	Big2Browser = (browser  == "Netscape" || browser == "IE");
	goIframe    = (browser == "IE" && version >= 4);

	var BrowserMessage  = "OK"; // "TEST";   
	
	if (!Big2Browser){
		BrowserMessage = "Your browser is " +browser+ ", which is a non-standard. Most web sites work best with Microsoft Internet Explorer or Netscape.";
	}else if (version <4){
		BrowserMessage = "You have version" +version+ " of " +navigator.appName+ ", which is quite old.  A free upgrade is available.";
	}

	return (BrowserMessage);
}

function versionNumber() {
  // return version number (e.g., 4.03)
  return parseFloat(navigator.appVersion)
}

function TestBrowser(){
	var browmess = SniffBrowser();
	if ( browmess != "OK") {
	   window.location = "http://www.vngroup.com/GetIE.htm";
	   alert(browmess
	       +"\n Your experience at Van Ness Group will be best using Microsoft Internet Explorer (IE)." 
         +"\n Click on the link begind this message to get the latest version of IE for free."
	       +"\n Then come back to vngroup.com.  We'll be waiting for you.")
	}
}

/* ****************************************************************************
Functions for Opening Browser Windows.
*******************************************************************************
These functions are designed to limit the total number of browser windows
open at one time, assuming you only open new windows using one of the following
functions.  They also ensure, when ever possible, that the user lands
in the newly opened window.  
*/

function BigPrivateWindow(theURL) {
	if (!window.Big_window||Big_window.closed) { 
		Big_window = window.open(theURL,"BigW","resizable,scrollbars,width=800,height=450");		
	}else{
		var whosthere = Big_window.location;
		if (whosthere != theURL) {
			Big_window.location = theURL;
		}
		Big_window.focus(); 
	}	
	Big_window.camefrom=self;
}

function SmallWindow(theURL) {
	if (!window.small_window||small_window.closed) { 
		small_window = window.open(theURL,"smallw","scrollbars,width=400,height=300");
	}else{
		small_window.location =theURL;
		small_window.focus();
	}	
	small_window.camefrom = self;
	small_window.mainwin  = window.camefrom;
}

/*  BigWindow() is used for opening a window into another Web site.
		Always use BigPrivateWindow() for opening a big window into our own site.
*/
function BigWindow(theURL) {
	if (!window.Big_window||Big_window.closed) { 
		Big_window = window.open(theURL,"BigW","location,status,resizable,scrollbars,width=800,height=580");	
	}else{
		Big_window.location =theURL;
		window.blur();

// Seems to cause problems with NS4 and IE4 and when URL is not on this Web
//		Big_window.focus(); 
	}	
}

function MovieWindow(theURL) { // Play a movie in a window slightly larger than BigWindow
	Movie_window = window.open(theURL,"MovieW","resizable,scrollbars,width=790,height=500");
	Movie_window.camefrom = self;	
	Movie_window.focus();
}

onMenu = ""; // in case user rolls over a menu before everything loads.
RollOver=0;  // Tells us whether user has rolled over any menu items.
oStatus="";

function ShowStatus(theMess){
 if (document.entryform){
  if (document.entryform.DisplayStatus){
   document.entryform.DisplayStatus.value=theMess;
  }
 }
 oStatus = window.status;
 window.status = theMess;
 return true;
}

function RestoreStatus(){
 if (document.entryform){
  if (document.entryform.DisplayStatus){
   document.entryform.DisplayStatus.value=oStatus;
  }
 }
 window.status = oStatus;
 return true;
}

