var xmlhttp = false;
var isBusy = false;
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		xmlhttp = false;
	}
}

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	xmlhttp = new XMLHttpRequest();
}

function saveInput(key, value){
		
	if (xmlhttp && key != "") {			
		if (isBusy){
			xmlhttp.onreadystatechange = function () {}
			xmlhttp.abort();
		}		
		var locarray = window.location.href.split("/");
		locarray.pop();		
		var path = locarray.join("/");		
		
		url = 'shop/tosession.asp?key='+key+'&value='+value;
		xmlhttp.open("GET", url, true);
		isBusy = true;		
		
		xmlhttp.onreadystatechange = function () {
			if(xmlhttp.readyState == 4){
				isBusy = false;
			}
		}			
		xmlhttp.send(null);
	}
}

function checkDeliveryDate(pickedDate, n_datetime, b_close){
	if (xmlhttp && pickedDate.getMonth() != "") {				

		url = "checkdeliverdate.asp?day="+pickedDate.getDate()+"&month="+(pickedDate.getMonth()+1)+"&year="+pickedDate.getFullYear();
		xmlhttp.open("GET", url, true);	
		
		xmlhttp.onreadystatechange = function () {
			if(xmlhttp.readyState == 4){
				script = xmlhttp.responseText;
				eval(script);
				if(strMsg == "ok"){
					isCorrectDate = true;
					set_datetime(n_datetime, b_close);
					return true;
				}
				else{
					alert(strMsg);
					return false;
				}
				
			}
		}
			
		xmlhttp.send(null);
	}
}


