	var suggestit = {
		i:		0,
		l:		"",

		doit:		function (i, l) {
					this.i = i;
					this.l = l;
					openPopupScroll(_url_suggest, 600, 600);
				},

		sel:		function (t, id) {
					document.getElementById(this.l+"id"+this.i).value = id;
					document.getElementById(this.l+"input"+this.i).value = t;
				}
	}

 function clone(o) {
 	if(!o || "object" !== typeof o) return o;

	var c = "function" === typeof o.pop ? [] : {};
	var p, v;

	for(p in o) {
		if(o.hasOwnProperty(p)) {
			v = o[p];
			if(v && "object" === typeof v) 	c[p] = clone(v);
			else 				c[p] = v;
		}
	}

 	return c;
 }

 function openPopup(loc, w, h) {
	var date = new Date();
	var name = "" + date.getTime();
	var win = null;

	tp = Math.ceil((screen.height-h)/2);
	lf = Math.ceil((screen.width-w)/2);

	var win=window.open(loc,name,"width="+w+",height="+h+",top="+tp+",left="+lf+',channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');

	win.focus();
	return win;
 }

 function openPopupScroll(loc, w, h) {
	var date = new Date();
	var name = "" + date.getTime();
	var win = null;

	tp = Math.ceil((screen.height-h)/2);
	lf = Math.ceil((screen.width-w)/2);

	var win=window.open(loc,name,"width="+w+",height="+h+",top="+tp+",left="+lf+',channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no');

	win.focus();
	return win;
 }

 function get_selected_index(sel) {
	for (q=0; q<sel.length; q++) if (sel[q].selected) return q;
 }

	function make_select(selectbox, o) {
		for (var i=0; i < o.length; i++) {
			var optn = document.createElement("OPTION");
			optn.text = o[i].text;
			optn.value = o[i].value;
			optn.selected = o[i].sel;
			selectbox.options.add(optn);
		}
	}

	function findPos(obj) {
		var curleft = curtop = 0;
		if (obj.offsetParent) {
			do {
				curleft += obj.offsetLeft;
				curtop += obj.offsetTop;
			} while (obj = obj.offsetParent);

			return [curleft,curtop];
		}
	}

	function goto_calendar() {
		var err = "";

		if (document.frmSearch.txtSearchId3.value == '') err += errors['search_arrive_e'] + "\n";

		if (document.frmSearch.cntAdt.value == 0 && document.frmSearch.cntYth.value == 0 && document.frmSearch.cntChd.value == 0 && document.frmSearch.cntYdt.value == 0 && document.frmSearch.cntInf.value == 0)
			err += errors['search_people_e'] + "\n";

		if (err != "") {
			alert(err);
			return false;
		}

		document.frmSearch.submit();
	}
