function BlockDoubleClick() 
	{
	if (clicked) 
		{
		//alert("You have already clicked continue. Clicking the button again could lead to a duplication of your submission.");
		return false;
		} 
	else 
		{
		clicked=true;
		return true;
		}
	}


function showhideAccountDiv(theAccountItem, theEmailItem){
	var AskAboutNewsletter = false;
	if (typeof(frmCartForm.NEWSLETTER_OPTIN) != "undefined"){
		showEmail = frmCartForm.NEWSLETTER_OPTIN[0].checked;
		AskAboutNewsletter = true;}
	var AskAboutAccount = false;
	if (typeof(frmCartForm.CREATE_ACCOUNT) != "undefined"){
		showPass = frmCartForm.CREATE_ACCOUNT[0].checked;
		AskAboutAccount = true;}
	if (AskAboutNewsletter){
		if (AskAboutAccount){
			//check to see if the radios are checked
			var showEmail = frmCartForm.NEWSLETTER_OPTIN[0].checked;
			var showPass = frmCartForm.CREATE_ACCOUNT[0].checked;
			if (showPass){
				theEmailItem.style.display = 'block';
				theAccountItem.style.display = 'block';}
			else{
				theAccountItem.style.display = 'none';
				if (showEmail){
					theEmailItem.style.display = 'block';}
				else{
					theEmailItem.style.display = 'none';}}}
		else{
			theAccountItem.style.display = 'block';
			theEmailItem.style.display = 'block';}}
	else{
		if (document.getElementById('CREATE_ACCOUNT') !== null)	{
			//check to see if the radios are checked
			var showPass = frmCartForm.CREATE_ACCOUNT[0].checked;
			if (showPass){
				theEmailItem.style.display = 'block';
				theAccountItem.style.display = 'block';}
			else{
				theAccountItem.style.display = 'none';
				theEmailItem.style.display = 'none';}}
		else{
			theAccountItem.style.display = 'block';
			theEmailItem.style.display = 'block';}}
}

var whitespace = " \t\n\r";
function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function isWhitespace(s)
{
	var i;
	if (isEmpty(s))
		return true;

	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1)
			return false;
	}
	return true;
}

function CartButton(strAction)
	{
		document.frmCartForm.action = strAction
		document.frmCartForm.submit();
		return true;
	}


function dataValidate(theForm)
{
	if (theForm.pgNum.value == "")
	{
		alert("Please enter a valid Page Number Only.");
		theForm.pgNum.focus();
		theForm.pgNum.select();
		return (false);
	}

	var strField = new String(theForm.pgNum.value);
	if (isWhitespace(strField))
		return true;

	var i = 0;
	for (i = 0; i < strField.length; i++)
		if (strField.charAt(i) < '0' || strField.charAt(i) > '9')
		{
			alert("Page Number must be a valid numeric entry.  Please do not use any non-numeric symbols.");
			theForm.pgNum.focus();
			theForm.pgNum.select();
			return false;
		}

	return true;
}

function popupMod(page, width, height, resizable, scrollbars, status, toolbars){ 
	window.open(page,"popup","width="+width+",height="+height+","+resizable+","+scrollbars+","+status+","+toolbars)
}

function popup(page){ 
	window.open(page,"popup","width=625,height=350,resizable=yes,scrollbars=yes,status=no,toolbars=no")
}

function ask()
{
	var agree = confirm("Are you sure you want to completely remove ALL items from your cart?");
	if (agree)
		return true
	else
		return false;
}

function askITEM()
{
	var agree = confirm("Are you sure you want to completely remove this item from your cart?");
	if (agree)
		return true
	else
		return false;
}

function showPayOptions()
{
	var option, arReq
	var form = document.frmCartForm
	var option=form.PAY_TYPE.options[form.PAY_TYPE.selectedIndex].value
	arReq = option.split(':')
	if (arReq[1] == 'True')
		{	
		if (arReq[0] == 'PO')
			{
	  		document.getElementById('payccnum').style.display = 'none'	
	  		document.getElementById('payponum').style.display = 'block'			
			}
		else
			{
			document.getElementById('payccnum').style.display = 'block'
			document.getElementById('payponum').style.display = 'none'
			showCVV(arReq[0])
			}	
		}
	else
		{
		document.getElementById('payccnum').style.display = 'none'
		document.getElementById('payponum').style.display = 'none'
		}
	
	if (arReq[2] == 'True')
		{document.getElementById('ccdate').style.display = 'block'}
	else
		{document.getElementById('ccdate').style.display = 'none'}
	
	if (arReq[3] == 'True')
		{document.getElementById('payname').style.display = 'block'}
	else
		{document.getElementById('payname').style.display = 'none'}
}



function showhideDiv(theItem)
{
	if (typeof(theItem) != "undefined")
	{
		if (document.getElementById(theItem).style.display == 'none')
			document.getElementById(theItem).style.display = 'block';
		else
			document.getElementById(theItem).style.display = 'none';
	}
}





function IntraAsk()
{
	var agree=confirm("Are you SURE you want to completely delete this record?");
	if (agree)
		return true;
	else
		return false;
}			

function SetOrderViewerDate(dteFrom, dteThru)
{
	document.getElementById('datefrom').value=dteFrom;
	document.getElementById('datethru').value=dteThru;
}