﻿/// <reference path="utility.js" />

var _input_textbox = "";
var _input_valuebox = "";


//弹出区域选择框
function ShowLocationSelect(textboxid, valueboxid) {
	_input_textbox = textboxid;
	_input_valuebox = valueboxid;
	ShowBackGroundBox(500, 300, "");
	LocationHandler(0, 0, 0);
}


function LocationHandler(p, c, d) {
	Ajax("/api/Location.aspx", { p: p, c: c, d: d }, function(html) { SetBackGroundBox(html); }, function() { alert("程序出错"); });
}


//点击确定选择时的事件
function ClickOkHandler() {
	document.getElementById(_input_textbox).value = document.getElementById("input_textbox").value;
	document.getElementById(_input_valuebox).value = document.getElementById("input_valuebox").value;
	HideBackGroundBox();
}

//弹出日期选择框
function ShowDateSelect(textboxid, valueboxid) {
	_input_textbox = textboxid;
	_input_valuebox = valueboxid;
	ShowBackGroundBox(500, 300, "");
	Ajax("/api/DateApi.aspx", {}, function(html) { SetBackGroundBox(html); }, function() { alert("程序出错"); });
}

function DateHandler(datevalue) {
	//document.getElementById("selected_span").innerHTML = datevalue;
	document.getElementById("input_textbox").value = datevalue;
	document.getElementById("input_valuebox").value = datevalue;
	ClickOkHandler();
}

//弹出星级选择框
function ShowStarSelect(textboxid, valueboxid) {
	_input_textbox = textboxid;
	_input_valuebox = valueboxid;
	ShowBackGroundBox(500, 100, "");
	Ajax("/api/StarApi.aspx", {}, function(html) { SetBackGroundBox(html); }, function() { alert("程序出错"); });
}

function StarHandler(starname, starvalue) {
	//document.getElementById("selected_span").innerHTML = datevalue;
	document.getElementById("input_textbox").value = starname;
	document.getElementById("input_valuebox").value = starvalue;
	ClickOkHandler();
}

//弹出价格选择框
function ShowPriceSelect(textboxid, valueboxid) {
	_input_textbox = textboxid;
	_input_valuebox = valueboxid;
	ShowBackGroundBox(500, 100, "");
	Ajax("/api/PriceApi.aspx", {}, function(html) { SetBackGroundBox(html); }, function() { alert("程序出错"); });
}

function PriceHandler(starname, minprice, maxparice) {
	//document.getElementById("selected_span").innerHTML = datevalue;
	document.getElementById("input_textbox").value = starname;
	document.getElementById("input_valuebox").value = minprice + "," + maxparice;
	ClickOkHandler();
}