//  Contains the main javascript functionality for theGeneticsMedia.htm page 
//  and included iframes (relatedInfo and EmbeddedReal Player)


var media = "";

  
location.getMedia = function()
{
  return media;
};

location.setSources = function()
{ 
  media = location.getParameter("media");

  document.getElementById('mediaInfo').src= mediaInfoPath + media + infoFileSuffix;
  document.getElementById('mediaPlayer').src=embeddedPlayerPath;
  document.getElementById('mailingList').src=mailingListPath;

};
  
  
location.getParameter = function(sParam) 
{

  var sKey = sParam + "=";
  var val;
	
  var oParams = this.search.substring(1).split("&");
  for(var i = 0; i < oParams.length; i++)
  if(oParams[i].indexOf(sKey) == 0)
    val = oParams[i].substring(sKey.length);
    return val;
  return null;
};

location.getParameterMap = function() 
{
  var oParams = this.search.substring(1).split("&");

  var oMap = { }
  for(var i = 0; i < oParams.length; i++) 
  {
    var pair = oParams[i].split("=");
    oMap[pair[0]] = pair[1];
  }

  return oMap;
};

location.openMediaPage = function(media, url, windowName, height, width) 
{		
  var fullUrl = mediaPagePath+media;
  var newwin = window.open(fullUrl, windowName, "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width=" + width +",height=" + height);
  newwin.focus();
}

location.retrieveMedia = function()
{
  var parentMedia = parent.location.getMedia();
  var smilPath = smilFilePath + parentMedia + realFileSuffix;
	   
  AC_RunRealContent("NAME","IMAGEWINDOW", "id","RVOCX", "width", "315", "height", "222", "CONTROLS", "imagewindow", "CONSOLE",  "Master",  "AUTOSTART", "TRUE", "type", "audio/x-pn-realaudio-plugin", "NOJAVA","TRUE", "SRC", smilPath);
  AC_RunRealContent("NAME","CONTROLPANEL","id","RVOCX", "width", "315", "height", "28",  "CONTROLS", "ControlPanel","CONSOLE",  "Master",  "AUTOSTART", "TRUE", "type", "audio/x-pn-realaudio-plugin", "NOJAVA","TRUE", "SRC", smilPath);
   
};

function setMediaID(mediaID)
{

  location.openMediaPage(mediaID,mediaPagePath,"theGeneticsMedia",mediaPageHeight,mediaPageWidth);
};<!-- 

 -->
<!-- 

 -->
