// JScript File
function localView(pf,oWidth,oHeight,use_wmp,play_video) {

  
  var re = /\.[^\.]+$/;
 
  var r = pf.search(re);
  var att=pf.substring(r).toLowerCase()
   var returnCode;
   
  switch(att){
    
    case ".wav":
      
      returnCode=creatMulHtml(pf,use_wmp,false,oHeight,oWidth);
      break
    case ".mp3":
    
      returnCode=creatMulHtml(pf,use_wmp,false,oHeight,oWidth);
     
      break
    case ".rmi":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
    case ".mid":
      
      returnCode=creatMulHtml(pf,use_wmp,false,oHeight,oWidth);
      break
    case ".wmv":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
    case ".asf":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
    case ".avi":
     
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
    case ".mpeg":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
   case ".ram":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
   case ".rm":
     
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
   case ".rmvb":
      
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break
   default:
      returnCode=creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth);
      break;
  }

  return returnCode;
  
 
  
 

}

function creatMulHtml(pf,use_wmp,play_video,oHeight,oWidth){
  if(use_wmp)
    return creatWmp(pf,play_video,oHeight,oWidth);
  else
    return creatReal(pf,play_video,oHeight,oWidth);

}

function creatWmp(pf,play_video,oHeight,oWidth){
  var wmpHtml;
  if(!play_video)oHeight=40;
  wmpHtml="<object classid='clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95' width='"+oWidth+"' height='"+oHeight+"' type='application/x-oleobject' >\r\n";
  //wmpHtml+="<param name='AudioStream' value='-1' \/>\r\n";
  //wmpHtml+="<param name='AutoSize' value='-1' \/>\r\n";
  wmpHtml+="<param name='AutoStart' value='0' \/>\r\n";
  //wmpHtml+="<param name='AnimationAtStart' value='-1' \/>\r\n";
  //wmpHtml+="<param name='AllowScan' value='-1' \/>\r\n";
  //wmpHtml+="<param name='AllowChangeDisplaySize' value='1' \/>\r\n";
  //wmpHtml+="<param name='AutoRewind' value='1' \/>\r\n";
  //wmpHtml+="<param name='Balance' value='1' \/>\r\n";

  //wmpHtml+="<param name='BufferingTime' value='5' \/>\r\n";

  //wmpHtml+="<param name='ClickToPlay' value='0' \/>\r\n";
  //wmpHtml+="<param name='CursorType' value='0' \/>\r\n";
  //wmpHtml+="<param name='CurrentPosition' value='-1' \/>\r\n";
  //wmpHtml+="<param name='CurrentMarker' value='0' \/>\r\n";

  //wmpHtml+="<param name='DisplayBackColor' value='0' \/>\r\n";
  //wmpHtml+="<param name='DisplayForeColor' value='16777215' \/>\r\n";
  //wmpHtml+="<param name='DisplayMode' value='0' \/>\r\n";
  //wmpHtml+="<param name='DisplaySize' value='0' \/>\r\n";
  //wmpHtml+="<param name='Enabled' value='-1' \/>\r\n";
  //wmpHtml+="<param name='EnableContextMenu' value='-1' \/>\r\n";
  //wmpHtml+="<param name='EnablePositionControls' value='-1' \/>\r\n";
  //wmpHtml+="<param name='EnableFullScreenControls' value='1' \/>\r\n";
  //wmpHtml+="<param name='EnableTracker' value='-1' \/>\r\n";
  wmpHtml+="<param name='Filename' value='"+pf+"' \/>\r\n";
  //wmpHtml+="<param name='InvokeURLs' value='-1' \/>\r\n";
  //wmpHtml+="<param name='Language' value='-1' \/>\r\n";
  //wmpHtml+="<param name='Mute' value='0' \/>\r\n";
  //wmpHtml+="<param name='PlayCount' value='1' \/>\r\n";
  //wmpHtml+="<param name='PreviewMode' value='0' \/>\r\n";
  //wmpHtml+="<param name='Rate' value='1' \/>\r\n";
 
  //wmpHtml+="<param name='SelectionStart' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SelectionEnd' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SendOpenStateChangeEvents' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SendWarningEvents' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SendErrorEvents' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SendKeyboardEvents' value='0' \/>\r\n";
  //wmpHtml+="<param name='SendMouseClickEvents' value='0' \/>\r\n";
  //wmpHtml+="<param name='SendMouseMoveEvents' value='-1' \/>\r\n";
  //wmpHtml+="<param name='SendPlayStateChangeEvents' value='-1' \/>\r\n";
  //wmpHtml+="<param name='ShowCaptioning' value='0' \/>\r\n";
  //wmpHtml+="<param name='ShowControls' value='1' \/>\r\n";
  //wmpHtml+="<param name='ShowAudioControls' value='1' \/>\r\n";
  //wmpHtml+="<param name='ShowDisplay' value='0' \/>\r\n";
  //wmpHtml+="<param name='ShowGotoBar' value='0' \/>\r\n";
  //wmpHtml+="<param name='ShowPositionControls' value='1' \/>\r\n";
  //wmpHtml+="<param name='ShowStatusBar' value='1' \/>\r\n";
  //wmpHtml+="<param name='ShowTracker' value='1' \/>\r\n";
  if(play_video)
    wmpHtml+="<param name='TransparentAtStart' value='0' \/>\r\n";
  else
    wmpHtml+="<param name='TransparentAtStart' value='1' \/>\r\n";
  //wmpHtml+="<param name='VideoBorderWidth' value='1' \/>\r\n";
  //wmpHtml+="<param name='VideoBorderColor' value='1' \/>\r\n";
  //wmpHtml+="<param name='VideoBorder3D' value='1' \/>\r\n";

  //wmpHtml+="<param name='WindowlessVideo' value='0' \/>\r\n";
  wmpHtml+="</object>\r\n";
  return wmpHtml;
}


function creatReal(pf,play_video,oHeight,oWidth){
    var no=Math.round(Math.random()*9999)
    var realVHtml
     realVHtml="<object classid='clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' console='Clip"+no+"' height='"+oHeight+"' width='"+oWidth+"' type='audio/x-pn-realaudio-plugin'>\r\n";

     realVHtml+="<param name='SRC' value='"+pf+"' \/>\r\n";
     realVHtml+="<param name='CONTROLS' value='imagewindow' \/>\r\n";
     realVHtml+="<param name='CONSOLE' value='Clip"+no+"' \/>\r\n";
 
     realVHtml+="</object>\r\n";
     
     var realAHtml
     realAHtml="<object classid='clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA' console='Clip"+no+"' height='50'' width='"+oWidth+"' type='audio/x-pn-realaudio-plugin'>\r\n";

     realAHtml+="<param name='SRC' value='"+pf+"' \/>\r\n";
     realAHtml+="<param name='CONTROLS' value='ControlPanel,StatusBar' \/>\r\n";
     realAHtml+="<param name='CONSOLE' value='Clip"+no+"' \/>\r\n";
  
     realAHtml+="</object>\r\n";
     if(play_video)
     return realVHtml+realAHtml;
     else
     return realAHtml;
}