// Shopping Cart System Script.
// Copyright JomiTech 2004. All Rights Reserved.
var Items = new Array();

// ---------- Add items here ------------
// Eg: addItem( "Description", "ItemID", "Price" )
// Please do not add the dollar sign '$' into the price.
// addItem("Raising Newborns From Birth To Weaning - Saving LIVES!", "A2", "10.00", "D" );
// addItem("Lookin Good", "A1", "7.00", "D" );
// addItem("Good Breeding", "A3", "7.00", "D" );
// addItem("How to Have Purr-fect Faith, even at a cat show.", "EB1", "10.50", "D" );
addItem("How to Have Purr-fect Faith, even at a cat show", "B1", "12.95", "S" );
addItem("3 How to Have Purr-fect Faith, even at a cat show", "B31", "34.96", "S" );
addItem("10 How to Have Purr-fect Faith, even at a cat show", "B101", "103.60", "S" );
addItem("Case of 44 How to Have Purr-fect Faith, even at a cat show", "B441", "284.90", "S" );
addItem("Orginal Purr-fect Bath for Persians and other Longhairs DVD", "DVD1", "19.95", "S" );
addItem("Combo Hollywood and Ringside DVD Sale with EBOOK", "DVD12", "49.90", "S" );
// addItem("Welcoming Home Your New Kitten", "A4", "3.00", "D" );
addItem("Adopting a Persian Kitten", "A5", "5.00", "D" );
// addItem("Good Breeding and Purr-fect Faith e-book", "A3EB1SP", "12.00", "D" );
// addItem("Adopting a Persian Kitten and Purr-fect Faith", "A5EB1SP", "12.00", "D" );
addItem("Hollywood for Persians and other Longhairs -The Purr-fect Bath- DVD", "DVDH", "32.95", "S" );
addItem("Rindside Edition, The Purr-fect Bath for Persians and other Longhairs DVD", "DVDR", "32.95", "S" );
addItem("Grooming DVD/Shampoo/Book Special", "DVDspR", "80.00", "S" );
addItem("DVD Combo Sale", "DVD12", "60.00", "S" );
addItem("DVD Combo and Purrfect Faith E-book", "SP1", "65.00", "S" );
addItem("32 Oz Healthy Coat pH Shampoo", "shampoo32", "27.95", "S" );
addItem("12 Oz Healthy Coat pH Shampoo", "shampoo12", "14.95", "S" );
addItem("32 Oz Healthy Coat Face/Body pH Shampoo", "shampoon32", "27.95", "S" );
addItem("12 Oz Healthy Coat Face/Body pH Shampoo", "shampoon12", "14.95", "S" );
addItem("32 Oz Healthy Coat Almond/Oatmeal/Honey pH Shampoo", "shampooco32", "27.95", "S" );
addItem("12 Oz Healthy Coat Almond/Oatmeal/Honey pH Shampoo", "shampooco12", "14.95", "S" );
addItem("12 Oz Healthy Coat pH Conditioner", "cond12", "11.95", "S" );
addItem("4 Oz Healthy Coat pH Face Shampoo", "face6", "7.40", "S" );
addItem("4 Oz Face Wash", "facewash4", "7.40", "S" );
addItem("12 Face Wash ", "facewash12", "14.95", "S" );
addItem("Groomer Hand Soap", "groomsoap", "8.95", "S" );
addItem("Grooming Face Powder- Large", "facepowder", "23.95", "S" );
addItem("Grooming Face Powder- Show size", "face4powder", "12.00", "S" );
addItem("Groomers Hand Lotion", "grromlotion", "8.95", "S" );
addItem("DVD and Shampoo Gift Set", "dvdface6", "34.95", "S" );
addItem("Anna Christmas Gift Set", "annagiftset4795", "47.95", "S" );
addItem("Shampoo Triple Sale", "comboface6", "30.00", "S" );
addItem("Doggie TT Bar", "dogbar", "8.95", "S" );
addItem("Fat Cat TT Bar", "catbar", "8.95", "S" );
addItem("Fat Cat and TT Bar Set", "catbarset", "8.95", "S" );
addItem("TT Bar", "ttbar", "7.50", "S" );
addItem("Stud Tail Bar", "studbar", "15.95", "S" );
addItem("HotSpot Bar", "hotbar", "15.95", "S" );
addItem("Chin Acne Bar", "chinbar", "15.95", "S" );
addItem("Dander Bar", "danderbar", "15.95", "S" );
addItem("Itch Relief Bar", "itchbar", "15.95", "S" );
addItem("Doggie Shampoo Bar", "doggiebar", "15.95", "S" );
addItem("Dark Coffee Soap", "3coffeesoapp", "23.95", "S" );
addItem("Face Trio", "facegrouptrio", "35.95", "S" );
addItem("Face Trio", "facegrouplgtrio", "44.95", "S" );
// ---------- End of items list ------------

