   var currentPanel;
   var currentVideoPanel;
   
   function showPanel(panelNum)
   {
    if(currentPanel != null)
    {
       hidePanel();
    }
    document.getElementById('menu'+panelNum).className = 'menu_on';
    document.getElementById('menu'+panelNum+'txt').className = 'show';
    currentPanel = panelNum;
   }
   
   function hidePanel()
   {
    //Hide Visible Panel
    document.getElementById('menu'+currentPanel).className='menu_off';
    document.getElementById('menu'+currentPanel+'txt').className='hide';
   }
   
   //for showcase page [needs colours]
   function showPanelShowcase(panelNum)
   {
    if(currentPanel != null)
    {
       hidePanel();
    }
    document.getElementById('menu'+panelNum).className = 'menu_on'+panelNum;
    document.getElementById('menu'+panelNum+'txt').className = 'show';
    currentPanel = panelNum;
   }
   
   //for video panel
   
   function showVideoPanel(panelNum,Flag)
   {
    if(currentVideoPanel != null)
    {
       hideVideoPanel();
    }
    //width="100%" cellpadding="0" cellspacing="0" border="0"

        var content = '<table width="100%" cellpadding="0" cellspacing="0" border="0" id="mytable"> <tr> <td>'+
                      '<object id="videoObject" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" width="400" height="312">'+
                      '<param id="filename" name="Filename" value="<wvxfile>" />'+
                      '<param id="ShowStatusBar" name="ShowStatusBar" value= "1" />'+
                      '<param id="autostart" name="autoStart" value="'+Flag+'" />'+
                      '<param  id="ShowControls" name="ShowControls" value="1">'+
                      '<param name="ShowDisplay" value="0">'+
                      '<param id="volume" name="Volume" value="-1" />'+
                      '<param id="playcount" name="playCount" value="1" />'+
                      '<param name="bgcolor" value="#CC0000">'+
                      '<param name="transparentatStart" value="1">'+
                      '<param name="loop" value="0">'+
                      '<embed quality="high" bgcolor="#CC0000" width="400" height="312" align="middle" type="application/x-mplayer2" name="videoObject" src="<wvxfile>" autoStart="'+Flag+'" ShowStatusBar="1" transparentatStart="1" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"></embed>'+
                      '</object>'+
                      '<br/></td></tr></table>';

    if(navigator.userAgent.indexOf("MSIE") != -1)
    {
      // If it is Internet Explorer
        if( null != document.getElementById('videoObject'))
        {
            document.videoObject.stop();
        }
    }

    content=content.replace('<wvxfile>',document.getElementById('vid'+panelNum).innerHTML);
    content=content.replace('<wvxfile>',document.getElementById('vid'+panelNum).innerHTML);
        
    document.getElementById('vid'+panelNum).className = 'hide';// hide for time being... Should be show once the div problem is fixed
    document.getElementById('vid_menu'+panelNum).className = 'vid_on';
    document.getElementById('vid_txt'+panelNum).className = 'hide'; // hide for time being... Should be show once the div problem is fixed
    document.getElementById('my_vid_txt').innerHTML = document.getElementById('vid_txt'+panelNum).innerHTML;
   
    document.getElementById('my_video').innerHTML = content;
    currentVideoPanel = panelNum;
   }
   
   function hideVideoPanel()
   {
    //Hide Visible Panel
    document.getElementById('vid'+currentVideoPanel).className='hide';
    
    document.getElementById('vid_menu'+currentVideoPanel).className='vid_off';
    document.getElementById('vid_txt'+currentVideoPanel).className='hide';
   }
