


// ****************************************************************************************************************************************************************
var wOpen = null;
// ****************************************************************************************************************************************************************


// Page Header
var header = new Image(316, 59);           		// main header width and height
header.src = "images/headerface.gif";  			// main header source (name)

var timeW;
var cFlg = false;

// ****************************************************************************************************************************************************************
// ****************************************************************************************************************************************************************
// ****************************************************************************************************************************************************************
//  Body Tag onLoad (Home Page, pfan, etc)
function LoadedLinks() {  		// Execution Starts Here -- called from onLoad() in body tag of HTML document

	if ( (navigator.appName == "Microsoft Internet Explorer")  &&  (navigator.userAgent.indexOf("Opera") == -1) ) {
    	LoadText.innerText = "";  // remove Page Loading messages from document
	} // end if

	fflag = true;				  // window loaded 
	
	
	//LoadBlankWindow();			// 06/04/2010 3/2010
} // end function LoadedLinks()
// ****************************************************************************************************************************************************************


/* SAVE FOR NOW
// 06/04/2010 ***************************** Not Used ***************************
// 3/2010 Fix get focus on new tab window
function LoadBlankWindow() {
	if ( (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Win") != -1) ) {  // using IE stuff
		wOpen = window.open("", "marw1", "left=15,screenX=15,top=0,screenY=0,scrollbars=yes,menubar=yes,title=yes,titlebar=yes,status=yes,location=yes,locationbar=yes,resizable=yes,toolbar=yes");
	} // end if
	
	
	else if ( (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Firefox") != -1) ) {  // using Firefix stuff
		wOpen = window.open("", "marw1");
	} // end else if
	
	
	if (wOpen && !wOpen.closed)  {				// 06/04/2010
		wOpen.window.close();
		wOpen = null;
	} // end if
} // end function LoadBlankWindow()
*/

// ****************************************************************************************************************************************************************
function UnLoad() {																// 12/14/2010
	if (wOpen && !wOpen.closed)  {
		wOpen.window.close();
		wOpen = null;
	} // end if
} // end function UnLoad()




// Both sitemap and pfan, etc
function BringTop(marwName)  {

	//if (wOpen && !wOpen.closed)  {						// KEEP !!!!!!!!!!
	//	wOpen.window.close();
	//} // end if
	
	if (wOpen && !wOpen.closed)  {
		wOpen.window.close();
		wOpen = null;
	} // end if

   // **********************************************************************
   //Save get Browser Info
   // **********************************************************************

	//alert(navigator.appName);							
   	//alert(navigator.userAgent);
   
   
   	//var temp;
   
   	//for (var propname in navigator) {
	//   temp += propname + ": " + navigator[propname] + "\n";
   	//} // end test for
   
	//alert (temp);
   
   // **********************************************************************
 
	if ( (navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Win") != -1) ) {  // using IE stuff
		wOpen = window.open(marwName, "marw1", "alwaysRaised=yes,left=15,screenX=15,top=0,screenY=0,scrollbars=yes,menubar=yes,title=yes,titlebar=yes,status=yes,location=yes,locationbar=yes,resizable=yes,toolbar=yes");
		//wOpen = window.open(marwName, "marw1");
	} // end if
   
   
	else if ( (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Firefox") != -1) ) {  // using Firefix stuff
		wOpen = window.open(marwName, "marw1");
	} // end else if
   
   
	else if ( (navigator.appName == "Netscape" && navigator.userAgent.indexOf("Safari") != -1) ) {  // using Safari stuff
		wOpen = window.open(marwName, "marw1", "alwaysRaised=yes,scrollbars=yes,menubar=yes,title=yes,titlebar=yes,status=yes,location=yes,locationbar=yes,resizable=yes,toolbar=yes");
	}// end else
   
   
	else { 
		wOpen = window.open(marwName, "marw1", "alwaysRaised=yes,scrollbars=yes,menubar=yes,title=yes,titlebar=yes,status=yes,location=yes,locationbar=yes,resizable=yes,toolbar=yes");
	}// end else
   
   
	wOpen.focus();
	return false;
} // end function BringTop()



// ****************************************************************************************************************************************************************
function Loadsite(x, marwName)  {
  LoadArray();					// Indicate with a checkmark Site has been viewed ****NOTE: Routine is located at end of document HTML ***************************
  
   amark[x].src = check.src; 
   track[x] = true;
   
   BringTop(marwName);			// 03/12/2010
} // end function Loadsite()





// ****************************************************************************************************************************************************************

function Wait()   {									// Make sure everything is loaded
     if (cFlg == true)  {
	   clearTimeout(timeW);
	   cFlg = false;
	 } // end if
	 
	 // Make sure all images are loaded
	 fflag = true;  								// window loaded (set to false at top of HTML document)
	 document.header.src = header.src;
	 
	 for ( var i = 1; i<lastMark+1; i++)  {
	    document.images["mark" + i].src = uncheck.src; 
     } // end for
	   
	 if ( (navigator.appName == "Microsoft Internet Explorer")  &&  (navigator.userAgent.indexOf("Opera") == -1) )  {
       LoadText.innerText = "";  					// remove Page Loading messages from document
	 } // end if
	 
	//if ( (navigator.appName == "Microsoft Internet Explorer" &&
      //   navigator.userAgent.indexOf("Win") != -1) ) {  // using IE stuff
   		//window.moveTo(0, 0);
 	//} // end if
	
} // end function Wait()
// ****************************************************************************************************************************************************************

function PlaceCheck(x, marwName)  {

 if (fflag == true)  {  							// window loaded

     if (cFlg == true)  {
	   clearTimeout(timeW);
	   cFlg = false;
	 } // end if
	 
     Loadsite(x, marwName); 						 // load site in another window
	 
  } // end if window loaded

 else  {
    alert("Please wait: Site not loaded yet.");
	timeW = setTimeout("Wait()", 4000);				// Wait then make sure everything is loaded
	//timeW = setTimeout("Wait()", 2000);				// 06/04/2010 Wait then make sure everything is loaded
	//alert("Line 183: HERE");
	cFlg = true;									// flag to call "Wait()" only once
  } // end else
 

} // end function PlaceCheck()


// ****************************************************************************************************************************************************************

