//var store_page="storepage.htm"
var shopping_cart_page="shoppingcart.htm"
var Personal_Details="PersonalDetails.htm"
var Check_Out="checkout.htm"
var pondliners="PondLiners.htm"
//var shopping_cart_page="TTModern.htm"
var store_page="TTModern.htm"
var Tabletopplants="tabletopplants.html"


function add_to_cart(number,n,pr,desc)
{
for(var counter=0;counter<database_records.length;counter++)
{
if(database_records[counter].number==number)
{
database_records[counter].quantity=n
database_records[counter].price=pr
//alert(database_records[counter].color)
database_records[counter].description=desc
//alert(desc)
var current_quantity=database_records[counter].quantity
if(current_quantity==0)
{
update_record_quantity(counter,1,pr,desc)
}
var current_desc=database_records[counter].description
if(current_desc=="")
{
update_record_quantity(counter,current_quantity,pr,desc)
}
var current_price=database_records[counter].price
if(current_price==0)
{
update_record_quantity(counter,current_quantity,pr,desc)
}

}


save_orders()
save_orders1()
save_orders2()

//location=shopping_cart_page
}
}


function remove_from_cart(record_index)
{
update_record_quantity(record_index,0)
save_orders()
//save_orders1()

location.reload()
}

function update_record_quantity(record_index,record_quantity,record_price,record_desc)
{
database_records[record_index].quantity=record_quantity
database_records[record_index].price=record_price
database_records[record_index].desc=record_desc


if(record_quantity==0)
{
total_ordered--
}


}

function recalculate_order()
{
for(var counter=0;counter<document.shopping_cart.length;counter++)
{
if(document.shopping_cart[counter].type=="text")
{
current_quantity=document.shopping_cart[counter].value
var current_index=document.shopping_cart[counter].record_index
update_record_quantity(current_index,current_quantity)
}
save_orders()
//save_orders1()

location.reload()
}
}



