/*	tell server that javascript is enabled. */
document.cookie = 'javascript=Y';



/*
	Get browser
*/

var browser_ie = (navigator.userAgent.indexOf('MSIE') >= 0);
var browser_opera = (navigator.userAgent.indexOf('Opera') >= 0);
var browser_webkit = (navigator.userAgent.indexOf('WebKit') >= 0);
var browser_firefox = (navigator.userAgent.indexOf('Firefox') >= 0);













/*
	Debug
*/

function debug(strInMessage)
{	
	objMessage = document.createElement('div');
	objMessage.setAttribute('style','padding:10px 5px;');
	objMessage.innerHTML = strInMessage;
	
	objDebug = document.getElementById('divDebug');
	if (objDebug) objDebug.appendChild(objMessage);
}



function getStackTrace()
{	
	var callstack = [];
	var isCallstackPopulated = false;
	try {
		i.dont.exist+=0; //doesn't exist- that's the point
	} catch(e) {
		if (e.stack) { //Firefox
			var lines = e.stack.split("\n");
			for (var i=0, len=lines.length; i<len; i++) {
				if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
					callstack.push(lines[i]);
				}
			}
			//Remove call to printStackTrace()
			callstack.shift();
			isCallstackPopulated = true;
		}
		else if (window.opera && e.message) { //Opera
			var lines = e.message.split("\n");
			for (var i=0, len=lines.length; i<len; i++) {
				if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
					var entry = lines[i];
					//Append next line also since it has the file info
					if (lines[i+1]) {
						entry += " at " + lines[i+1];
						i++;
					}
					callstack.push(entry);
				}
			}
			//Remove call to printStackTrace()
			callstack.shift();
			isCallstackPopulated = true;
		}
	}
	if (!isCallstackPopulated) { //IE and Safari
		var currentFunction = arguments.callee.caller;
		while (currentFunction) {
			var fn = currentFunction.toString();
			var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || "anonymous";
			callstack.push(fname);
			currentFunction = currentFunction.caller;
		}
	}
	return callstack;
}















/*
	Get page parameters from query string.
*/

var rayPageParameters = null;
function getPageParameters()
{	
	rayOutParameters = new Array();
	strQueryString = location.search.replace(/\?/,'&');
	rayQueryString = strQueryString.split('&');
	for (i=1; i < rayQueryString.length; i++)
	{	strParameter = rayQueryString[i];
		rayParameter = strParameter.split('=');
		rayOutParameters[rayParameter[0]] = rayParameter[1];
	}
	return rayOutParameters;
}
function getPageParameter(strInParam)
{	
	if (!rayPageParameters) rayPageParameters = getPageParameters();
	return rayPageParameters[strInParam];
}









/*
	Cookies
*/

