
    function expandCollapseArchiveDesc(anc_id,ele_id) 
    {
       var ele = document.getElementById(ele_id);
       var anc = document.getElementById(anc_id);
       if (ele.style.display == 'none')
       {
        
         ele.style.display = 'block';
         
         anc.innerHTML = "[-] Hide";
       }
       else
       {
         ele.style.display = 'none';
         anc.innerHTML = "[+] Read more ...";
       }
    }

    function displayTabs() 
     {
                try {
                 tabbar2 = new dhtmlXTabBar("a_tabbar","top");
                 tabbar2.enableForceHiding(true);
                 tabbar2.enableScroll(true);
                 
                 tabbar2.setImagePath(image_url + 'imgs/');
     
                 tabbar2.addTab("a1","Event Details","90px",null,1);
                 tabbar2.addTab("a2","Archives","90px",null,1);
     
                 
                 tabbar2.enableAutoSize(false,true);
                 
                 tabbar2.setContent("a2", "audio_or_video_slot_id");
                 tabbar2.setContent("a1", "event_details_slot_id");
     
                 tabbar2.setSkinColors("#FFFFFF","#F4F3EE");
                 
     
                 tabbar2.setTabActive("a1");
                 //tabbar2.setOnLoadingEnd('setMyFocus()');
           } catch(e) {}
     }
    function closeStreamingWindow()
    {
      
      hiddenFloatingDiv('webstreaming_slot');
      webstreaming_slot_obj = document.getElementById('webstreaming_slot');
      webstreaming_slot_obj.innerHTML = "";
      webstreaming_slot_obj.style.width ="0 px"
       
    }
    /** 
    * streaming_invokeGo         : This function is used to call the ajax method makeGETRequest() 
    *                      to display the contacts based on the search criteria
    *  Parameters       : base_url : The base url to be used to get the portal url
    *  Return Value     : null
    * Compatibility     : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
    **/
    function streaming_invokeGo(base_url) 
    {
        if (document.em_webstreaming_search.search_event.value  == 'keyword search')
        {
            document.em_webstreaming_search.search_event.value = ''
        }
        var event_entered = document.em_webstreaming_search.search_event.value;

        var category_selected = document.em_webstreaming_search.event_category.value;
        var chapter_selected_obj = document.em_webstreaming_search.chapter_global;
        var chapter_selected;
        
        if (chapter_selected_obj.length > 0)
        {
        if(chapter_selected_obj[0].checked)    {
            chapter_selected = chapter_selected_obj[0].value;
        }
        else  
        {
            chapter_selected = chapter_selected_obj[1].value;
        }
        }
        else
        {
          chapter_selected = chapter_selected_obj.value;
        }

        var url = base_url + "/EM/webStreaming/searchResultsPT?event_value="+encodeURI(event_entered)+"&category="+encodeURI(category_selected)+"&web_selected_chapter="+encodeURI(chapter_selected);
        var search_display_slot_id = 'streaming_display_slot';
        makeGETRequest(url, search_display_slot_id);
    }


        /** 
        * showProfileDiv : This function is used to call the ajax method makeGETRequest() to display
        *                   the member profile in a div
        * Parameters : url    :   The url to be used to locate the viewProfilePT
        event  :   event action 
        id_event: to get the event id
        * Return Value: Shall not return any value
        * Compatibility: Internet Explorer v6.0; Mozilla v5.0; Netscape V7.1;
        **/
        function showProfileDiv(url,id_event,id_archive, stream_title, event_title,event)
        {
            var profile_display_slot_id = 'webstreaming_slot';
            if(id_event)
            {
                if(id_archive)  {
                    current_archive_id = id_archive; 
                }
                current_event_id = id_event;
                var function_used = "streaming_invokeDisplay("+id_event+","+id_archive+",'"+stream_title+"','"+event_title+"')"
                if(id_archive.type == 'click')  {
                    function_used = "streaming_invokeDisplay("+id_event+")"
                }

                makeGETRequest(url, profile_display_slot_id,function_used);
            }
            else
            {
                makeGETRequest(url, profile_display_slot_id);
            }
            displayWindow(profile_display_slot_id,event);
        }

    
    /** 
    * streaming_getBatchResult : This function is used to call the ajax method makeGETRequest() to 
    *                   get the next/previous batch results
    * Parameters     : url  : The url to be used to get the result
    * Return Value   : null
    * Compatibility  : Internet Explorer(6.0),Mozilla Firefox(5.0) & Netscape navigator(7.0)
    **/
    function streaming_getBatchResult(url)
    {
        var search_display_slot_id = 'streaming_display_slot';
        makeGETRequest(url, search_display_slot_id);
    }

    /** 
    * streaming_showProfileDiv : This function is used to call the ajax method makeGETRequest() to display
    *                   the member profile in a div
    * Parameters : url    :   The url to be used to locate the viewProfilePT
    *              event  :   event action 
    * Return Value: Shall not return any value
    * Compatibility: Internet Explorer v6.0; Mozilla v5.0; Netscape V7.1;
    **/
       function streaming_showProfileDiv(url,event)
   {
       var profile_display_slot_id = 'viewprofile_slot';
       makeGETRequest(url, profile_display_slot_id);
       displayWindow('viewprofile_slot',event);
   }


    /** 
    * streaming_enterkeyHandler : This function is used to call the ajax method invokeGo  to 
    *                   search the results by intiating the enter key
    * Parameters      : event : The event to be initiated
    *                : url   : The url to be used to get the result
    * Return Value    : null
    * Compatibility   : Internet Explorer(6.0),Mozilla Firefox(5.0) & Netscape navigator(7.0)
    **/
      function streaming_enterkeyHandler(event,url)
      {
           var key;
           var ENTER_KEY = 13;
           if(window.event)
           {
               key = window.event.keyCode;     //IE
           }
           else
           {
               key = event.which;
           }
           if(key == ENTER_KEY)
           {
               streaming_invokeGo(url);
               return false;
           }
           else
           {
               return true;
           }  
       }


    /** 
    * streaming_invokeDisplay : This function is used to call the ajax method makeGETRequest() 
    *                           to display the contacts based on the search criteria
    *  Parameters             : base_url : The base url to be used to get the portal url
    *  Return Value           : null
    * Compatibility           : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
    **/
      function streaming_invokeDisplay(id_event,id_archive,stream_title,event_title)
      {
          var archives_display_slot_id = 'streaming_display_slot';
          if(id_archive)    {
            url=portal_url+'/EM/webStreaming/displaySearchStreamingPT?id_event='+id_event + '&id_archive='+id_archive;
            try{
            stream_title = stream_title.replace('"','&quot;');
            event_title = event_title.replace('"','&quot;');
            }
            catch(e){}
            makeGETRequest(url,archives_display_slot_id,'displayTabs();displayStreamingTitle("'+ stream_title + '","' + event_title + '",'+id_archive+');');
          }
          else  {
            url=portal_url+'/EM/webStreaming/displaySearchStreamingPT?id_event='+id_event;
            makeGETRequest(url,archives_display_slot_id,'displayTabs();');
          }
      }


        /**
        * streaming_navigationDiv : This function is used to hide and display the div 
        * Parameters              : None
        * Return Value            : null
        * Compatibility           : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
        **/
      function streaming_navigationDiv()
      {
        var event_details_display=document.getElementById('event_details_div');
        var archive_link_display=document.getElementById('display_archive_link_div');
        var archive_details_display=document.getElementById('archives_div');
        if(event_details_display.style.display=='block')
        {
            event_details_display.style.display='none';
            archive_link_display.style.display='none';
            archive_details_display.style.display='block';
        }
        else
        {
        archive_details_display.style.display='none';
        event_details_display.style.display='block';
        archive_link_display.style.display='block';
    }   
      }                

