<!--
var oPickField = null;
var displayField = null;
var valueField = null;

var oPickWindow = null;

// need this to track a check box click and set the value accordingly
function checkboxClick(osrc)
{
	//alert('Here');
	if (!osrc)
		osrc = window.event.srcElement;
	
	var oInput = osrc.previousSibling;
	oInput.value = osrc.checked;
	//alert(oInput.value);
}

function ForceNumber(osrc)
{
	if (!osrc)
		osrc = window.event.srcElement;
	
	var oInput = osrc;	
	var strField = oInput.value
	//alert(strField);
	//alert(strField.length);
	fieldName = oInput.parentNode.previousSibling.innerHTML;
	var tempField = fieldName.substring(0,fieldName.length-2).split(">");
	tempField = tempField[1].split("<");
	fieldName= tempField[0];
	//alert(fieldName);
	var i = 0;

	for (i = 0; i < strField.length; i++)
	{
		if (strField.charAt(i) < '0' || strField.charAt(i) > '9') 
		{
			alert(fieldName +" must be a valid numeric entry.  Please do not use commas or dollar signs or any non-numeric symbols.");
			oInput.focus();
			return false;
		}
	}
	return true;
}

function ForceDecimalNumber(osrc)
{
	if (!osrc)
		osrc = window.event.srcElement;
	
	var oInput = osrc;	
	var strField = oInput.value
	//alert(strField);
	//alert(strField.length);
	fieldName = oInput.parentNode.previousSibling.innerHTML;
	//fieldName = fieldName.substring(0,fieldName.length-2);
	var tempField = fieldName.substring(0,fieldName.length-2).split(">");
	tempField = tempField[1].split("<");
	fieldName= tempField[0];
	//alert(fieldName);
	var i = 0;
	var decCount = 0;
	for (i = 0; i < strField.length; i++)
	{
		if(strField.charAt(i) < '0' || strField.charAt(i) > '9') 
		{
			if(strField.charAt(i) == '.')
			{ 
				decCount++;
				if(decCount > 1)
				{
					alert(fieldName +" must be a valid numeric entry.  Please do not use commas or dollar signs or any non-numeric symbols other than a decimal point.");
					oInput.focus();
					return false;
				}
			}
			else
			{
				alert(fieldName +" must be a valid numeric entry.  Please do not use commas or dollar signs or any non-numeric symbols other than a decimal point.");
				oInput.focus();
				return false;
			}
		}
	}
	return true;
}

/* ALL COMMON SCRIPT FUNCTIONS TO GO HERE */

function tbButtonOver()
{
	var btn = window.event.srcElement;
	btn.className = 'tbButtonOver';
}

function tbButtonOut()
{
	var btn = window.event.srcElement;
	btn.className = 'tbButton';
}

function SetToolbarAction(val)
{
	document.frmToolbar.txtActionID.value = val;
}

function buttonClick(actionID)
{
	var oForm = document.frmSolis;
	oForm.txtActionID.value = actionID;
	oForm.submit();
}

function gotoLocation(sLocation)
{
	window.location = sLocation;
}

function NotAvailable()
{
	alert('This functionality is not available');
	return false;
}

function IsNumeric(sText)
{
	var ValidChars = '0123456789.';
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++)
	{
		Char = sText.charAt(i);
		if (ValidChars.indexOf(Char) == -1)
		{
			IsNumber = false;
		}
	}
	return IsNumber;
} 

function URLEncode(s)
	{
		return (s.replace(/&/g, '%26').replace(/</g, '%3C').replace(/=/g, '%3D').replace(/>/g, '%3E').replace(/"/g, '%22').replace(/'/g, '%27'));
	}
	
function XMLEncode(s)
{
	return (s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&#34;').replace(/'/g, '&#39;'));
}

function ShowBrandPicker(e)
{
	var winx, winy;
	var oPickWindow = null;
	oPickField = e.previousSibling;
	var evt = (e)?(e):(window.event);
		
	winx = (window.screen.availWidth - 500) / 2;
	winy = (window.screen.availHeight - 500) / 2;
	
	if (oPickWindow){
		oPickWindow.close();
	}
	oPickWindow = window.open("pickers/BrandPicker.aspx", "SolisXCFPicker", "width=800,height=500,top=" + parseInt(winy) + ",left=" + parseInt(winx) + ",scrollbars=yes",false);
	oPickWindow.focus();
	return false;
}

function SetExternalCFValue2(strID, strValue)
{
	
	if (oPickField != null)
	{	
		displayField = oPickField;
		valueField = displayField.previousSibling;
		
		// we now have two fields to content with, the display value and the actual
		// value we need to submit to the search.
						
		// set the display box with the text
		displayField.value = strValue;
		valueField.value = strID;
		
		oPickField = null;
		oPickWindow = null;
		
	}
	
	return true;
}

//-->