document.write("<form name=\"abscart\" action=\"http://ww9.aitsafe.com/cf/add.cfm\" method=\"post\" target=\"abscart\">");
document.write("<input type=\"hidden\" name=\"userid\" value=\"B198936\">");
document.write("<input type=\"hidden\" name=\"product\" value=\"nothing\">");
document.write("<input type=\"hidden\" name=\"price\" value=\"0\">");
document.write("<input type=\"hidden\" name=\"units\" value=\"0\">");
document.write("</form>");

function Item( Description, ID, Cost, Type )
{
	this.Desc = Description;
	this.ID = ID;
	this.Cost = Cost;
	this.Type = Type;
}

function addItem( Description, ID, Cost, Type )
{
	var ActualCost;
	
	if( Description == "" )
	{
		document.write( "Description is empty on line 'addItem(\"" + Description + "\", \"" + ID + "\", \"" + Cost + "\", \"" + Type + "\");'<br>" );
		return;		
	}
	
	if( ID == "" )
	{
		document.write( "ID is empty on line 'addItem(\"" + Description + "\", \"" + ID + "\", \"" + Cost + "\, \"" + Type + "\");'<br>" );
		return;		
	}
	
	ActualCost = parseFloat( Cost );
	if( ActualCost <= 0 || ActualCost == NaN )
	{
		document.write( "Cost is invalid on line 'addItem(\"" + Description + "\", \"" + ID + "\", \"" + Cost + "\", \"" + Type + "\");'<br>" );
		return;		
	}
	
	if( Type != "S" && Type != "D" )
	{
		document.write( "Type is invalid on line 'addItem(\"" + Description + "\", \"" + ID + "\", \"" + Cost + "\", \"" + Type + "\");'<br>" );
		return;		
	}
	
	Items.push( new Item( Description, ID, Cost, Type ) );
}

function addToCart( ID )
{
	var w, screenWidth, screenHeight, Index;
	
	screenWidth = screen.availWidth - 200;
	screenHeight = screen.availHeight - 200;
	
	Index = findItem( ID );
	if( Index < 0 )
	{
		alert( "Can't find item " + ID + ". Please contact the web site administrator to resolve this problem." );
		return;
	}
	
	w = window.open( "", "abscart", "width=" + screenWidth + ",height=" + screenHeight + ",toolbar=0,scrollbars=1,statusbar=1,menubar=0,left=0,top=0,resizable=0,screenX=0,screenY=0" );
	document.abscart.product.value = Items[ Index ].Desc;
	document.abscart.price.value = Items[ Index ].Cost;
	
	if( Items[ Index ].Type == "S" )
		document.abscart.units.value = Items[ Index ].Cost;
	else
		document.abscart.units.value = "0";
		
	document.abscart.submit();
	w.focus();	
}

function findItem( ID )
{
	var i;
	
	for( i = 0; i < Items.length; ++i )
	{
		if( Items[i].ID == ID )
			break;
	}
	
	if( i == Items.length )
		i = -1;
	
	return i;
}

function viewCart()
{
	var w, screenWidth, screenHeight;
	
	screenWidth = screen.availWidth - 200;
	screenHeight = screen.availHeight - 200;
	
	w = window.open( "http://ww9.aitsafe.com/cf/review.cfm?userid=B198936", "abscart", "width=" + screenWidth + ",height=" + screenHeight + ",toolbar=0,scrollbars=1,statusbar=1,menubar=0,left=0,top=0,resizable=0,screenX=0,screenY=0" );
	w.focus();
}