//FUNC with scrollbar allowance
function popUpH(pageRef,winRef,w,h,opts)
{
	//alert("agent="+navigator.userAgent)
	//alert("appname="+navigator.appName)

	settings1='';settings2=''

	w=w*1;h=h*1

	to=false;sc=false;me=false;st=false;lo=false;re=false;di=false;

	toH=0;scW=0;meH=0;stH=0;loH=0;diH=0;

	if (opts.indexOf('re') == -1) {settings2+=',resizable=no'}
		else {re=true; settings2+=',resizable=yes'}
	if (opts.indexOf('sc') == -1) {settings2+=',scrollbars=no'}
		else {sc=true; settings2+=',scrollbars=yes'}
	if (opts.indexOf('me') == -1) {settings2+=',menubar=no'}
		else {me=true; settings2+=',menubar=yes'}
	if (opts.indexOf('to') == -1) {settings2+=',toolbar=no'}
		else {to=true; settings2+=',toolbar=yes';tbH=100}
	if (opts.indexOf('di') == -1) {settings2+=',directories=no'}
		else {di=true; settings2+=',directories=yes'}
	if (opts.indexOf('lo') == -1) {settings2+=',location=no'}
		else {lo=true; settings2+=',location=yes'}
	if (opts.indexOf('st') == -1) {settings2+=',status=no'}
		else {st=true; settings2+=',status=yes'}

	if (IsUsingNS() && IsUsingPC())
		{
		w=w+18
		h=h+15
		}
	else if(IsUsingSAF())
		{
		w=w+8
		h=h+10
		if (sc)	{scW=15}
		}
	else if (IsUsingNS() && IsUsingMAC())
		{
		w=w+18
		h=h+15
		}
   	else if(IsUsingIE() && IsUsingMAC())
		{
		w=w+10
		h=h+15
		if (sc)	{scW=15}
		}
	else
		{
		w=w+20
		h=h+30
		}

	totH= h+toH+meH+stH+loH+diH;
	totW= w+scW

	leftPosition=(screen.width)?(screen.width - totW)/2:100;
	topPosition=(screen.height)?(screen.height - totH)/2:100;

	if (opts.indexOf('tl') != -1) {leftPosition=5;topPosition=5}
	if (opts.indexOf('bl') != -1) {leftPosition=5;topPosition=screen.height - (totH + 40)}
	if (opts.indexOf('tr') != -1) {leftPosition=screen.width - (totW + 10);topPosition=1}
	if (opts.indexOf('br') != -1) {leftPosition=screen.width - (totW + 10);topPosition=screen.height - (totH + 40)}

	if (IsUsingOP())
		{topPosition=topPosition*0.25}

	lp = Math.floor(leftPosition)
	tp = Math.floor(topPosition)
	wid = Math.ceil(totW)
	hei = Math.ceil(totH)

	settings1='width='+ wid + ',height='+ hei + settings2 + ',top=' + tp + ',left=' + lp ;

	var newWin=window.open(pageRef,winRef,settings1);

	newWin.focus()

	if (navigator.appName=="Netscape"|| navigator.appName=="Microsoft Internet Explorer")
		{return;}
	else
		{newWin.location=gotoURL;newWin.focus();}
}


function IsUsingIE() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("microsoft") != -1) result = true; return result; }

function IsUsingNS() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("netscape") != -1) result = true; return result;}

function IsUsingOP() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("opera") != -1) result = true; return result;}

function IsUsingSAF() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("safari") != -1) result = true; return result;}

function IsUsingPC() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("win") != -1) result = true; else if (strBrowser.indexOf("inux") != -1) result = true; return result; }

function IsUsingMAC() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("mac") != -1) result = true; else if (strBrowser.indexOf("68k") != -1) result = true; return result; }
