function setFocusTo(controlName){
	var control = document.getElementById(controlName);
	if (control) { 
		control.focus();
	}
}

function OpenPopUp(url, pageName) 
{
	var winWidth = 700;
	var winHeight = 580;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
	win1 = window.open(url, pageName, 
	"menubar=0,toolbar=0,resizable=1,scrollbars=1" +
	",width=" + winWidth + ",height=" + winHeight + 
	",top="+winTop+",left="+winLeft);
}

function ToggleVisible(imageCtrl, openImage, closeImage, ctrl)
{
	imgCtrl = document.getElementById(imageCtrl);
	control = document.getElementById(ctrl);
	if (imgCtrl) 
	{
		if (control.style.display == "none")
		{
			imgCtrl.src = closeImage;
			control.style.display = "block";
		}
		else
		{
			imgCtrl.src = openImage;
			control.style.display = "none";
		}
	}
	
	return false;
}

function clickButton(e, buttonid)
{ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1))
            { 
                  if (e.keyCode == 13)
                  { 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
            { 
                  if (event.keyCode == 13)
                  { 
                        bt.click(); 
                        return false; 
                  } 
            } 
      }
} 
			
