//**************************************************************
//		
//		BWI Site Functions
//
//	Updated: 11/2003 Mike Wirsching
//	Updated: 11/12/2003 F. P. Briand
//
// These generics functions provide basic manipulations
//
//**************************************************************

//**************** Error Handling ****************

  function report_error(msg, url, line) {

	alert ('Javascript Error:\n' + msg + '\n' + 'on page: ' + url + '\n' + 'at line: ' + line);

	return;
  } 


//**************** Frame Manipulators **************** 

  function openMap(){

	top.BWI_SITE.cols="250px,100%";

	return;
  }

  function closeMap(){

	top.BWI_SITE.cols="0px,100%";

	return;
  }
	
//**************** DIV Toggle Functions ************************

//Toggle text division open and closed
  function toggle(sMod) {

	if (sMod.style.display == "none") {
		sMod.style.display = "";
	} else sMod.style.display = "none";

	return;
  }

//**************** New Window Functions ************************

  function showNewWnd (sLocURL, sWndName, sType) {
  // This page provide annotation [new window].

	//Set Up Window Parameters
	var wndStep;	// = null window object
	var wndArgs;	// window adornments + position
	var wndAdorn;	// window adornments is adjusted for each case
	var wndPos;	// window position is adjusted for each case

	//Apply style
	switch (sType) {

		case "SIZE1":
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes";
			wndPos = "top=50px,left=300px,height=500px,width=500px";
			break;
		case "SIZE2":
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes";
			wndPos = "top=150px,left=300px,height=250px,width=500px";
			break;
		case "SIZE3":
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes";
			wndPos = "top=50px,left=250px,height=550px,width=800px";
			break;
		case "NOSIZE1":
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no";
			wndPos = "top=100px,left=100px,height=550px,width=580px";
			break;
		case "NOSIZE2":
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no";
			wndPos = "top=100px,left=100px,height=650px,width=800px";
			break;
		default:
			sWndName  = "Default Annotation"
			wndAdorn = "toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes";
			wndPos = "top=50px,left=50px,height=700px,width=1000px";
			break;
	  }

	wndArgs = wndAdorn + "," + wndPos;
	wndStep = window.open(sLocURL,sWndName,wndArgs);
	wndStep.focus();

	return;
  }

