// NebuCart - The JavaScript Shopping Cart
// by Nebulus Designs
//
// Copyright 1999/2000 all rights reserved.

// None of this script may be redistributed or sold
// without the authors express consent.
// Violations of copyright will be prosecuted.

// If you would like to use NebuCart,
// email us at nebucart@nebulus.org
// or visit http://www.nebulus.org/NebuCart

// ********************************************
// NebuCart Cart Formatting Routines          *
// ********************************************
// cart variables - you edit these to taste   *
// ********************************************

//window.onerror = null;

//function onerror(){
//	return true;
//}

var myFont = parent.cartframe.fontFace;

function formatMoney(amount){
	var tmpString = new String(amount);	
	if(tmpString.indexOf(".") == -1){
		tmpString = tmpString + ".00";
	} else {
		var strEnd = tmpString.substring(tmpString.indexOf(".") + 1 , tmpString.length);
		if(strEnd.length == 1){
			tmpString = tmpString + "0";
		}
	}
	return tmpString;
}

function formatDecimal(amount){
	var tmpString = new String(amount);
	if(tmpString.indexOf(".") == -1){
		tmpString = tmpString + ".00";
	} else {
		var startDec = tmpString.indexOf(".");
		var strBegin = tmpString.substring(0, startDec);
		var strEnd = tmpString.substring(startDec, tmpString.length);
		if(strEnd.length >= 4){
			var strEnd = strEnd.substring(0,4);
			var endVal = strEnd.charAt(strEnd.length - 1);
			if(endVal >= 5){
				endVal = ".00" + endVal;
				strEnd = Number(strEnd) + (.01 - endVal);
			} else {
				strEnd = strEnd.substring(0,3);
			}
		}
		tmpString = Number(strBegin) + Number(strEnd);
	}
	return tmpString;
}

// Create an order date

currentDate = new Date();

Months = new Array();
Months[0] = "January";
Months[1] = "February";
Months[2] = "March";
Months[3] = "April";
Months[4] = "May";
Months[5] = "June";
Months[6] = "July";
Months[7] = "August";
Months[8] = "September";
Months[9] = "October";
Months[10] = "November";
Months[11] = "December";

today = Months[currentDate.getMonth()];

if(navigator.appName == "Netscape"){
	var tmpYr = String(currentDate.getYear());
	today = today + " " + currentDate.getDate() + ", 20" + tmpYr.substring(tmpYr.length-2,tmpYr.length);
} else {
	today = today + " " + currentDate.getDate() + ", " + currentDate.getYear();
}