function openPopupModal(path, PopupWidth, PopupHeight, resizeable){
   LeftPosition = (screen.width) ? (screen.width-PopupWidth)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-PopupHeight)/2 : 0;
   window.showModalDialog(path, window, 'dialogLeft:' + LeftPosition + 'px;dialogTop:' + TopPosition + 'px; dialogHeight: ' + PopupHeight + 'px; dialogWidth: ' + PopupWidth + 'px; edge: Raised; center: Yes; help: no; resizable:' + resizeable + '; status: no;scroll :no;');
}

function openPopupModeless(path, PopupWidth, PopupHeight, resizeable){
   LeftPosition = (screen.width) ? (screen.width-PopupWidth)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-PopupHeight)/2 : 0;
   window.showModelessDialog(path, window, 'dialogLeft:' + LeftPosition + 'px;dialogTop:' + TopPosition + 'px; dialogHeight: ' + PopupHeight + 'px; dialogWidth: ' + PopupWidth + 'px; edge: Raised; center: Yes; help: no; resizable:' + resizeable + '; status: no;scroll :no;');
}

function openPopupNonModal(path, PopupWidth, PopupHeight, resizeable)	{
   LeftPosition = (screen.width) ? (screen.width-PopupWidth)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-PopupHeight)/2 : 0;
   window.open(path, '', 'width='+PopupWidth+', height='+PopupHeight+', left='+LeftPosition+', top='+TopPosition+', scrollbars=1,toolbar=0,location=0, directories=0, status=0, menuBar=0, resizable=1').focus();
 }
 
function openPopupNewWindow(path)	{
   //window.open(path,'','width=800,height=600').focus();
   window.open(path).focus();
}

function openPopupImage(path, PopupWidth, PopupHeight)	{
   LeftPosition = (screen.width) ? (screen.width-PopupWidth)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-PopupHeight)/2 : 0;
   pagecode='<html><head><title>Preview Image</title>'
   pagecode+='</head><body topmargin=0 leftmargin=0 bottommargin=0 rightmargin=0 '
      pagecode+='>'
   pagecode+='<img src='+path+'>'
   pagecode+='</body></html>'
   window.open('javascript:document.write(\''+pagecode+'\')', '', 'width='+PopupWidth+', height='+PopupHeight+', left='+LeftPosition+', top='+TopPosition+', toolbar=0, location=0, directories=0, status=0, menuBar=0, resizable=no').focus();
}