/**
* buildWMPlayer : This function is used to build the media player and play the webstreaming files
* Parameters    : None
* Return Value  : null
* Compatibility : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
**/

function buildWMPlayer(clipurl,w,h)
{

//var clipurl="http://stream.tie.org:8080/SiliconValley/SIGs/Networking/Sept13_2005/sept13_2005.wvx"
    h+=64;//to compensate for toolbar
        document.write('');   
    if (window.ActiveXObject && (navigator.userAgent.indexOf('Windows') != -1))
    {
        document.write('<'+'body align="center" bgcolor="#F1EFE2" leftmargin="0" topmargin="0"><'+'center><'+'object id="nolplayerWM" classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" height="'+h+'" width="'+w+'">');
        document.write('<'+'param name="uiMode" value="full" />');
        document.write('<'+'param name="autoStart" value="true" />');
        document.write('<'+'param name="stretchToFit" value="true" />');
        document.write('<'+'param name="URL" value="'+clipurl+'" />');
        if (url.clippos){document.write('<'+'param name="currentPosition" value="'+url.clippos+'" />');}
        document.write('Your browser does not support the ActiveX Windows Media Player');
        document.write('<'+'/object><'+'/center><'+'/body>');
    }
    else if(navigator.mimeTypes)
    {
        document.write('<'+'body align="center" bgcolor="#F1EFE2" leftmargin="0" topmargin="0"><'+'center><'+'object id="nolplayerWM" name="nolplayerWM" width="'+w+'" height="'+h+'" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
        document.write('<'+'param name="FileName" value="'+clipurl+'" />');
        document.write('<'+'param name="ShowControls" value="1" />');
        document.write('<'+'param name="ShowDisplay" value="0" />');
        document.write('<'+'param name="AutoStart" value="1" />');
        document.write('<'+'param name="ShowStatusBar" value="1" />');
        document.write('<'+'embed type="application/x-mplayer2" src="'+clipurl+'" id="nolplayer1" name="nolplayer1" ShowControls=1 ShowDisplay=0 AutoStart=1 ShowStatusBar=1 width="'+w+'" height="'+h+'"><'+'/embed>');
        document.write('<'+'/object>');
        document.write('<'+'noembed>This browser appears to be unable to display clips inline the player.<'+'br /><'+'a href="+clipurl+">&gt;Play the clip in Windows Media Player<'+'/a><'+'/noembed><'+'/object><'+'center><'+'/body>');
    }

}


/**
  * playStreamingFile : This function is used to play the media file
  * Parameters    : url:It is used to pass the url of the streaming file
  * Return Value  : null
  * Compatibility : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
  **/
function playStreamingFile(id_event,id_archive,stream_title, event_title)
{
  if(id_archive)    {
    streaming_url = portal_url+'/EM/webStreaming/streamingPlayerPT?id_event='+id_event + '&id_archive='+id_archive;
  }
  else  {
    streaming_url = portal_url+'/EM/webStreaming/streamingPlayerPT?id_event='+id_event;
  }
  try{
    document.getElementById('popup_streaming_frame').src = streaming_url;
  }catch(e){}   
  //document.getElementById('streaming_frame').location.replace(streaming_url);
  displayStreamingTitle(stream_title, event_title,id_archive);
  //event_details = "Now Playing : \'" + event_title + "\' &raquo; " + stream_title;
  //document.getElementById('display_file').innerHTML = event_details;
  
}   


/**
  * displayStreamingTitle : This function is used to play the media file
  * Parameters    : url:It is used to pass the url of the streaming file
  * Return Value  : null
  * Compatibility : Internet Explorer(6.0),Mozilla Firefox(5.0)& Netscape navigator(7.0)
  **/
function displayStreamingTitle(stream_title, event_title,id_archive)
{
  event_details = "Now Playing : \'" + event_title + "\' &raquo; " + stream_title;
  document.getElementById('display_file').innerHTML = event_details;
  try{
      if (document.getElementById('archive_desc_flg_'+id_archive).value == 1){
      
      document.getElementById('event_desc_ele').innerHTML = document.getElementById('archive_desc_'+id_archive).innerHTML;
      }
      else {
              document.getElementById('event_desc_ele').innerHTML = document.getElementById('event_desc_ele_alt').innerHTML;

      }
      }
  catch(e) {}
  
      
}