﻿

function toggleDrugInfoContent (id) {
  var tmpObj1, tmpObj2, tmpObj3;
  tmpObj1 = document.getElementById("dr_content_b_" + id);
  tmpObj2 = document.getElementById("dr_topic_b_" + id);
  if (!tmpObj1) return false;
  
  tmpObj3 = document.getElementById("ContentDataListDiv");
  
  if (tmpObj3) {
    for (var i=0; i < tmpObj3.childNodes.length; i++) {
       if (typeof(tmpObj3.childNodes[i].nodeName) != 'undefined') {
        
        if (tmpObj3.childNodes[i].nodeName.toLowerCase() == "dd") {
            if (tmpObj3.childNodes[i] != tmpObj1) tmpObj3.childNodes[i].className = "druginfo_content_off";
        }
        
        if (tmpObj3.childNodes[i].nodeName.toLowerCase() == "dt") {
            if (tmpObj3.childNodes[i].id != "dr_topic_b_" + id) tmpObj3.childNodes[i].className = "";
        }
        
       } 
    }
  }
  
  if (tmpObj1.className ==  "druginfo_content_off") {
    tmpObj1.className = "druginfo_content_on";
    if (tmpObj2) tmpObj2.className = "ActiveNew";
  } else {
    tmpObj1.className = "druginfo_content_off";
    if (tmpObj2) tmpObj2.className = "";
  }
}

function createVideo(videoID, videoFile, thumbFile){
    var so = new SWFObject("/flash/mediaplayer.swf?file="+videoFile, "mymovie"+videoID, "352", "288", "8");
    so.addVariable("image", thumbFile);
    so.addParam("allowfullscreen","true");
    so.addParam("bgcolor","#557722");
    so.addVariable('linkfromdisplay','true');
    so.addVariable('lightcolor','0x557722');
    so.addVariable('searchbar','false');
    so.addVariable('shuffle','true');
    so.addVariable('overstretch','true');
    so.addVariable("width","352");
    so.addVariable("height","288"); 
    so.addVariable("controlbar", "bottom");
    so.addVariable("autostart", "true");
    so.addParam("wmode", "transparent");
    so.addVariable("skin", "/flash/skins/drugsinfo.swf");
    so.write(videoID);
}
