// Function To Open Popup Window
window.onerror = null;
var win = null;

function NewWindow(mypage,myname,w,h,scroll,resizable, resizeit){

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;

TopPosition = (screen.height) ? (screen.height-h)/2 : 0;

settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resizable+'';
win = window.open(mypage,myname,settings)

if(resizeit == 'true'){
wnew=parseFloat(w)+40;
hnew=parseFloat(h)+40;
win.resizeTo(wnew, hnew);
LeftPosition = (screen.width) ? (screen.width-wnew)/2 : 0;
TopPosition = (screen.height) ? (screen.height-hnew)/2 : 0;
win.moveTo(LeftPosition,TopPosition);
}

if(win.window.focus){win.window.focus();}

}

// Function To Close Window
function closeWindow(){
window.close();
}
