Pass Javascript Variable

Pass Javascript Variable for a movie page or anything

URL sequence:

hi_mov.html?filepath=Currie_Bio&width=320&height=250

in the head:

<script language="JavaScript" type="text/javascript">
<!--
var arr = new Array();
var arr1 = new Array();
var filepath = 'db_20_years';
var width = '320';
var height = '240';

str = location.search.substring(1, location.search.length);
arr = str.split("&");
for (i=0;i<arr.length;i++) {
        temp = arr[i];
        arr1 = temp.split("=");
        if (arr1[0] == "filepath") {
                filepath = arr1[1];
        }      
        if (arr1[0] == "width") {
                width = arr1[1];
        }
        if (arr1[0] == "height") {
                height = arr1[1];
        }   
}

filepath = filepath.split("+").join(" ");
width = width.split("+").join(" ");
height = height.split("+").join(" ");
//-->
</script>

In the body for quicktime:

<script language="JavaScript" type="text/javascript">
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+width+'" height="'+height+'">');
document.write('<param name="src" value="'+filepath+'/hi.mov">');
document.write('<param name="controller" value="true">');
document.write('<param name="target" value="myself">');
document.write('<param name="pluginspage" value="http://www.apple.com/quicktime/download/indext.html">');
document.write('<embed src="'+filepath+'/hi.mov" width="'+width+'" height="'+height+'" autostart="true" controller="true" target="myself" bgcolor="#ffffff" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html">');
document.write('</embed>');<cd:preserve whitespace="TCL" /> document.write('</object>');<cd:preserve whitespace="CL" /> </script>

in the body for Windows media:

<script language="JavaScript" type="text/javascript">
document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" type="application/x-oleobject" align="baseline" border="0" standby="Loading Microsoft Windows Media Player components..." id="MediaPlayer">');
document.write('<param name="FileName" value="'+filepath+'/hi.wmv">');
document.write('<param name="ShowControls" value="1">');
document.write('<param name="ShowPositionControls" value="0">');
document.write('<param name="ShowAudioControls" value="1">');
document.write('<param name="ShowTracker" value="1">');
document.write('<param name="ShowDisplay" value="0">');
document.write('<param name="ShowStatusBar" value="0">');
document.write('<param name="AutoSize" value="1">');
document.write('<param name="ShowGotoBar" value="0">');
document.write('<param name="ShowCaptioning" value="0">');
document.write('<param name="AutoStart" value="1">');
document.write('<param name="AnimationAtStart" value="0">');
document.write('<param name="TransparentAtStart" value="0">');
document.write('<param name="AllowScan" value="1">');
document.write('<param name="EnableContextMenu" value="1">');
document.write('<param name="ClickToPlay" value="0">');
document.write('<param name="InvokeURLs" value="1">');
document.write('<param name="DefaultFrame" value="datawindow">');

document.write('<!-- Embedded Microsoft Media Player Object for Netscape Navigator. -->');
document.write('<embed src="'+filepath+'/hi.wmv" width="'+width+'" height="'+height+'" autostart="true" align="baseline" border="0" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&" name="MediaPlayer" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="0" autosize="0" showgotobar="0" showcaptioning="0" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" invokeurls="1" defaultframe="datawindow">');
document.write('</embed>'); document.write('</object>');
</script>