<!--
function goTo (target, targetURL) {
//alert("goTo " + target + " : " + targetURL);
   if ((target && targetURL) && (target.length>0) && (targetURL.length>0)) {
      if ((target=="_new") || (target=="_self")) {
 		this.location.replace(targetURL);
      } else if (target=="_parent") {
         if (document.parentWindow) {
   			document.parentWindow.document.location.replace(targetURL);
   		 } else if (parent.frames) {
   			parent.location.replace(targetURL);
   		 }
      } else if (target=="_top") {
		window.document.location.replace (targetURL);
      } else {
         if (document.parentWindow) {
   			document.parentWindow.parent.document.frames[target].location.replace(targetURL);
         } else if (parent.frames) {
   			parent.frames[target].location.replace(targetURL);
         }	
      }
   }
   return null;
}

function changeRows(targetFrame, iType) {
/* iType values:
 * Left Frame:
 * 0 - All frames visible
 * 1 - Topic frame max, all other hidden
 * Right Frame:
 * 0 - Content, tab and menu frames visible
 * 1 - Content visible; tab, menu frames hidden
 * 2 - Content and menu frames visible
 */
var r;
//alert("changeRows " + targetFrame + " : " + iType);
   if (targetFrame && targetFrame.length>0) {
      if (targetFrame == "Left") {
			if (iType == 0) r ="45,20,*,0,0,0"; // r = "45,20,*,0,0,0";			// Maximise Topic Frame
			if (iType == 1) r = "45,20,275,20,275,*";		// Show all frames
      } else if (targetFrame == "Right") {
		if (iType == 0) r = "45,33,20,*,17";			// Show all frames (53)
		if (iType == 1) r = "45,0,0,*,17";			// Maximise Content Frame
		if (iType == 2) r = "45,0,20,*,17";			// Show only menu and content frames
		if (iType == 3) r = "45,33,20,*,17";			// Tab size minus 20 (to exclude Version div)
      }      
      if (document.parentWindow) document.parentWindow.parent.document.getElementById(targetFrame).rows = r;
      else if (parent.document && parent.document.getElementById) parent.document.getElementById(targetFrame).rows = r;
      return true;
   } else {
      return false;
   }
}

function changeCols(targetFrame, iType) {
/* iType values:
 * 0 - Content visible
 * 1 - Content hidden
 */
var c="0,100%,0";
var sCols;

//alert("changeCols " + targetFrame + " : " + iType);
   //if (document.parentWindow) sCols = document.parentWindow.parent.document.Script.frames["Views"].cols;
   //if (sCols=="6%,0%,94%") c="0,100%,0";
   if (iType==0) c="0,100%,0";
   if (iType==1) c="6%,0,94%";

   if (targetFrame && targetFrame.length>0) { 
      if (document.parentWindow) document.parentWindow.parent.document.getElementById(targetFrame).cols = c;
      else if (parent.document && parent.document.getElementById) parent.document.getElementById(targetFrame).cols = c;

      if (c=="0,100%,0") {
	if (document.parentWindow) document.parentWindow.parent.document.frames["Content_Right"].location.replace ("<%=sFilePath%>/page_Blank.htm");
	else if (parent.frames) parent.frames["Content_Right"].location.replace("<%=sFilePath%>/page_Blank.htm");
      }
      return true;
   } else {
      return false;
   }
}

function getSourceElement(e) {
   if (window.event)
 	return window.event.srcElement;
   else if (e && e.target) {
	if (typeof e.target.nodeType == 'undefined') return e.target;
	else if (e.target.nodeType == 3) return e.target.parentNode;
   else
	return e.target;
   }
}

// Moved from Control/TreeView.js
function getAbsoluteTop (obj) {
	if (obj.tagName == 'FORM') {
		return 0;
	}
	else {
		absolute = getAbsoluteTop (obj.parentElement);

		result = absolute;

		if (obj.tagName == 'TABLE' || obj.tagName == 'TD' || obj.tagName == 'INPUT') {
		result = result + obj.offsetTop;
		}
		return result;
	}
}

function getAbsoluteLeft (obj) {
	if (obj.tagName == 'FORM') {
		return 0;
	}
	else {
		absolute = getAbsoluteLeft (obj.parentElement);

		result = absolute;

		if (obj.tagName == 'TABLE' || obj.tagName == 'TD' || obj.tagName == 'INPUT') {
		result = result + obj.offsetLeft;
		}
		return result;
	}
}
// --------------------------------

function MM_findObj(n, d) { //v4.01
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function openWindow(src, name, width, height, scroll) {
   window.open(src, name, "width=" + width + ",height=" + height + ",left=" + ((screen.width - width) / 2) + ",top=" + ((screen.height - height) / 2 - 40) + ",scrollbars=" + (scroll ? 1 : 0) + ",resizable=0,status=0").focus();
   return true;
}

function openURL(src) {
   window.open(src);
   return false;
}
function submitForm(_form) {
   if (_form) {
   	_form.submit();
   	return true;
   } else {
   	return false;
   }
}
function CopyURLToClipboard() {
// Found on www.infragistics.com
// 2006/02/24
// Copy URL to clipboard
	var theTextArea = document.getElementById('theClipBoardText');
	theTextArea.innerText = window.parent.frames["main"].location.href;;
	var copyObject = theTextArea.createTextRange();
	copyObject.execCommand("Copy");
}

function formatNumber(objC) {
    var strC = "";
    if (objC!=null) strC = objC.value;
    strC = addCommas(strC);
    objC.value = strC;
}

// Example implemention
/*
<html>
<head>
<title></title>
<script type="text/javascript">
function addCommas() {
var x = document.forms[0];
var objRegExp  = new RegExp('(-?[0-9]+)([0-9]{3})'); 
    while(objRegExp.test(x.fieldName.value)) {
       x.fieldName.value = x.fieldName.value.replace(objRegExp, '$1,$2');
    }
}
< / script >
//*/
/*
</head>

<body>
<form name="form1" method="post" action="">
  <input type="text" name="fieldName" onChange="return addCommas();">
  <input type="text" name="textfield">
</form>
</body>
</html>
*/

function addCommas(nStr) {
// Following code from
// http://www.mredkj.com/javascript/nfbasic.html
// 2006/03/23
// usage: 
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function addSeparatorsNF(nStr, inD, outD, sep) {
// Following code from:
// http://www.mredkj.com/javascript/nfbasic.html
// 2006/03/23
// To use addSeparatorsNF, you need to pass it the following arguments: 
// nStr: The number to be formatted, as a string or number. No validation is done, so don't input a formatted number. If inD is something other than a period, then nStr must be passed in as a string. 
// inD: The decimal character for the input, such as '.' for the number 100.2 
// outD: The decimal character for the output, such as ',' for the number 100,2 
// sep: The separator character for the output, such as ',' for the number 1,000.2 
// usage: 
	nStr += '';
	var dpos = nStr.indexOf(inD);
	var nStrEnd = '';
	if (dpos != -1) {
		nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);
		nStr = nStr.substring(0, dpos);
	}
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(nStr)) {
		nStr = nStr.replace(rgx, '$1' + sep + '$2');
	}
	return nStr + nStrEnd;
}

-->

