

function ValidateEOBNum()
{
	/*	CSR: 12/07/2000
		Added additional validation checking for the
		EOB Number
	*/
	
	var strCatNum;
	var blnReturnFlag;
	
	// assign the cat number to a local variable
	
	strCatNum = document.frmEOB.CatNum.value;
	document.frmEOB.JSEnabled.value = false;
	document.frmEOB.hdnOnGo.value = true;
	
	
	if (strCatNum == "") {
		alert("Please specify a valid JCPenney catalog number!");
		//document.frmEOB.CatNum.focus();
		blnReturnFlag = false;
	}
	else {	
	
		if (strCatNum.search(/enter\s+item\s+#/i) != -1) {
			alert("Please specify a valid JCPenney catalog number!");
			//document.frmEOB.CatNum.focus();
			blnReturnFlag = false;
		}
		else {
			blnReturnFlag = true;
		}
	}
	
	return blnReturnFlag;
	
	/*	this is all old code that can be removed upon
		successful use of the new code
		
	if (document.frmEOB.CatNum.value == "")
		{
		alert("Please specify a valid JCPenney catalog number");
		document.frmEOB.CatNum.focus();
		return false;
		}
	else
		{
		return true;
		}
		
	*/
}
function ValidateSearchTxt()
{

	document.frmSearch.JSEnabled.value = false;
	document.frmSearch.hdnOnGo.value = true;
	if(document.frmSearch.SearchString.value == "")
		{
		alert("Please enter your search term in the search box.");
		document.frmSearch.SearchString.focus();
		return false;
		}
	else
		{
		if(document.frmSearch.SearchString.value == "  Enter search term or web ID")
		    {
		  	alert("Please enter your search term in the search box.");
			document.frmSearch.SearchString.focus();
			return false;
		    }
		else
		    {
		return true;
		    }	
		}	
}

function ValidateSearchTxt2()
{

	document.frmSearch2.JSEnabled.value = false;
	if(document.frmSearch2.SearchString.value == "")
		{
		alert("Please enter your search term in the search box.");
		document.frmSearch2.SearchString.focus();
		return false;
		}
	else
		{
		return true;
		}		
}

function SelectEOBText()
{

//document.frmEOB.CatNum.focus();
//document.frmEOB.CatNum.select();

}

function SelectSearchText()
{

document.frmSearch.SearchString.focus();
document.frmSearch.SearchString.select();

}

function setShoppingInfo()
{
var count = readCookieTest('DomainItemCount');
if (count != null)
{
	if (count != 1 && document.getElementById('itemCountAnchor') != null)
	{
		document.getElementById('itemCountAnchor').innerHTML = count + " items";
	}
	else
	{
		document.getElementById('itemCountAnchor').innerHTML = count + " item";	
	}
}
var total = readCookieTest('DomainItemTotal');
if (total != null && document.getElementById('itemtotalAnchor') != null)
{
	document.getElementById('itemtotalAnchor').innerHTML = "$" + total;
}
}

setTimeout("setShoppingInfo()",250);

function readCookieTest(name){
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i<ca.length;i++){
var c = ca[i];
while(c.charAt(0) == ' ') c = c.substring(1,c.length);
if(c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

