﻿function popupInTheMiddle(url,name,w,h,tl,lo,st,me,sc,res){
	var osName = navigator.appVersion;
	var browser = navigator.appName;
	var sw = screen.width;
	var sh = screen.height;
	x = (sw-w)/2;
	y = (sh-h)/2-50;
	var newwin = window.open(url,name,'width='+w+',height='+h+',left='+x+',top='+y+',toolbar='+tl+',location='+lo+',status='+st+',menubar='+me+',scrollbars='+sc+',resizable='+res+'')
	newwin.focus();
}

function openFullScreen(url){
	var osName = navigator.appVersion;
	var browser = navigator.appName;
	var w = screen.width;
	var h = screen.height;
	if(osName.indexOf('Safari')!=-1){
		var newwin = window.open(url,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbar=1,resizable=0');
		newwin.moveTo(0,0);
		newwin.resizeTo(screen.width,screen.height-22);
		newwin.focus();
	}else{
		var newwin = window.open(url,name,'fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbar=1,resizable=0,width=' + screen.width + ',height=' + screen.height);
		if(osName.indexOf('Mac')!=-1){
			if(browser.charAt(0)=="M"){
				newwin.moveTo(0,0);
				newwin.resizeTo(screen.width,screen.height);
				newwin.focus();
			}else{
				newwin.moveTo(0,0);
				newwin.resizeTo(screen.width,screen.height-43);
				newwin.focus();
			}
		}else{
			newwin.moveTo(0,0);
			newwin.resizeTo(screen.width,screen.height);
			newwin.focus();
		}
	}
}
