function browserPopup(urlextra) {
  if (getValueFromUrl(urlextra,"popup_menubar")=="yes") {
    smenubar=",menubar=yes";
  } else {
    smenubar="";
  }
  
  if (getValueFromUrl(urlextra,"popup_location")=="yes") {
    smenubar=",location=yes";
  } else {
    smenubar="";
  }
  
  if (getValueFromUrl(urlextra,"popup_toolbar")=="yes") { 
    stoolbar=",toolbar=yes";
  } else {
    stoolbar="";}
    
  if(getValueFromUrl(urlextra,"popup_resize")=="no") {
    sresizable="";
  } else {
    sresizable=",resizable=yes";
  }

  if(getValueFromUrl(urlextra,"popup_scrollbars")=="no") {
    sscrollbars="";
  } else {
    sscrollbars=",scrollbars=yes";
  }

  if(getValueFromUrl(urlextra,"popup_statusbar")=="no") {
    sstatusbar="";
  } else {
    sstatusbar=",status=yes";
  }

  parmwidth=getValueFromUrl(urlextra,"popup_width");
  parmheight=getValueFromUrl(urlextra,"popup_height");
  cwidth=(isNaN(parmwidth)||parmwidth<1)?800:parmwidth;
  cheight=(isNaN(parmheight)||parmheight<1)?600:parmheight;

  var settings="width="+cwidth+",height="+cheight+stoolbar+smenubar+sresizable+sscrollbars+sstatusbar;
  var parentUrl=getValueFromUrl(urlextra,"popup_parenturl");
  var targetUrl=(urlextra.lastIndexOf('?')!=-1)?urlextra.substring(0,urlextra.lastIndexOf('?')):urlextra;

  newWin=open(targetUrl,(new Date).getTime(),settings);
  if(parentUrl){
    location.href=parentUrl;
  };
  newWin.focus();
  return false;
};

function getValueFromUrl(url,parm) {
  var a_url=url.split("?");
  var a_parms=a_url[1].split("&");
  for (var i=0,l=a_parms.length;i<l;i++) {
    var a_temp=a_parms[i].split("=");
    if (a_temp[0]===parm) {
      return a_temp[1];
    }
  }
  return null;
};
