function updateCalendar(house) {	var month, year;		month = gup('show_month');	year  = gup('show_year');		window.location = 'calendar.php?house=' + house + '&show_month=' + month + '&show_year=' + year;}function gup(name){  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  var regexS = "[\\?&]"+name+"=([^&#]*)";  var regex = new RegExp( regexS );  var results = regex.exec( window.location.href );  if( results == null )    return "";  else    return results[1];}function openCalendar(target, house, month, year) {	var elem, month, year;		if (target == "begin")		elem = document.getElementById('e_mes');	else		elem = document.getElementById('s_mes');		for (var i = 0; i < elem.length; i++) {		if (elem[i].selected)			month = month || elem[i].value;	}		if (target == "begin")		elem = document.getElementById('e_ano');	else		elem = document.getElementById('s_ano');		for (i = 0; i < elem.length; i++) {		if (elem[i].selected)			year = year || elem[i].value;	}		if (house == null) {		elem = document.getElementById('house');				for (i = 0; i < elem.length; i++) {			if (elem[i].selected)				house = elem[i].value;		}	}		window.name = target;	window.open('calendar.php?house=' + house + '&show_month=' + month + '&show_year=' + year,'','scrollbars=no,menubar=no,height=360,width=260,resizable=no,toolbar=no,location=no,status=yes');}function setDay(e){	var targ;	var date_array;	var prefix;		if(!e)		var e = window.event;			if(e.target) 		targ = e.target;	else if (e.srcElement)		targ = e.srcElement;			// Safari bug	if (targ.nodeType == 3)   		targ = targ.parentNode		date_array = targ.id.split("-");	if( window.opener.name == "begin" )		prefix = "e_";	else if( window.opener.name == "end" )		prefix = "s_";		// dia	window.opener.document.getElementById(prefix + "dia").selectedIndex = date_array[0] - 1;	// mes	window.opener.document.getElementById(prefix + "mes").selectedIndex = date_array[1] - 1;	// ano	window.opener.document.getElementById(prefix + "ano").selectedIndex = ( date_array[2] % (new Date()).getFullYear() );		window.close();}