function launch(newURL, newName, newFeatures, orgName) {
    var remote = open(newURL, newName, newFeatures);
    if (remote.opener == null)
      remote.opener = window;
    remote.opener.name = orgName;
    return remote;
}

function popup(url,width,height) {
  myRemote = launch(url,
                    "popup",
                    "toolbar=no, location=no, directories=no, status=no,  menubar=no, scrollbars=no, resizable=yes, menubar=no, width=" + width + ", height=" + height,
                    "caller");
}

function popupplayer(url) {
  myRemote = launch(url,
                    "popup",
                    "toolbar=no, location=no, directories=no, status=no,  menubar=no, scrollbars=no, resizable=no, menubar=no, width=710, height=440",
                    "caller");
}

function expand(element) {
  document.getElementById("p_"+element).style.display="block";
  document.getElementById("img_"+element).style.display='none';
}

function collapse(element) {
  document.getElementById("p_"+element).style.display='none';
  document.getElementById("img_"+element).style.display='';
}

function toggle(element) {
  if (document.getElementById("p_"+element).style.display=='none') {
    document.getElementById("p_"+element).style.display='';
    document.getElementById("img_"+element).style.display='none';
  } else {
    document.getElementById("p_"+element).style.display='none';
    document.getElementById("img_"+element).style.display='';
  }  
}