function setCookie(c_name, value, expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function getCookie(c_name)
{
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return false;
}



































































/*
	DOM object handling
*/


httpObj = false; // <-- specifying with "var" keyword was limiting the scope.

function getHttpObj()
{	
	if (!httpObj) httpObj = getHTTPObject();
	return httpObj;
}
function getHTTPObject()
{	
	if (window.XMLHttpRequest)
	{	// first choice.
		return new XMLHttpRequest();
	}
	else
	if (window.ActiveXObject)
	{	// LAST choice.
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return false;
}

function sendHttpRequest(inUrl, inResponseFunction)
{	if (httpObj = getHttpObj())
	{	
		httpObj.onreadystatechange = inResponseFunction ? inResponseFunction : defaultHttpObjResponse;
		httpObj.open("GET",inUrl,true);
		httpObj.send(null);
		return true;
	}
	return false;
}
function defaultHttpObjResponse()
{	if (httpObj && httpObj.readyState==4)
	if (httpObj.status==200)
	{	
		//	response received successfully...
		alert(httpObj.responseText);
		return true;
	}
	else
	{	
		//	error retreiving data
		alert(httpObj.statusText);
	}
	return false;
}






function removeNodeChildren(objInNode)
{	
	if (objInNode && objInNode.childNodes)
	{	
		for (n=0; n < objInNode.childNodes.length; n++)
		{	
			objInNode.removeChild( objInNode.childNodes[n] );
		}
	}
}



function getObjPosition(objInput)
{
	intOutLeft = 0;
	intOutTop = 0;
	intOutRight = objInput.offsetRight ? objInput.offsetRight : null;
	intOutBottom = objInput.offsetBottom ? objInput.offsetBottom : null;
	intOutWidth = objInput.offsetWidth ? objInput.offsetWidth : null;
	intOutHeight = objInput.offsetHeight ? objInput.offsetHeight : null;
	if (objInput.offsetParent)
	{	while (objInput.offsetParent)
		{	intOutLeft += objInput.offsetLeft;
			intOutTop += objInput.offsetTop;
			objInput = objInput.offsetParent;
		}
	}
	else
	if (objInput.x || objInput.y)
	{	intOutLeft += objInput.x;
		intOutTop += objInput.y;
		intOutWidth = objInput.width ? objInput.width : null;
		intOutHeight = objInput.height ? objInput.height : null;
	}
	if ((intOutRight == null) && intOutWidth) intOutRight = intOutLeft+intOutWidth;
	if ((intOutBottom == null) && intOutHeight) intOutBottom = intOutTop+intOutHeight;
	rayOutput = new Array();
	rayOutput['left'] = intOutLeft;
	rayOutput['right'] = intOutRight;
	rayOutput['top'] = intOutTop;
	rayOutput['bottom'] = intOutBottom;
	rayOutput['width'] = intOutWidth;
	rayOutput['height'] = intOutHeight;
	return rayOutput;
}



var rayDisabledObjects = {};
var rayDisabledObjectParents = {};

function requestDisableObject(inObject)
{	
	window.setTimeout("disableObject('"+inObject.id+"')",1);
}
function disableObject(inObject)
{	
	/*
		save object by id,
		save object parent by id,
		change parent innerHTML to processing message.
	*/
	if (typeof(inObject)=='string') inObject = document.getElementById(inObject);
	if (inObject) {
		rayDisabledObjects[inObject.id] = inObject;
		if (rayDisabledObjectParents[inObject.id] = inObject.parentElement) {
			//rayDisabledObjectParents[inObject.id].innerHTML = "Processing, please wait..."; // <-- doesn't work in some browsers.
			rayDisabledObjectParents[inObject.id].innerHTML = '';
			removeNodeChildren(rayDisabledObjectParents[inObject.id]);
			rayDisabledObjectParents[inObject.id].appendChild(document.createTextNode("Processing, please wait..."));
			
		}
	}
}
function requestEnableObject(inObjectId)
{	
	window.setTimeout("enableObject('"+inObjectId+"')",1);
}
function enableObject(inObjectId)
{	
	/*
		clear parent innerHTML, re-add object.
	*/
	if (typeof(rayDisabledObjects)!='undefined')
	if (typeof(rayDisabledObjectParents)!='undefined')
	if (rayDisabledObjects[inObjectId] && rayDisabledObjectParents[inObjectId]) {
		rayDisabledObjectParents[inObjectId].innerHTML = '';
		removeNodeChildren(rayDisabledObjectParents[inObjectId]);
		rayDisabledObjectParents[inObjectId].appendChild(rayDisabledObjects[inObjectId]);
	}
}



function addToClassName(objInput, strInClassName)
{	
	rayCurrentClassName = new Array();
	if (strCurrentClassName = objInput.className)
		rayCurrentClassName = strCurrentClassName.split(' ');
	rayCurrentClassName.push(strInClassName);
	
	return (objInput.className = rayCurrentClassName.join(' '));
}

function removeFromClassName(objInput, strInClassName)
{	
	rayCurrentClassName = new Array();
	if (strCurrentClassName = objInput.className)
		rayCurrentClassName = strCurrentClassName.split(' ');
	rayOutClassName = new Array();
	for (i in rayCurrentClassName)
		if (rayCurrentClassName[i] != strInClassName)
			rayOutClassName.push(rayCurrentClassName[i]);
	
	return (objInput.className = rayOutClassName.join(' '));
}



function getSelectValue(inControl, inProperty)
{	if (typeof(inProperty)=='undefined') inProperty='value';
	
	// gets select control value in IEdiot-compliant fashion.
	
	if (inControl.value)
		return inControl.value;
	else
	if ((typeof(inControl.selectedIndex)!='undefined') && (inControl.selectedIndex > -1) &&
		(typeof(inControl.options)!='undefined') &&
		(typeof(inControl.options[inControl.selectedIndex])!='undefined') &&
		(typeof(inControl.options[inControl.selectedIndex][inProperty])!='undefined'))
			return inControl.options[inControl.selectedIndex][inProperty];
	
	return false;
}
function setSelectValue(inControl, inValue, inProperty)
{	if (typeof(inProperty)=='undefined') inProperty='value';
	
	if (inControl && inValue)
	if (typeof(inControl.options)!='undefined')
	if (inControl.options.length)
	for (optionIndex in inControl.options)
	if (tempOption = inControl.options[optionIndex])
	if (typeof(tempOption[inProperty])!='undefined') {
		if (tempOption[inProperty]==inValue) {
			inControl.selectedIndex = optionIndex;
			return true;
		}
	}
	return false;
}

function getSelectedOptionGroupLabel(inControl)
{	
	if (inControl && inControl.options)
	if (tempOpt = inControl.options[inControl.selectedIndex])
	if (tempGroup = tempOpt.parentElement)
	if (tempGroupLabel = tempGroup.label) 
		return tempGroupLabel;
}











/*
	Dynamic image loader.
*/

var rayLoadedImages = new Array();

function loadImage(strImageUrl)
{	
	objNewImage = new Image();
	objNewImage.src = strImageUrl;
	
	rayLoadedImages[strImageUrl] = objNewImage;
	return rayLoadedImages[strImageUrl];
}


var rayImageTimers = new Array();

function waitForImageComplete(strImageUrl, strFollowupFunction)
{	clearTimeout(rayImageTimers[strImageUrl]);
	
	if (rayLoadedImages[strImageUrl].complete)
	{	rayImageTimers[strImageUrl] = setTimeout(strFollowupFunction,0); }
	else
	{	rayImageTimers[strImageUrl] = setTimeout("waitForImageComplete('"+strImageUrl+
			"',\""+strFollowupFunction+"\")",100); }
}





/*
	Set object opacity. (method based on browser)
*/
function setOpacity(objIn, intOpacity)
{	
	if (browser_ie)
	{	
		objIn.style.filter='alpha(opacity='+intOpacity+')';
		objIn.style.zoom='1';
	}
	else
	{
		objIn.style.opacity=(intOpacity/100);
	}
}












































/*
	Sorting
*/

function sortNumber(a,b)
{
	return a - b;
}











/*
	Numeric operations
*/

function getArraySum(rayInput)
{	
	intOutput = 0;
	for (i=0; i < rayInput.length; i++) intOutput += rayInput[i];
	return intOutput;
}































































/*
	
	Formatting functions...
	
*/

function padDecimal(dblNumber, intDigits)
{	
	strInput = new String(dblNumber);
	rayInput = strInput.split(".");
	strLeft = rayInput[0];
	strRight = rayInput[1];
	while (strRight.length < intDigits) strRight += "0";
	
	return strLeft+"."+strRight;
}

function padNumber(intNumber, intDigits)
{	strOutput = new String(intNumber);
	intL = intDigits - strOutput.length;
	for (i=0; i< intL; i++)
	{	strOutput = "0"+strOutput; }
	return strOutput;
}

function formatCurrency(intInAmount)
{
	strDecimal = '.';
	strDelim = ',';
	strOutAmount = "";
	
	intInAmount = new Number(intInAmount);
	if (isNaN(intInAmount)) return false;
	
	booNegative = (intInAmount < 0);
	strInAmount = Math.abs(intInAmount).toFixed(2);
	rayInAmount = strInAmount.split('.');
	strLeftAmount = rayInAmount[0];
	
	rayLeftAmount = new Array();
	while(strLeftAmount.length > 3)
	{	
		strThisNumber = strLeftAmount.substr(strLeftAmount.length-3);
		
		rayLeftAmount.unshift(strThisNumber);
		strLeftAmount = strLeftAmount.substr(0,strLeftAmount.length-3);
	}
	if (strLeftAmount.length > 0) rayLeftAmount.unshift(strLeftAmount);
	
	strOutAmount = (booNegative?'-':'')+
		rayLeftAmount.join(strDelim)+strDecimal+rayInAmount[1];
	
	return strOutAmount;
}

































































/*
	
	Parsing functions...
	
*/

/*
	Parse standard data string. "key1:value1;key2:value2"
	return as keyed array [key1]="value1", [key2]="value2"
*/
function dataStrToRay(strInput) { return DataStrToRay(strInput); }
function DataStrToRay(strInput)
{
	rayOutput = {};
	rayInput = strInput.split(';');
	for (dstri=0; dstri< rayInput.length; dstri++)
	{
		rayThisPair = rayInput[dstri].split(':');
		rayOutput[rayThisPair[0]] = rayThisPair[1];
	}
	return rayOutput;
}
function dataRayToStr(strInput) { return DataRayToStr(strInput); }
function DataRayToStr(rayInput)
{
	strOutput = '';
	for (drtsi in rayInput)
	{
		if (typeof(rayInput[drtsi]) != 'function')
		{
			if (strOutput) strOutput += ';';
			strOutput += drtsi+':'+rayInput[drtsi];
		}
	}
	return strOutput;
}

function summarize(rayInput)
{	
	strOutput = '';
	for (smrzi in rayInput)
	{
		if (typeof(rayInput[smrzi]) != 'function')
		{
			if (strOutput) strOutput += ', ';
			strOutput += smrzi+':'+rayInput[smrzi];
		}
	}
	return strOutput;
}







function encodeDataStr(inData)
{	
	outData = inData.replace(/:/g,"%253A");
	outData = outData.replace(/;/g,"%253B");
	return outData;
}
function decodeDataStr(inData)
{	
	outData = inData.replace(/%253A/g,":");
	outData = outData.replace(/%253B/g,";");
	outData = outData.replace(/%3A/g,":");
	outData = outData.replace(/%3B/g,";");
	return outData;
}



function propertyToDisplay(inData)
{	/* debug */ testStackTrace = getStackTrace();
	outData = inData.replace(/%2520/g, ' ');
	outData = outData.replace(/%2527/g, "'");
	outData = outData.replace(/%2522/g, '"');
	outData = outData.replace(/%20/g, ' ');
	outData = outData.replace(/%27/g, "'");
	outData = outData.replace(/%22/g, '"');
	return outData;
}
function displayToProperty(inData)
{	outData = inData.replace(/ /g,'%2520');
	outData = outData.replace(/\'/g,'%2527');
	outData = outData.replace(/\"/g,'%2522');
	return outData;
}
function displayToPropertyShort(inData)
{	outData = inData.replace(/ /g,'%20');
	outData = outData.replace(/\'/g,'%27');
	outData = outData.replace(/\"/g,'%22');
	return outData;
}









function getUnitPrice(intInQuantity, inPricing) {
	// Pricing array format... quantity : price
	intInQuantity = intInQuantity ? new Number(intInQuantity) : 1;
	inPricing = inPricing ? inPricing : rayPricing;
	dblPriceOut = 0;
	if (inPricing)
	for (intThisQty in inPricing) {
		intThisPrice = inPricing[intThisQty];
		if (intInQuantity >= intThisQty) dblPriceOut = intThisPrice;
	}
	return dblPriceOut;
}

































































/*
	
	Common validation functions
	
*/



function validateZip(inZipCode) 
{	/*
		test passed zipcode for format validity.
	*/
	regZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);
	return regZip.test(inZipCode);
}
































































/*
	PHP.js Javascript equivalents of PHP functions...
*/



function get_html_translation_table(table, quote_style) {
	// http://kevin.vanzonneveld.net
	// +   original by: Philip Peterson
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   bugfixed by: noname
	// +   bugfixed by: Alex
	// +   bugfixed by: Marco
	// +   bugfixed by: madipta
	// +   improved by: KELAN
	// +   improved by: Brett Zamir (http://brett-zamir.me)
	// +   bugfixed by: Brett Zamir (http://brett-zamir.me)
	// +      input by: Frank Forte
	// +   bugfixed by: T.Wild
	// +      input by: Ratheous
	// %          note: It has been decided that we're not going to add global
	// %          note: dependencies to php.js, meaning the constants are not
	// %          note: real constants, but strings instead. Integers are also supported if someone
	// %          note: chooses to create the constants themselves.
	// *     example 1: get_html_translation_table('HTML_SPECIALCHARS');
	// *     returns 1: {'"': '&quot;', '&': '&amp;', '<': '&lt;', '>': '&gt;'}
	
	var entities = {}, hash_map = {}, decimal = 0, symbol = '';
	var constMappingTable = {}, constMappingQuoteStyle = {};
	var useTable = {}, useQuoteStyle = {};
	
	// Translate arguments
	constMappingTable[0]      = 'HTML_SPECIALCHARS';
	constMappingTable[1]      = 'HTML_ENTITIES';
	constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
	constMappingQuoteStyle[2] = 'ENT_COMPAT';
	constMappingQuoteStyle[3] = 'ENT_QUOTES';
	
	useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
	useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() : 'ENT_COMPAT';
	
	if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
		throw new Error("Table: "+useTable+' not supported');
		// return false;
	}
	
	entities['38'] = '&amp;';
	if (useTable === 'HTML_ENTITIES') {
		entities['160'] = '&nbsp;';
		entities['161'] = '&iexcl;';
		entities['162'] = '&cent;';
		entities['163'] = '&pound;';
		entities['164'] = '&curren;';
		entities['165'] = '&yen;';
		entities['166'] = '&brvbar;';
		entities['167'] = '&sect;';
		entities['168'] = '&uml;';
		entities['169'] = '&copy;';
		entities['170'] = '&ordf;';
		entities['171'] = '&laquo;';
		entities['172'] = '&not;';
		entities['173'] = '&shy;';
		entities['174'] = '&reg;';
		entities['175'] = '&macr;';
		entities['176'] = '&deg;';
		entities['177'] = '&plusmn;';
		entities['178'] = '&sup2;';
		entities['179'] = '&sup3;';
		entities['180'] = '&acute;';
		entities['181'] = '&micro;';
		entities['182'] = '&para;';
		entities['183'] = '&middot;';
		entities['184'] = '&cedil;';
		entities['185'] = '&sup1;';
		entities['186'] = '&ordm;';
		entities['187'] = '&raquo;';
		entities['188'] = '&frac14;';
		entities['189'] = '&frac12;';
		entities['190'] = '&frac34;';
		entities['191'] = '&iquest;';
		entities['192'] = '&Agrave;';
		entities['193'] = '&Aacute;';
		entities['194'] = '&Acirc;';
		entities['195'] = '&Atilde;';
		entities['196'] = '&Auml;';
		entities['197'] = '&Aring;';
		entities['198'] = '&AElig;';
		entities['199'] = '&Ccedil;';
		entities['200'] = '&Egrave;';
		entities['201'] = '&Eacute;';
		entities['202'] = '&Ecirc;';
		entities['203'] = '&Euml;';
		entities['204'] = '&Igrave;';
		entities['205'] = '&Iacute;';
		entities['206'] = '&Icirc;';
		entities['207'] = '&Iuml;';
		entities['208'] = '&ETH;';
		entities['209'] = '&Ntilde;';
		entities['210'] = '&Ograve;';
		entities['211'] = '&Oacute;';
		entities['212'] = '&Ocirc;';
		entities['213'] = '&Otilde;';
		entities['214'] = '&Ouml;';
		entities['215'] = '&times;';
		entities['216'] = '&Oslash;';
		entities['217'] = '&Ugrave;';
		entities['218'] = '&Uacute;';
		entities['219'] = '&Ucirc;';
		entities['220'] = '&Uuml;';
		entities['221'] = '&Yacute;';
		entities['222'] = '&THORN;';
		entities['223'] = '&szlig;';
		entities['224'] = '&agrave;';
		entities['225'] = '&aacute;';
		entities['226'] = '&acirc;';
		entities['227'] = '&atilde;';
		entities['228'] = '&auml;';
		entities['229'] = '&aring;';
		entities['230'] = '&aelig;';
		entities['231'] = '&ccedil;';
		entities['232'] = '&egrave;';
		entities['233'] = '&eacute;';
		entities['234'] = '&ecirc;';
		entities['235'] = '&euml;';
		entities['236'] = '&igrave;';
		entities['237'] = '&iacute;';
		entities['238'] = '&icirc;';
		entities['239'] = '&iuml;';
		entities['240'] = '&eth;';
		entities['241'] = '&ntilde;';
		entities['242'] = '&ograve;';
		entities['243'] = '&oacute;';
		entities['244'] = '&ocirc;';
		entities['245'] = '&otilde;';
		entities['246'] = '&ouml;';
		entities['247'] = '&divide;';
		entities['248'] = '&oslash;';
		entities['249'] = '&ugrave;';
		entities['250'] = '&uacute;';
		entities['251'] = '&ucirc;';
		entities['252'] = '&uuml;';
		entities['253'] = '&yacute;';
		entities['254'] = '&thorn;';
		entities['255'] = '&yuml;';
		//	fancy quotes & dashes
		entities['8211'] = '&ndash;';
		entities['8212'] = '&mdash;';
		entities['8216'] = '&lsquo;';
		entities['8217'] = '&rsquo;';
		entities['8220'] = '&ldquo;';
		entities['8221'] = '&rdquo;';
	}
	
	if (useQuoteStyle !== 'ENT_NOQUOTES') {
		entities['34'] = '&quot;';
	}
	if (useQuoteStyle === 'ENT_QUOTES') {
		entities['39'] = '&#39;';
	}
	entities['60'] = '&lt;';
	entities['62'] = '&gt;';
	
	
	// ascii decimals to real symbols
	for (decimal in entities) {
		symbol = String.fromCharCode(decimal);
		hash_map[symbol] = entities[decimal];
	}
	
	return hash_map;
}



function htmlentities(string, quote_style) {
	// http://kevin.vanzonneveld.net
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +   improved by: nobbler
	// +    tweaked by: Jack
	// +   bugfixed by: Onno Marsman
	// +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
	// +    bugfixed by: Brett Zamir (http://brett-zamir.me)
	// +      input by: Ratheous
	// -    depends on: get_html_translation_table
	// *     example 1: htmlentities('Kevin & van Zonneveld');
	// *     returns 1: 'Kevin &amp; van Zonneveld'
	// *     example 2: htmlentities("foo'bar","ENT_QUOTES");
	// *     returns 2: 'foo&#039;bar'
	
	var hash_map = {}, symbol = '', tmp_str = '', entity = '';
	tmp_str = string.toString();
	
	if (false === (hash_map = this.get_html_translation_table('HTML_ENTITIES', quote_style)))
		return false;
	
	hash_map["'"] = '&#039;';
	for (symbol in hash_map) {
		entity = hash_map[symbol];
		tmp_str = tmp_str.split(symbol).join(entity);
	}
	
	return tmp_str;
}



function sanitizeSpecialChars(inString)
{	//	must be used after htmlentities.
	raySubstitute = {
		'&ndash;' : '-',
		'&mdash;' : '-',
		'&lsquo;' : "'",
		'&rsquo;' : "'",
		'&ldquo;' : '"',
		'&rdquo;' : '"'
		};
	outString = inString;
	for (strFind in raySubstitute)
	if (strReplace = raySubstitute[strFind])
		outString = outString.split(strFind).join(strReplace);
	return outString;
}




