window.onscroll = setScrollPos;

function setScrollPos()
{
	var ScrollTop = document.body.scrollTop;
	
	if(ScrollTop == 0)
	{
		if(window.pageYOffset)
			ScrollTop = window.pageYOffset;
		else
			ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;				
	}
			
	var hid = document.getElementById("scrollpos");
	hid.value = ScrollTop;
	
}

function autoScroll()
{
	var obj = document.getElementById("scrollpos");
	var pos = obj.value + 20;
	
	window.scrollTo(0, pos);
}

function makeCalendarTextboxClickable()
{
	for(i=0;i<5;i++)
	{
	if(document.getElementById('ProductDetail21_CAttributeControl1_dlCustomAttributes__ctl' + i + '_txtDate'))
		{
		var txt = document.getElementById('ProductDetail21_CAttributeControl1_dlCustomAttributes__ctl' + i + '_txtDate');
		break;
		}
	}
	txt.onclick = test;
}

function test(str)
{
	__doPostBack('ProductDetail21$CAttributeControl1$dlCustomAttributes$_ctl0$lnkShowCalendar','');
}
