

function getElement(id){
  if(document.getElementById){    // test the most common method first
      return document.getElementById(id);
  }else if(document.all){         // test older versions of IE
      return document.all[id];
  }else if(document.layers){      // test older versions of Netscape
      return document.layers[id];
  }else{                          // not sure what to do...return null
      return null;
  }
}

function update_cart_item(my_val, my_action){
	
	if(getElement("hid_ttl_items") && (my_action == 'delete_item') ){
		if(getElement("hid_ttl_items").value == 1){
			if(confirm("By deleting this last item, you order will be cancelled")){
				getElement("hid_action"+my_val).value = my_action;
				getElement("frm_item"+my_val).submit();		
			}
		}
	} else {
		getElement("hid_action"+my_val).value = my_action;
		getElement("frm_item"+my_val).submit();
	}
	
}

function add_promo_code(){
	
	getElement("frm_promo_code").submit();
	
}

function show_passwords(){
	
	if(getElement("chk_save_info").checked == true){	
		getElement("passwords").style.display = "block";
	} else {
		getElement("passwords").style.display = "none";
	}
	
}