	function showhide(id){
		if(document.getElementById(id).style.display == 'none'){
  			document.getElementById(id).style.display = 'block';
 		}else{
  			document.getElementById(id).style.display = 'none';
 		}
	}

	function show(id){
		document.getElementById(id).style.display = 'block';
	}
	function hide(id){
		document.getElementById(id).style.display = 'none';
	}

	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=350,left = 376,top = 132');");
	}

	function disableButton (button) {
	  if (document.all || document.getElementById)
	    button.disabled = true;
	  else if (button) {
	    button.oldOnClick = button.onclick;
	    button.onclick = null;
	    button.oldValue = button.value;
	    button.value = 'DISABLED';
	  }
	}
	
	function calc_noites(){
		
		var d1 = document.getElementById("tp_start_dia").value;
		var m1 = document.getElementById("tp_start_mes").value;
		var y1 = document.getElementById("tp_start_ano").value;
		
		var d2 = document.getElementById("tp_end_dia").value;
		var m2 = document.getElementById("tp_end_mes").value;
		var y2 = document.getElementById("tp_end_ano").value;
		
		var sDate = new Date(m1+"/"+d1+"/"+y1);
		var eDate = new Date(m2+"/"+d2+"/"+y2);
		
		//var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));
		var daysApart = Math.round((eDate-sDate)/86400000);
				
		document.getElementById('ndias').value = daysApart;
	}

	