<!--

function DecToBin(Decimal) {

	var i = 0;

	var Bin = "";

	while(Decimal > Math.pow(2, i)) {

		i++;

	}

	for (var i = i; i >= 0; i--) {

		if (Decimal >= Math.pow(2, i)) {

			Decimal -= Math.pow(2, i);

			Bin = "1" + Bin;

		} else Bin = "0" + Bin;

	}

	return Bin;

}

function popUp(fileToLoad, w, h, settings) {

    if(!w) w = '520';

    if(!h) h = '400';

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

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

    var textsettings = 'height='+h+',width='+w+',top='+toppos+',left='+leftpos;

    var binsettings=DecToBin(settings);

    if(binsettings.charAt(0)=="0") textsettings=textsettings+',scrollbars=yes';

    else textsettings=textsettings+',scrollbars=yes';

    if(binsettings.charAt(1)=="1") textsettings=textsettings+',status=yes';

    else textsettings=textsettings+',status=no';

    if(binsettings.charAt(2)=="1") textsettings=textsettings+',resizable=yes';

    else textsettings=textsettings+',resizable=no';

    if(binsettings.charAt(3)=="1") textsettings=textsettings+',directories=yes';

    else textsettings=textsettings+',directories=no';

    if(binsettings.charAt(4)=="1") textsettings=textsettings+',location=yes';

    else textsettings=textsettings+',location=no';

    if(binsettings.charAt(5)=="1") textsettings=textsettings+',menubar=yes';

    else textsettings=textsettings+',menubar=no';

    if(binsettings.charAt(6)=="1") textsettings=textsettings+',toolbar=yes';

    else textsettings=textsettings+',toolbar=no';

	var popUpWindow = window.open(fileToLoad,'popUpWindow',textsettings);

	if(popUpWindow.opener == null) popUpWindow.opener = self;

    popUpWindow.focus();

}



// -->

