/**
 * My Domain List Specific JS file
 * 
 * @author Luciana Bruscino
 * @license GPL
 */

jQuery(document)
		.ready(
				function() {
					jQuery("table.myDomainListOfferDetails tbody").hide();
					jQuery("tr.myDomainListOfferComments").hide();
					jQuery('table.myDomainListOfferDetails thead td').click(
							function() {
								jQuery(this).parents(
										'table.myDomainListOfferDetails')
										.children('tbody').slideToggle(250);
							});
					jQuery('td.myDomainListOfferCommentsButton').click(
							function() {
								jQuery(this).parent().next().slideToggle(250);
							});
					jQuery("td.myDomainListOfferDismissButton").live("click",
									function() {
										var offerCountElement = jQuery(this)
												.closest('table').find(
														'thead td').eq(1)[0];
										var offerCountValue = parseInt(offerCountElement.childNodes[0].nodeValue) - 1;
										jQuery(this).parent("thead:first")
												.remove();
										offerCountElement.innerHTML = offerCountValue;
										jQuery(this).parent().next().remove();
										jQuery(this).parent("tr:first")
												.remove();
										my_domain_list_process_offer_dismiss(this.id);
									});
				});

