function disable_with(item,value){document.getElementById(item).disabled=true;document.getElementById(item).value=value;}
function progressPercent(bar,percentage){document.getElementById(bar).style.width=parseInt(percentage*3)+"px";document.getElementById(bar).innerHTML="<div align='center'>"+percentage+"%</div>"}
function openWindow(url,w,h)
{var top=0;var left=0;top=Math.floor((screen.height-h)/2);left=Math.floor((screen.width-w)/2);popup=window.open(url,"kaleshwar","top="+top+",left="+left+",width="+w+",height="+h+",toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, copyhistory=0, menuBar=0");popup.focus();}
function getPageScroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
arrayPageScroll=new Array('',yScroll)
return arrayPageScroll;}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}
function showCenteredBox(div,div_width,div_height)
{var objLoadingImage=document.getElementById(div);var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();objLoadingImage.style.top=(arrayPageScroll[1]+((arrayPageSize[3]-35-div_height)/2)+'px');objLoadingImage.style.left=(((arrayPageSize[0]-20-div_width)/2)+'px');}