	/************************************************************************************
	*** START GLOBAL VARIABLES **********************************************************
	************************************************************************************/
	
	/* Browser Checks */
	var ns4 = document.layers;
	var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1);
	var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1);
	var agt = navigator.userAgent.toLowerCase();
	var mac = (agt.indexOf("mac")!=-1);
	var ie = (agt.indexOf("msie") != -1); 
	var mac_ie = mac && ie;

	var lightbox_pageScrollX;
	var lightbox_pageScrollY;
	var lightbox_bIsOpen;

	// XMLHttpRequest Object
	var http = createRequestObject();

	/************************************************************************************
	*** END GLOBAL VARIABLES ************************************************************
	************************************************************************************/	

	
	function lightbox_OpenFind(windowTitle, windowText, sql_id, sql_version, sql_revision, cat_id, db_extra, filter, primary_key, order_by, columns, search_columns, fields, closeFunction, css, draw_styles, classic_style, querystring, popwidth, popheight, isMgrFront) {
		lightbox_pageScrollX = document.body.scrollLeft;
		lightbox_pageScrollY = document.body.scrollTop;
		lightbox_bIsOpen = true;

		document.getElementById('lightbox').style.width=popwidth + 'px';
		document.getElementById('lightbox').style.height=popheight + 'px';

		document.getElementById('lightbox_lostfocus').style.display = 'block';
		document.getElementById('lightbox').style.display = 'block';

		lightbox_Position();

		var mgrPrefix = '';

		if (isMgrFront==true){
			mgrPrefix = 'mgr_';
		}

		document.getElementById('lightbox_search_results').innerHTML =
			'<iframe scrolling="yes" frameborder="0" width="100%" height="100%" marginheight="5" marginwidth="5" src="' + 
				'i_i_' + mgrPrefix + 'find_data_lightbox.asp' +
				'?sql_id=' + sql_id + 
				'&version='	+ sql_version +
				'&revision=' + sql_revision +
				'&cat_id=' + cat_id +
				'&extrafields=' + URLEncode(db_extra) +
				'&filter=' + filter +
				'&orderby=' + order_by +
				'&cols=' + columns +
				'&searchcols=' + search_columns +
				'&fields=' + fields +
				'&func=' + URLEncode(closeFunction) +
				'&css=' + URLEncode(css) +
				'&drawstyles=' + draw_styles +
				'&classicstyle=' + classic_style +
				'&primary=' + primary_key +
				querystring +
			'"></iframe>';
		document.getElementById('lightbox_search_section').style.display='none';
		document.getElementById('lightbox_header').innerHTML=windowTitle;
		document.getElementById('lightbox_desc').innerHTML=windowText;

		// Fix IE for DTD 4.0

		if (ie && document.documentElement && document.compatMode == 'CSS1Compat') {
			document.getElementById('lightbox_search_results_container').style.height = (document.getElementById('lightbox_search_results_container').offsetHeight - 1 - (document.getElementById("lightbox_header").offsetHeight + document.getElementById("lightbox_desc").offsetHeight + document.getElementById("lightbox_search_section").offsetHeight)) + 'px';
		}		

		document.getElementById('lightbox_lostfocus').style.visibility = 'visible';
		document.getElementById('lightbox').style.visibility = 'visible';

	}	
	
	function lightbox_LostFocus(){
		lightbox_bIsOpen = false;
		document.getElementById('lightbox_lostfocus').style.visibility='hidden';
		document.getElementById('lightbox').style.visibility='hidden';
		document.getElementById('lightbox_lostfocus').style.display='none';
		document.getElementById('lightbox').style.display='none';
	}

	function lightbox_setFindValue(values, fields, types, closeFunction) {
		lightbox_LostFocus();
		aFields = fields.split('~');
		aValues = values.split('~');
		aTypes = types.split('~');
		for (var i=0; i<aFields.length; i++){
			if (aFields[i] != '') {
				document.getElementById(aFields[i]).value = aValues[i];
			}
		}

		if (trim(closeFunction) != '') {
			window.setTimeout(closeFunction , 1);
		}
	}

	function lightbox_GetWindowHeight() {
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			}
			else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}
	function lightbox_GetWindowWidth() {
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
			}
			else {
				if (document.body && document.body.clientWidth) {
					windowWidth = document.body.clientWidth;
				}
			}
		}
		return windowWidth;
	}
	
	function lightbox_Position() {
		if (document.getElementById) {
			var windowHeight = lightbox_GetWindowHeight();
			var windowWidth = lightbox_GetWindowWidth();

			var contentElement = document.getElementById('lightbox');
			var contentHeight = contentElement.offsetHeight;
			var contentWidth = contentElement.offsetWidth;
			var scrollTop;
			var scrollLeft;
			if (document.documentElement && document.documentElement.scrollTop) {
				// IE6 +4.01
				scrollTop = document.documentElement.scrollTop;
				scrollLeft = document.documentElement.scrollLeft;
			} else if (document.body) {
				// IE5 or DTD 3.2
				scrollTop = document.body.scrollTop;
				scrollLeft = document.body.scrollLeft;
			}

			document.getElementById('lightbox').style.top = ((windowHeight / 2) - (contentHeight / 2)) + scrollTop + 'px';
			document.getElementById('lightbox').style.left = ((windowWidth / 2) - (contentWidth / 2)) + scrollLeft + 'px';
			document.getElementById('lightbox_lostfocus').style.width = windowWidth + 'px'
			document.getElementById('lightbox_lostfocus').style.height = windowHeight + 'px'
			/*
			document.getElementById('lightbox_lostfocus').style.top = scrollTop + 'px';
			document.getElementById('lightbox_lostfocus').style.left = scrollLeft + 'px';
			*/

		}
	}
	window.onload = function() {
		lightbox_Position();
	}
	window.onresize = function() {
		lightbox_Position();
	}

	window.onscroll = function() {
		if (lightbox_bIsOpen) {
			if (document.documentElement && document.documentElement.scrollTop) {
				// IE6 +4.01
				document.documentElement.scrollTop = lightbox_pageScrollY;
				document.documentElement.scrollLeft = lightbox_pageScrollX;
			} else if (document.body) {
				// IE5 or DTD 3.2
				document.body.scrollTop = lightbox_pageScrollY;
				document.body.scrollLeft = lightbox_pageScrollX;
			}
			
			lightbox_Position();
		}
	}

	
	/************************************************************************************
	*** START MULTI SELECT SCRIPTS ******************************************************
	*************************************************************************************/

	function AddMSBOptions(theSel, theText, theValue){
	  var newOpt = new Option(theText, theValue);
	  var selLength = document.getElementById(theSel).length;
	  document.getElementById(theSel).options[selLength] = newOpt;
	}

	function DeleteMSBOptions(theSel, theIndex){
	  var selLength = document.getElementById(theSel).length;
	  if(selLength>0)
	  {
		document.getElementById(theSel).options[theIndex] = null;
	  }
	}

	function MoveMSBOptions(theSelFrom, theSelTo, box, strSpacer, bUsePos){

	  var selLength = document.getElementById(theSelFrom).length;
	  var selectedText = new Array();
	  var selectedValues = new Array();
	  var selectedCount = 0;

	  var i;

	  // Find the selected Options in reverse order
	  // and delete them from the 'from' Select.
	  for(i=selLength-1; i>=0; i--)
	  {
		if(document.getElementById(theSelFrom).options[i].selected)
		{
		  selectedText[selectedCount] = document.getElementById(theSelFrom).options[i].text;
		  selectedValues[selectedCount] = document.getElementById(theSelFrom).options[i].value;
		  DeleteMSBOptions(theSelFrom, i);
		  selectedCount++;
		}
	  }

	  // Add the selected text/values in reverse order.
	  // This will add the Options to the 'to' Select
	  // in the same order as they were in the 'from' Select.
	  for(i=selectedCount-1; i>=0; i--)
	  {
		AddMSBOptions(theSelTo, selectedText[i], selectedValues[i]);
	  }
		MSBDuplicator(box, strSpacer, bUsePos);

	}


	function MSBSwap(option1, option2){
		var holdval;
		holdval				= option1.value;
		option1.value		= option2.value;
		option2.value		= holdval;
		holdval				= option1.text;
		option1.text		= option2.text;
		option2.text		= holdval;
		holdval				= option1.selected;
		option1.selected	= option2.selected;
		option2.selected	= holdval;
	}

	function MoveMSBItemUp(box, strSpacer, bUsePos)  {
		//find the index of the item selected
		var len = document.getElementById(box + '_visible').options.length;
		if(len==0) return false;
		if (document.getElementById(box + '_visible').options[0].selected) { return true; }
		for(var i=1; i<len; i++) {
			if (document.getElementById(box + '_visible').options[i].selected) {
				MSBSwap(document.getElementById(box + '_visible').options[i], document.getElementById(box + '_visible').options[i-1]);
			}
		}

		MSBDuplicator(box, strSpacer, bUsePos);
		return true;
	}

	function MoveMSBItemDown(box, strSpacer, bUsePos)  {
		//find the index of the item selected
		var len = document.getElementById(box + '_visible').options.length;
		if(len==0) return false;
		len -= 1;
		if (document.getElementById(box + '_visible').options[len].selected) { return true; }

		for(var i=len-1; i>=0; i--) {
			if (document.getElementById(box + '_visible').options[i].selected) {
				MSBSwap(document.getElementById(box + '_visible').options[i], document.getElementById(box + '_visible').options[i+1]);
			}
		}

		MSBDuplicator(box, strSpacer, bUsePos);
		return true;
	}

	function MSBDuplicator(field, strSpacer, bUsePos){
	  var len = document.getElementById(field + '_visible').length;

	  var i;
	  var strValue = "";
	  var bFirst = true;

	  for(i=0; i<len; i++) {
		if (!bFirst) {
		  strValue = strValue + strSpacer
		}
		bFirst = false;
		strValue = strValue + document.getElementById(field + '_visible').options[i].value;
		if (bUsePos=='True'){
			strValue = strValue + '|' + i;
		}
	  }
	  document.getElementById(field).value = strValue;
	}

	/************************************************************************************
	*** END MULTI SELECT SCRIPTS ********************************************************
	*************************************************************************************/


	/************************************************************************************
	*** START MULTI INPUT SCRIPTS *******************************************************
	*************************************************************************************/

	function GetSelectedIndex(box)  {
		//find the index of the item selected
		var len = box.options.length;
		for(var i=0; i<len; i++) {
			if (box.options[i].selected) {
				return i;
			}
		}
	}

	function GetCheckedIndex(box)  {
		return parseInt(right(box.id,1));
	}

	// Return value of checked element in a group of radio buttons
	function getCheckedValue(radioId) {
		var radioObj = document.forms[0].elements[radioId];
		if(!radioObj)
			return "";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "";
	}

	// Check the first radio button in a group of radio buttons.
	function resetCheckedValue(radioName) {
		var radioObj = document.forms[0].elements[radioName];
		if(!radioObj)
			return;
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			radioObj.checked = true;
			return;
		}
		radioObj[0].checked = true;
	}


	// Check a radio button given a value
	function setCheckedValue(radioName, radioValue) {
		var radioObj = document.forms[0].elements[radioName];
		if(!radioObj)
			return;
		var radioLength = radioObj.length;
		if(radioLength == undefined) {
			if(radioObj.value == radioValue)
				radioObj.checked = true;
			return;
		}
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].value == radioValue) {
				radioObj[i].checked = true;
				return;
			}
		}
	}

	// Add Option to Select
	function addOption(theSel, theText, theValue){
		var newOpt = new Option(theText, theValue);
		var selLength = document.getElementById(theSel).length;
		document.getElementById(theSel).options[selLength] = newOpt;
	}

	// Edit Option in Select
	function editOption(theSel, theText, theValue){
		var len = document.getElementById(theSel).options.length;
		if(len==0) return;
		for(var i=0; i<len; i++) {
			if (document.getElementById(theSel).options[i].selected) {
				document.getElementById(theSel).options[i].value = theValue;
				document.getElementById(theSel).options[i].text = theText;
				return;
			}
		}
	}

	// Delete Option from Select
	function deleteOption(theSel, theIndex){
		var selLength = document.getElementById(theSel).length;
		if(selLength>0) {
			document.getElementById(theSel).options[theIndex] = null;
		}
	}

	// Copy the values from a select box to its corrosponding hidden field
	function duplicate(duplicate, spacer){
	  var len = document.getElementById(duplicate + '_visible').length;

	  var i;
	  var strValue = "";
	  var bFirst = true;

	  if (left(spacer, 1)=='*'){
		strValue = '<?xml version="1.0" encoding="utf-8"?><' + right(spacer, spacer.length - 1) + ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">';
	  }

	  for(i=0; i<len; i++) {
		if ((!bFirst)&&(left(spacer, 1)!='*')) {
		  strValue = strValue + spacer
		}
		bFirst = false;
		strValue = strValue + document.getElementById(duplicate + '_visible').options[i].value;
	  }

	  if (left(spacer, 1)=='*'){
		strValue = strValue + '</' + right(spacer, spacer.length - 1) + '>';
	  }

	  document.getElementById(duplicate).value = strValue;
	}


	// Swap two option in a select box
	function swap(option1, option2){
		var holdval;
		holdval				= option1.value;
		option1.value		= option2.value;
		option2.value		= holdval;
		holdval				= option1.text;
		option1.text		= option2.text;
		option2.text		= holdval;
		holdval				= option1.selected;
		option1.selected	= option2.selected;
		option2.selected	= holdval;
	}

	// Move option(s) up in select box
	function BumpUp(box, spacer)  {
		//find the index of the item selected
		var len = document.getElementById(box + '_visible').options.length;
		if(len==0) return false;
		if (document.getElementById(box + '_visible').options[0].selected) { return true; }
		for(var i=1; i<len; i++) {
			if (document.getElementById(box + '_visible').options[i].selected) {
				swap(document.getElementById(box + '_visible').options[i], document.getElementById(box + '_visible').options[i-1]);
			}
		}
		duplicate(box, spacer);
		return true;
	}

	// Move option(s) down in select box
	function BumpDown(box, spacer)  {
		//find the index of the item selected
		var len = document.getElementById(box + '_visible').options.length;
		if(len==0) return false;
		len -= 1;
		if (document.getElementById(box + '_visible').options[len].selected) { return true; }

		for(var i=len-1; i>=0; i--) {
			if (document.getElementById(box + '_visible').options[i].selected) {
				swap(document.getElementById(box + '_visible').options[i], document.getElementById(box + '_visible').options[i+1]);
			}
		}
		duplicate(box, spacer);
		return true;
	}

	/************************************************************************************
	*** END MULTI INPUT SCRIPTS *********************************************************
	************************************************************************************/


	/************************************************************************************
	*** START RESIZE FUNCTIONS **********************************************************
	************************************************************************************/

	var objMouseX = 0;
	var objMouseY = 0;
	var mouseX = 0;
	var mouseY = 0;
	var tempX = 0;
	var tempY = 0;
	var sizeX = 0;
	var sizeY = 0;
	var resizeDirection = '';
	var currentObj = '';
	var initialSizes = new Array();
	var firstResize = new Array();

	function addResizer(id, dir) {
		if (dir == '' || dir == undefined)
			dir = 'se';

		var table = document.createElement('table');
		table.cellPadding = 0;
		table.cellSpacing = 0;
		
		var tbody = document.createElement("tbody");
		table.appendChild(tbody)

		var tr = document.createElement("tr");
		tbody.appendChild(tr);

		var container = document.createElement("td");
		container.id = id + '-container';
		tr.appendChild(container);

		if (dir == 'e' || dir == 'se') {		
			var td = document.createElement("td");
			td.className = "resize-e";
			td.id = id + '-resize-e';
			td.innerHTML = '<div style="width:6px; height: 6px; font-size: 1px;">&nbsp;</div>'
			tr.appendChild(td);
		}

		if (dir == 's' || dir == 'se') {	
			tr = document.createElement("tr");
			tbody.appendChild(tr);

			td = document.createElement("td");
			td.className = "resize-s";
			td.id = id + '-resize-s';
			td.innerHTML = '<div style="width:6px; height: 6px; font-size: 1px;">&nbsp;</div>'
			tr.appendChild(td);

			if (dir == 'se') {
				td = document.createElement("td");
				td.className = "resize-se";
				td.id = id + '-resize-se';
				td.innerHTML = '<div style="width:6px; height: 6px; font-size: 1px;">&nbsp;</div>'
				tr.appendChild(td);
			}
		}

		resizeSurround(document.getElementById(id), table, container);

		document.body.onmousemove = function(e) { resizeObject(e) };
		document.body.onmouseup = resizeRelease;
		try {document.getElementById(id + '-resize-e').onmousedown = function(e) { grabResize(id, 'e', e) } } catch(err) {};
		try {document.getElementById(id + '-resize-s').onmousedown = function(e) { grabResize(id, 's', e) } } catch(err) {};
		try {document.getElementById(id + '-resize-se').onmousedown = function(e) { grabResize(id, 'se', e) } } catch(err) {};

		firstResize[id] = true;
	}

	function resizeSurround(oldElement, newElement, container){
		var tempElement = oldElement
		oldElement.parentNode.replaceChild(newElement, oldElement);
		container.appendChild(tempElement);
	}


	function resizeRelease() {
		currentObj = '';
		resizeDirection = '';
		tempX = 0;
		tempY = 0;
		sizeX = 0;
		sizeY = 0;
	}

	function resizeObject(e) {
		getMouseXY(e);

		if (resizeDirection == 'e' || resizeDirection == 'se') {
			if (sizeX + (mouseX - tempX) >= initialSizes[currentObj.id][0])
				currentObj.style.width = (sizeX + (mouseX - tempX)) + 'px';
			else
				currentObj.style.width = initialSizes[currentObj.id][0]
			clearSelection();
		}

		if (resizeDirection == 's' || resizeDirection == 'se') {
				if (isNaN(parseInt(currentObj.rows))) {
					if (sizeY + (mouseY - tempY) / 13 < 1)
						currentObj.size = 1;
					else
						currentObj.size = (sizeY + (mouseY - tempY) / 13);
				}
				else
					if (sizeY + (mouseY - tempY) >= initialSizes[currentObj.id][1])
						currentObj.style.height = (sizeY + (mouseY - tempY)) + 'px';
					else
						currentObj.style.height = initialSizes[currentObj.id][1]

			clearSelection();
		}
	}

	function grabResize(objectId, resizeDir, e) {
		currentObj = document.getElementById(objectId);
		if (firstResize[objectId]) {
			initialSizes[objectId] = [findSize(currentObj)[0], findSize(currentObj)[1]];
		}
		firstResize[objectId] = false;

		resizeDirection = resizeDir;
		tempX = getMouseXY(e)[0];
		tempY = getMouseXY(e)[1];
		sizeX = findSize(currentObj)[0];
		sizeY = findSize(currentObj)[1];
		clearSelection();
	}

	function getMouseXY(e) {
		if (e == undefined) e = window.events

		if (ie) { // grab the x-y pos.s if browser is IE
			mouseX = event.clientX + document.body.scrollLeft
			mouseY = event.clientY + document.body.scrollTop
		} else {  // grab the x-y pos.s if browser is NS
			mouseX = e.pageX
			mouseY = e.pageY
		}  
		// catch possible negative values in NS4
		if (mouseX < 0){mouseX = 0}
		if (mouseY < 0){mouseY = 0}  

		return [mouseX, mouseY];
	}


	function findPos(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}

	function findSize(obj) {
		var width;
		var height;

		if (op5) { 
			width  = obj.style.pixelWidth;
			if (isNaN(parseInt(obj.rows)))
				height = parseInt(obj.size);
			else				height = obj.style.pixelHeight;
		} else {
			width  = obj.offsetWidth;
			if (isNaN(parseInt(obj.rows)))
				height = parseInt(obj.size);
			else
				height = obj.offsetHeight;		
		}
		return [width, height];
	}


	function clearSelection() {
		if (document.selection)
			document.selection.empty();
		else if (window.getSelection)
			window.getSelection().removeAllRanges();
	}

	/************************************************************************************
	*** END RESIZE FUNCTIONS ************************************************************
	************************************************************************************/


	/************************************************************************************
	*** START GENERAL FUNCTIONS *********************************************************
	************************************************************************************/

	// Trim white space from beginning and end of string
	function trim(stringToTrim) {
		return stringToTrim.replace(/^\s+|\s+$/g,"");
	}

	// URL Encode a string
	function URLEncode(string) {
		// The Javascript escape and unescape functions do not correspond
		// with what browsers actually do...
		var SAFECHARS = "0123456789" +					// Numeric
						"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
						"abcdefghijklmnopqrstuvwxyz" +
						"-_.!~*'()";					// RFC2396 Mark characters
		var HEX = "0123456789ABCDEF";

		var plaintext = string
		var encoded = "";
		for (var i = 0; i < plaintext.length; i++ ) {
			var ch = plaintext.charAt(i);
			if (ch == " ") {
				encoded += "+";				// x-www-urlencoded, rather than %20
			} else if (SAFECHARS.indexOf(ch) != -1) {
				encoded += ch;
			} else {
				var charCode = ch.charCodeAt(0);
				// Unicode Character cannot be encoded using standard URL encoding. (URL encoding only supports 8-bit characters.) A space (+) will be substituted."
				if (charCode > 255) {
					encoded += "+";
				} else {
					encoded += "%";
					encoded += HEX.charAt((charCode >> 4) & 0xF);
					encoded += HEX.charAt(charCode & 0xF);
				}
			}
		} // for

		return encoded;
	};

	// Is an array?
	function isArray() {
		return arguments[0] instanceof Array;
	}

	// Is a regular expression?
	function isRegExp() {
		return arguments[0] instanceof RegExp;
	}
				
	// Is a string?
	function isString() {
		if (typeof arguments[0] == 'string')
			return true;
		if (typeof arguments[0] == 'object') { 
			var criterion = arguments[0].constructor.toString().match(/string/i); 
			return (criterion != null); 
		}
		return false;
	}


	// Divide a string in to two parts on a divider
	function divide(string, divider) {
		var strReplace = genID();
		string = string.replace(divider,strReplace);	
		return Array(string.split(strReplace)[0],string.split(strReplace)[1]);
	}

	// Create an XMLHttpRequest object
	function createRequestObject(){
		var request_o;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			request_o = new ActiveXObject("Microsoft.XMLHTTP");
		}else{
			request_o = new XMLHttpRequest();
		}
		return request_o;
	}
	
	// Decimal to Hexadecimal
	function dec2hex(dec) {
		var hD="0123456789ABCDEF";
		var hex = hD.substr(dec&15,1);
		while (dec>15) {
			dec >>= 4;
			hhex = hD.substr(dec&15,1) + hex;
		}
		return hex;
	}

	// Hexadecimal to Decimal
	function hex2ddec(hex) {
		return parseInt(hex,16);
	} 

	// Generate 32 character hex ID
	function genID() {
		var id = "";
		var i;
		for (i = 0; i < 32; i++) {
			id = id + dec2hex(Math.round(16*Math.random()));
		}
		return id;
	}

	function left(str, n){
		if (n <= 0)
			return "";
		else if (n > String(str).length)
			return str;
		else
			return String(str).substring(0,n);
	}

	function right(str, n){
		if (n <= 0)
		   return "";
		else if (n > String(str).length)
		   return str;
		else {
		   var iLen = String(str).length;
		   return String(str).substring(iLen, iLen - n);
		}
	}


	/************************************************************************************
	*** END GENERAL FUNCTIONS *********************************************************
	*************************************************************************************/