﻿function changeRaiseBidToPlaceBid() {
	var bt = document.getElementById("ctl00_body_LoginView2_btPlaceBid");
	if (bt) {
		bt.value = "Place Bid";
	}
}

//		function placeBid(sender) {
//			var btBid = document.getElementById("ctl00_body_LoginView2_btPlaceBid");
//			if (btBid) {
//				var confirmation;
//				if (btBid.value == "Place Bid") {
//					confirmation = confirm("Are you sure you want to bid on this item?");
//				}
//				else if (btBid.value == "Raise Max Bid") {
//					confirmation = confirm("Are you sure you want to raise your max bid?");
//				}
//				if (confirmation) {
//					__doPostBack(sender.id, '');
//				}
//			}
//		}


//var secondsInterval = setInterval("countDown()", 1000);
function countDown() {
	var time;
	var container = document.getElementById("ctl00_body_lblSecondsRemaining");
	if (container) {
		time = container.innerHTML;
		if (time != "") {
			if (time == 1) {
				clearInterval(secondsInterval);
				//__doPostBack('', '');
			}
			container.innerHTML = time - 1;
		}

	}
}

//		function validateRequireBid(sender, args) {
//			//alert(document.getElementById("ctl00_body_txbBid_Value").value);
//			args.IsValid = true;
//		}

function confirmValidBid(sender) {
	Page_ClientValidate();
	if (Page_IsValid) {
		if (sender.value == "Place Bid") {
			return confirm("Are you sure you want to bid on this item?");
		}
		else if (sender.value == "Raise Max Bid") {
			return confirm("Are you sure you want to raise your max bid?");
		}
	}
	return Page_IsValid;
}
