<!--//
////////////////////////////////////////////////////////////////////
// Globals
// Global variables and functions
// MODIFICATION HISTORY:
// 04/01/2003	mtb	MSA is being removed from the listing
//					The PropID array will now store the stateID rather than the MSAID
////////////////////////////////////////////////////////////////////
var m_strInvPropsText = new Array(300);
var m_intInvPropsID = new Array(300);
var m_intInvPropsQty = new Array(300);
var m_dblInvPropsValue = new Array(300);
var m_intInvPropsIndex= 0;

var m_strAssetClassText = new Array(300);
var m_intAssetClassID = new Array(300); // This needs to change to a C#S3 format to associate the same C with multiple S
var m_intAssetSubClassID = new Array(300);
var m_intAssetClassIndex= 0;


var g_intNonUSStateID = 0;
var g_blnHasCtryChange = false;

var g_sWebServer = location.hostname;
var g_bIsExtSvr;// Currently not used. Used an alternate method for now.

var MOPADMIN_MAILBOX  = '&#109;&#111;&#112;&#097;&#100;&#109;&#105;&#110;&#064;&#104;&#101;&#110;&#100;&#101;&#114;&#115;&#111;&#110;&#110;&#097;&#046;&#099;&#111;&#109;';

var isIE=document.all?true:false;
var isNS4=document.layers?true:false; 
var isNS6=navigator.userAgent.indexOf("Gecko")!=-1?true:false;
var isFireFox = navigator.userAgent.indexOf("Firefox")!=-1?true:false; // 08/26/2008	mtb	Adding FireFox test

//document.write('isFireFox = ' + isFireFox);

var LEFT_CORNER_ON  = 0;	//"../../MOP/images/tab_left_corner_on.gif" ,
var TOP_EDGE_ON  = 1;		//"../../MOP/images/tab_top_edge_on.gif",
var RIGHT_CORNER_ON = 2;	//"../../MOP/images/tab_right_corner_on.gif" ,
var LEFT_EDGE_ON  = 3;		//"../../MOP/images/tab_left_edge_on.gif" ,
var RIGHT_EDGE_ON  = 4;	//"../../MOP/images/tab_right_edge_on.gif" 

var LEFT_CORNER_OFF  = 5;	//"../../MOP/images/tab_left_corner_off.gif" ,
var TOP_EDGE_OFF  = 6;		//"../../MOP/images/tab_top_edge_off.gif",
var RIGHT_CORNER_OFF = 7;	//"../../MOP/images/tab_right_corner_off.gif" ,
var LEFT_EDGE_OFF  = 8;		//"../../MOP/images/tab_left_edge_off.gif" ,
var RIGHT_EDGE_OFF  = 9;	//"../../MOP/images/tab_right_edge_off.gif" 
//------------------------------------------------------
// getElementById function 
// moving to global.js so it can already be loaded when 
// UIElements.js loads. Also, moving UIElements.js before
// Common.js so the initLoad function is already present.
//------------------------------------------------------
function $(d){
	return document.getElementById(d);
}
function $Name(name){
	// Use this for arrays to get multiple elements.
	return document.getElementsByName(name);
}
function openScript(url, width, height, style) {
/*
==================================================================
openScript : Opens a new window.
Modification History:
09/19/2003	mtb Centering the window on screen
==================================================================
*/
	var h,w
	h = screen.height
	w = screen.width
	var l,t
	l = parseInt((w-width)/2)
	t = parseInt((h-height)/2)

	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no,left=' + l + ',top=' + t  );
}

function LTrim(str){
/*
==================================================================
LTrim(string) : Returns a copy of a string without leading spaces.
==================================================================
*/
/*
   PURPOSE: Remove leading blanks from our string.
   IN: str - the string we want to LTrim
*/
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      // We have a string with leading blank(s)...
      var j=0, i = s.length;

      // Iterate from the far left of string until we
      // don't have any more whitespace...
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;

      // Get the substring from the first non-whitespace
      // character to the end of the string...
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str){
/*
==================================================================
RTrim(string) : Returns a copy of a string without trailing spaces.
==================================================================
*/
/*
   PURPOSE: Remove trailing blanks from our string.
   IN: str - the string we want to RTrim

*/
   // We don't want to trip JUST spaces, but also tabs,
   // line feeds, etc.  Add anything else you want to
   // "trim" here in Whitespace
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      // We have a string with trailing blank(s)...
      var i = s.length - 1;       // Get length of string

      // Iterate from the far right of string until we
      // don't have any more whitespace...
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;

      // Get the substring from the front of the string to
      // where the last non-whitespace character is...
      s = s.substring(0, i+1);
   }

   return s;
}

function Trim2(str){
/*
=============================================================
Trim(string) : Returns a copy of a string without leading or trailing spaces
=============================================================
   PURPOSE: Remove trailing and leading blanks from our string.
   IN: str - the string we want to Trim
   RETVAL: A Trimmed string!
*/
   return RTrim(LTrim(str));
}
  	
// This method trims white space off both ends of this string and returns the result.
String.prototype.trim = function() 
{
  return( this.replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') ); 
}

function trim3(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function


function convertYesNo(blnValue){
	if(blnValue) 
		return 'Yes';
	else
		return 'No';
}

//-->