// MC Media Player: JavaScript Implementation, v1.07/03
// This script performs two functions:
// (1) It writes the HTML code which embeds the Flash media player file on your web page.
// (2) It allows you to customize your player by editing variables.
// More information: www.mediacollege.com/flash/media-player

// Variables - Enter values to customize your player:
mcplayerfile = "/assets/video/amsoil_video_player.swf";
checkVersion = "";
promptVersion = "";
playlist = "/assets/video/amsoil_playlist.xml";
plresize = "none";
mediadir = "";
dfile = "/assets/video/amsoillogo.jpg";
dfileaction = "1";
defpreclip = "";
desctxtcolor = "ffffff";
descbgcolor = "000000";
infotype = "none";
infohead = "";
infotxt = "";
infoheadcl = "";
infotxtcl = "";
infobg = "000000";
definfo = "";
bgcolor = "000000";
fullscreenmode = "";
buf = "5";
zoom = "";
dlinks = "";
showfileURLs="";
directlinkURL = "http://www.texassynthetics.com/pages/Videos/";
optmenu = "none";
aseq = "";
aseqd = "";
imgdur = "";
swfdur = "";
startvol = "80";
// Note: Resizing the player may cause distortion in the interface, especially the text.
// Only resize the player if you really need to. Default size is 720x360
playerwidth = "720";
playerheight = "360";


//////////////////////////////
// Nothing below here needs to be edited.
//////////////////////////////
qs = document.location.search;
n1 = qs.indexOf("dfile=");
if (n1 != -1) {
        n1 = n1+6;
        qs1 = qs.slice(n1);
        n2 = qs1.indexOf("&");
        if (n2 != -1) {
                qs2 = qs1.slice(0, n2);
                } else {
                qs2 = qs1;
                }
        if (qs2.length>=1) {
                dfile = qs2;
                }
}
p1 = qs.indexOf("playlist=");
if (p1 != -1) {
        p1 = p1+9;
        qs1 = qs.slice(p1);
        p2 = qs1.indexOf("&");
        if (p2 != -1) {
                qs2 = qs1.slice(0, n2);
                } else {
                qs2 = qs1;
                }
        if (qs2.length>=1) {
                playlist = qs2;
                }
}
mcflashvars = 'playlist='+playlist;
mcflashvars += '&checkVersion='+checkVersion;
mcflashvars += '&promptVersion='+promptVersion;
mcflashvars += '&plresize='+plresize;
mcflashvars += '&mediadir='+mediadir;
mcflashvars += '&dfile='+dfile;
mcflashvars += '&dfileaction='+dfileaction;
mcflashvars += '&defpreclip='+defpreclip;
mcflashvars += '&desctxtcolor='+desctxtcolor;
mcflashvars += '&descbgcolor='+descbgcolor;
mcflashvars += '&infotype='+infotype;
mcflashvars += '&infohead='+infohead;
mcflashvars += '&infotxt='+infotxt;
mcflashvars += '&infoheadcl='+infoheadcl;
mcflashvars += '&infotxtcl='+infotxtcl;
mcflashvars += '&infobg='+infobg;
mcflashvars += '&definfo='+definfo;
mcflashvars += '&fullscreenmode='+fullscreenmode;
mcflashvars += '&bgcolor='+bgcolor;
mcflashvars += '&buf='+buf;
mcflashvars += '&zoom='+zoom;
mcflashvars += '&dlinks='+dlinks;
mcflashvars += '&showfileURLs='+showfileURLs;
mcflashvars += '&directlinkURL='+directlinkURL;
mcflashvars += '&optmenu='+optmenu;
mcflashvars += '&aseq='+aseq;
mcflashvars += '&aseqd='+aseqd;
mcflashvars += '&imgdur='+imgdur;
mcflashvars += '&swfdur='+swfdur;
mcflashvars += '&startvol='+startvol;
if (!mcplayerfile) { mcplayerfile = "mcmp720x360_player.swf"; }
if (bgcolor) { divbg = bgcolor; } else { divbg = "202028"; }
mccode();
function mccode() {
        var str='';
        str+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0" width="'+playerwidth+'" height="'+playerheight+'">\n';
        str+='<param name="movie" value="'+mcplayerfile+'">';
        str+='<param name="quality" value="high">';
                str+='<param name="wmode" value="transparent">';
        str+='<param name="allowFullScreen" value="true">';
        str+='<param name="FlashVars" value="'+mcflashvars+'">\n';
        str+='<embed src="'+mcplayerfile+'" width="'+playerwidth+'" height="'+playerheight+'" quality="high" wmode="transparent" allowFullScreen="true" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application\/x-shockwave-flash" FlashVars="'+mcflashvars+'"><\/embed>\n';
        str+='<\/object>';
        document.write(str);
}
