function btnClickAndDisable(self_obj) {
	self_obj.style.paddingLeft = '25px';
	self_obj.style.backgroundPosition = '5px, center';
	self_obj.style.backgroundRepeat = "no-repeat";
	self_obj.style.backgroundImage = "url('/img/spinner.gif')";
	
	self_obj.disabled = true;
	if (self_obj.form) {
		self_obj.form.submit();
	}
	//alert('here');
}

var panel;
function showPanel(panelname, acallfunction) {
	
	var panelref   = panelname;
	var overlayref = document.getElementById('blackout');
	panel = panelref;
	// make black overlay cover full page
	if (document.documentElement.scrollHeight) {  // firefox and IE
	    document.getElementById('blackout').style.height = document.documentElement.scrollHeight+'px';
	} else { // Chrome and IE
		document.getElementById('blackout').style.height = document.body.scrollHeight+'px';
	}
	
	panelref.style.display = 'block';
	overlayref.style.display = 'block';
	//alert(panelref.style.zIndex + ' ' + overlayref.style.zIndex);
	panel_height = panelref.offsetHeight;
	panel_width = panelref.offsetWidth;

	//alert(screen.height+':'+(screen.height/2)+':'+panel_height+':'+(panel_height/2));
	//alert(screen.width/2-panel_width/2);
	// adjust popup to be in visable scroll area
	//alert('here'+document.documentElement.scrollTop+' '+window.innerHeight+ ' '+document.documentElement.scrollHeight);
	if (window.pageYOffset) { //  Chrome
		
		panelref.style.top = (window.pageYOffset+((screen.height/2)-(panel_height/2)))+'px'; // -(window.pageYOffset)
		panelref.style.left = (screen.width/2-panel_width/2)+'px';
		//alert('1: '+window.height+'/2-'+window.paypanelref.pageYOffset+'/2px');
	} else { // IE and firefox
		panelref.style.top = (document.documentElement.scrollTop+(window.innerHeight/2-panel_height/2-50))+'px';// -(document.documentElement.scrollTop)
		panelref.style.left = (window.innerWidth/2-panel_width/2)+'px';
		/*
		panelref.style.top = (document.documentElement.scrollHeight/2-panel_height/2-50)+'px';// -(document.documentElement.scrollTop)
		panelref.style.left = (document.documentElement.scrollWidth/2-panel_width/2)+'px';
		*/
		//alert(panelref.style.left);
		//alert('2: '+document.documentElement.scrollHeight+'/2-'+document.documentElement.scrollTop+'/2px'+'----'+curtop);
	}
	
	if (acallfunction) {
		acallfunction();
	}

}
function hidePanel() {
	document.getElementById('blackout').style.display = 'none';
	panel.style.display = 'none';
}
