// ------------------------------------------------
// Print Page
// ------------------------------------------------

function printPage() {
  if (confirm("Ok To Print Page?")) { 
   window.parent.printaction.focus();
   window.print();
 }
}


// ------------------------------------------------
// Open Center Popup Windows
// ------------------------------------------------
var win = null;
function NewWindow(mypage,myname,w,h,scroll,resize,tool,menu,s){
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='+resize+',toolbar='+tool+',menubar='+menu+',status='+s+''
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

// ------------------------------------------------
// Auto Resize
// ------------------------------------------------
function fitPic(s, p){
window.open('picture.html?'+s+'?'+p,'fitWindow','height=100,width=100,top=100,left=100,z-lock=1,resizable=1');
}

function fit(){
	if(navigator.appName.indexOf('Microsoft')>=0)
		window.resizeBy(document.images[0].width-document.body.clientWidth, document.images[0].height-document.body.clientHeight);
	else window.resizeBy(document.images[0].width-window.innerWidth, document.images[0].height-window.innerHeight);
}
