function auctionCallBack(t){   
	closeDiv('alert');
	var data = eval("("+t.responseText+")");
	var auctionDetails = data["auctionDetails"];
	var auctionDetailResult = eval("("+auctionDetails+")");
	
	auctionDetailResult.each(function(auctionDesc){
	     var tableDetailData = Builder.node("table", {"border":"0", "style":"margin:2px;background-color:#000000;z-index:10;border:1px solid #000000", "width":"99%"}, [
	                           Builder.node("tbody", {}, [
	                               Builder.node("tr", {}, [
										Builder.node("td", {"width":"30%"}, [
											Builder.node("span", {"class":"dark_yellow_medium"}, [
												"Auction Details"
											])
									
										]),
										Builder.node("td", {"align":"right","width":"70%"}, [
											Builder.node("label",{"style":"color:#ffffff;","onclick":"closeDiv('auction')","onmouseover":"this.style.color='#ff0000';this.style.fontWeight='bold';","onmouseout":"this.style.color='#ffffff';this.style.fontWeight='bold';"}, [
												"X"
											])
										])
									]),
				       
				        		Builder.node("tr", {}, [
									Builder.node("td", {"width":"20%","valign":"top"}, [
										Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
											"Auction Date:"
										])
									]),
								
									Builder.node("td", {"width":"80%","valign":"top"}, [
										Builder.node("span", {"class":"dark_yellow_small"}, [
											auctionDesc.auctionDate
										])
									])
							
						  		  ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Brand Name:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										auctionDesc.brand
									])
								])
							
						  ]),
						  
						  
						  Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Model Number:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										auctionDesc.model
									])
								])
							
						  ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Current Price:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										"$"+auctionDesc.currentPrice
									])
								])
							
						  ]),
						  
						  Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Discount:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										auctionDesc.discount
									])
								])
							
						  ])
					    ])
	               ]);
	     
	    
	      document.getElementById("auctionDetailDiv").style.display='block';			  
		  var detailId = document.getElementById("detailId");	
		  detailId.innerHTML = "";	
		  detailId.appendChild(tableDetailData);
		  //document.getElementById("alertStatusId").style.display='none';    
	     
	});
	
	
}   

function closeDiv(param){
	if(param=='auction'){
		document.getElementById('auctionDetailDiv').style.display='NONE';
	}else{
		document.getElementById('alertDetailDiv').style.display='NONE';
	}

}


function alertCallBack(t){
   
	closeDiv('auction');
	var data = eval("("+t.responseText+")");
	var alertDetails = data["alertDetails"];
	var alertDetailResult = eval("("+alertDetails+")");	
	var discount;
	alertDetailResult.each(function(alertDesc){
		 if(alertDesc.discount==null){
		    	discount = "0%";
		    }else{
		    	discount=alertDesc.discount;
		   }
	     var tableDetailData = Builder.node("table", {"border":"0", "style":"margin:2px;background-color:#000000;z-index:10;border:1px solid #000000", "width":"99%"}, [
	                           Builder.node("tbody", {}, [
	                               Builder.node("tr", {}, [
										Builder.node("td", {"width":"30%"}, [
											Builder.node("span", {"class":"dark_yellow_medium"}, [
												"Alert Details"
											])
									
										]),
										Builder.node("td", {"align":"right","width":"70%"}, [
											Builder.node("label",{"style":"color:#ffffff;","onclick":"closeDiv('alert')","onmouseover":"this.style.color='#ff0000';this.style.fontWeight='bold';","onmouseout":"this.style.color='#ffffff';this.style.fontWeight='bold';"}, [
												"X"
											])
										])
									]),
				       
				       
				        		Builder.node("tr", {}, [
									Builder.node("td", {"width":"20%","valign":"top"}, [
										Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
											"Alert Date:"
										])
									]),
								
									Builder.node("td", {"width":"80%","valign":"top"}, [
										Builder.node("span", {"class":"dark_yellow_small"}, [
											alertDesc.alertDate
										])
									])
							
						  		  ]),
						  
						   		Builder.node("tr", {}, [
									Builder.node("td", {"width":"20%","valign":"top"}, [
										Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Area Code:"
										])
									]),
								
									Builder.node("td", {"width":"80%","valign":"top"}, [
										Builder.node("span", {"class":"dark_yellow_small"}, [
											alertDesc.areaCode
										])
									])
							
						  		 ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Brand Name:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										alertDesc.brand
									])
								])
							
						  ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Product Name:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										alertDesc.productName
									])
								])
							
						  ]),
						  
						  Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Model Number:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										alertDesc.model
									])
								])
							
						  ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Current Price:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										"$"+alertDesc.currentPrice
									])
								])
							
						  ]),
						  
						  Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Desired Price:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
										"$"+alertDesc.desiredPrice
									])
								])
							
						  ]),
						  
						   Builder.node("tr", {}, [
								Builder.node("td", {"width":"20%","valign":"top"}, [
									Builder.node("span", {"style":"color:#428FCC;font-size:12px;font-weight:bold"}, [
										"Discount:"
									])
								]),
								
								Builder.node("td", {"width":"80%","valign":"top"}, [
									Builder.node("span", {"class":"dark_yellow_small"}, [
								    discount
									])
								])
							
						  ])
					    ])
	               ]);
	     
	      document.getElementById("alertDetailDiv").style.display='block';			  
		  var detailId = document.getElementById("detailId1");	
		  detailId.innerHTML = "";	
		  detailId.appendChild(tableDetailData);
		  //document.getElementById("alertStatusId").style.display='none';    
	     
	});
	
	
}   