function tabIt(from,to)
{
	if (from.getAttribute&&from.value.length==from.getAttribute("maxlength"))
	to.focus()
}

function ShowHideDiv(id)
{	
	var displayed = document.getElementById(id).style;
	if (displayed.display == '') displayed.display = 'none';
	else if (displayed.display == 'block') displayed.display = 'none';
	else displayed.display = 'block';
}

function ShowDiv(id)
{	
	var displayed = document.getElementById(id).style;
	displayed.display = 'block';
}

function HideDiv(id)
{	
	var displayed = document.getElementById(id).style;
	displayed.display = 'none';
}


/*counter = 0;
function ShowButtonAsProcessing(btn)
{
	counter++;
	
	btn.value = "...processing";
	
	if(counter >= 1) 
	{		
		alert(counter);
		
		if(counter >= 2) 
		{ 
			alert(counter);
			btn.disabled = true;
		}	
	}
}*/

function ShowButtonAsProcessing(btn)
{
	btn.value = "...processing";	
	__doPostBack(btn.name,'');
	btn.disabled = true;
}

// Pop up a new window
function popup(url,width,height,scrollbars) 
{
	var popwidth = width;
	var popheight = height;
	var leftoffset = (screen.width - popwidth - 10)/2;
	var topoffset = (screen.height - popheight - 40)/2;
	window.open(url,'_blank','titlebar=no,resizable=no,scrollbars=' + scrollbars + ',width=' + popwidth + ',height=' + popheight + ',left=' + leftoffset + ',top=' + topoffset);
}