function openSubWindow(winURL, x, y,scrollable) {
	//alert(winURL);   
	//set properties for sub window
	var winBars = 'directories=no,location=no,menubar=no,resizable=yes,status=no,titlebar=no,toolbar=no';
	winBars += ',width=' + x + ',height=' + y;
	var winOptions = '' //'fullscreen';
	if(scrollable){ winOptions += ',scrollbars=yes';}
	var winFeatures = winBars + winOptions;
	//set x and y coordinate to the center of screen.
	var PosY = (screen.height/2)-(x/2);
	var PosX = (screen.width/2)-(y/2);
	winBars += ',top=' + PosY + ',left=' + PosX;
	
	//set frameset html block code
	/*var winFrameSet = "<HTML><HEAD runat="server"></HEAD>";
	winFrameSet += "<frameset rows='*' framespacing=0>";
	winFrameSet += "<frame name='main' src=" + winURL + " scrolling=no>";
	winFrameSet += "</frameset>";
	winFrameSet += "</HTML>";
	*/
	//first check to see if any sub window already open.
	if (window.subWindow) {
	//sub window exist. close it first before opening a new sub window
		window.subWindow.close();
	}
	//open new blank window with properties set above.
	var subWindow = window.open(winURL, "subWindow", winFeatures);
	if (subWindow==null || typeof(subWindow)=="undefined") {
		return true;
		alert('Cannot open the window. Please turn off the POPUP BLOCKER!');
	} 
	//send blank window to back for manipulation (size, position, populate)
	subWindow.blur();
	//subWindow.resizeTo(x,y);
	//move blank window to center screen
	//subWindow.moveTo(PosX, PosY);
	//populate blank window
	//subWindow.document.open();
	//subWindow.document.write(winFrameSet);
	//bring populated sub window back to focus
	subWindow.focus();
	window.onunload = function() {subWindow.close();};
}
function openHelpWindow(url, w, h, scrollable)
{
   var hid = window.document.getElementById("hid");
    if (hid == null || typeof(hid)=="undefined")
    {
        alert('Sorry! No help available for this page');
    }
    else
    {    
        url = url + '?hid='+ hid.value;
        openSubWindow( url, w, h, scrollable);
    }   
}

function enterToTab()
{
if (event.keyCode==13) {event.keyCode=9; return event.keyCode }
}
function clickButton(e, buttonid){
 //__doPostBack( 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; 
                  } 
            } 
      } 
} 
function PostButton(e, buttonid){
  
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        __doPostBack( buttonid,'') ;                          
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        __doPostBack( buttonid,'') ; 
                        return false; 
                  } 
            } 
      } 
} 