//Spry.Debug.enableTrace = false; 
var scrollSpryTop = 0;
$(document).ready(function () {
	scrollSpryTop = $("a#scrollTo").position().top;
});
function getView(url, inp){
	var w = 200;
	var h = 225;
	var scX = (screen.width - w) / 2;
	var scY = (screen.height - h) / 2;
	
	if(inp){
		var val = document.getElementById(inp).value;
		url = url+'?inp='+inp+'&selectDate='+val;
	}
	mwin = 'width='+w+',height='+h+',top='+scY+',left='+scX+'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no';
	win = window.open(url, 'viewDetails', mwin);
	win.window.focus();
}
function setDateIn(selDate, inp){
	document.getElementById(inp).value = selDate;
	var timeInput = document.getElementById(inp+'_time');
	if(timeInput != null){
		if(timeInput.value == ''){
			var d=new Date();
			var hr = (d.getHours() < 10 ? '0' : '')+d.getHours();
			var mn = (d.getMinutes() < 10 ? '0' : '')+d.getMinutes();
			var sc = (d.getSeconds() < 10 ? '0' : '')+d.getSeconds();
			timeInput.value = hr+':'+mn+':'+sc;
		}
		validateInputs[1].validate();
	}
	if(inp == 'active_to'){
		validateInputs[2].validate();
	} else {
		validateInputs[0].validate();
	}
}
