function dT_selector(obj, date, h, w) {

	var _w = -250 + Math.ceil(screen.availWidth / 2);
	var _h = -400 + Math.ceil(screen.availHeight / 2);
	var _p = "height=" + h + "px,width=" + w + "px,scrollbars=yes,resizable=yes,top=" + _h.toString() + "px,left=" + _w.toString() + "px";
	

// alert(date);

	f = window.open("/date-selector.html?o=" + obj + "&date=" + date, "dT_selector", _p);
	f.focus();

}


function __dT_selector(obj, date, h, w) {
	dT_selector(obj, date, h, w);
}


var query;
var valide = 0;
var _cur;
var _this_name = window.name;

// alert(_this_name);

function __init_dT_selector() {

	if (_this_name == "dT_selector") {

		if (location.search.charAt(0) == "?")
		{ query = location.search.slice(1).split("&");
		  if (((query[0].indexOf("o=") == 0) && (query[1].indexOf("date=") == 0)))
			{
			query[0] = query[0].slice(2);
			query[1] = decodeURI(query[1].slice(5));
			valide = 1;

			var sTemp = query[0];

			}
		else {


			query = new Array('', '');
			var d = document.getElementById('__dT_source');

			if (d) { query[0] = d.value; }
		}


		}
	}
}

// alert(query[0]);


function s(obj) {

	var sTemp = query[0];

	try {
		opener.document.getElementById(sTemp).value = obj;
	}
	catch (e) { alert('Crash: ' + e + ' - sTemp: ' + sTemp); }







}



var f;
function color_selector_orig(obj, text) {
// alert(obj.name);
// location=yes

	var _w = -250 + Math.ceil(screen.availWidth / 2);
	var _h = -400 + Math.ceil(screen.availHeight / 2);
	var _p = "height=600px,width=660px,resizable=yes,top=" + _h.toString() + "px,left=" + _w.toString() + "px";

	f = window.open("/admin/select-color.aspx?o=" + obj.name + "&t=" + text, "colorSelector", _p);
	// alert(_p);

	f.focus();
}