<!-- Begin POP-UP

function popup(pageToLoad, windowname, width, height, scroll, center, resize, dependent)
{
	if (! window.focus) return true;
	var winname = null;
	var href;
	var args = 'width='+width+',height='+height;
	
    var xposition = 0;
    var yposition = 0;
    if (center)
    {
        xposition = (screen.availWidth - width - 10) * .5;
        yposition = (screen.availHeight - height - 30) * .5;
		args = args + ',left='+xposition+',top=' + yposition;
    }

	if (scroll)		{args = args + ',scrollbars=yes'; }
		
    if (resize)		{args = args + ',resizable=yes'; }
		
    if (dependent == null || dependent == "") {args = args + ',dependent=0'; }
    
	if (typeof(pageToLoad) == 'string')
		href=pageToLoad;
	else
		href=pageToLoad.href;
	winname = window.open(href, windowname, args+'location=0,menubar=0,status=0,titlebar=0,toolbar=0,hotkeys=0,copyhistory=0');
	winname.opener = self;
	winname.focus();
	return false;
}

function openExternalPopup(pageToLoad, windowname, width, height, center, scroll, resize)
{
    var xposition=0;
    var yposition=0;
	var args = 'width='+width+',height='+height;

    if (center)
    {
        xposition = (screen.availWidth - width - 10) * .5;
        yposition = (screen.availHeight - height - 30) * .5;
		args = args + ',left='+xposition+',top=' + yposition;
    }

    args = args + ","
         + "location=1,menubar=1,resizable=" + resize + ",scrollbars=" + scroll + ","
         + "status=1,titlebar=1,toolbar=1,hotkeys=1,location=1,copyhistory=1,"
         + "dependent=no";

    var handle = window.open(pageToLoad, windowname, args);
    handle.focus();
}

function targetopener(mylink, closeme, closeonly)
{
	if (! (window.focus && window.opener))
		return true;
	window.opener.focus();
	if (! closeonly)
		window.opener.location.href=mylink;
	if (closeme)
		window.close();
	//return true;
}


//-- End
