
function Right(str, n) {
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function FlashTag(src, width, height, version) {
    if (arguments.length < 4) {
        throw new Exception('RequiredParameterException', 'You must pass in a src, width, height, and version when creating a FlashTag.');
    }

    this.src            =  src;
    this.width          =  width;
    this.height         =  height;
    this.version        =  version;

    this.id             =  null;
    this.flashVars      =  null;
    this.flashVarsStr   =  null;
    this.genericParam   = new Object();
    this.ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
}

FlashTag.prototype.setSource = function(src) {
    this.src = src; 
}


FlashTag.prototype.setWidth = function(w) {
    this.width = width; 
}

FlashTag.prototype.setHeight = function(h) {
    this.h = height; 
}

FlashTag.prototype.setVersion = function(v) {
    this.version = v;
}

FlashTag.prototype.setId = function(id)
{
    this.id = id;
}

FlashTag.prototype.setBgcolor = function(bgc) {
    if (bgc.charAt(0) != '#') {
        bgc = '#' + bgc;
    }
    this.genericParam['bgcolor'] = bgc;
}

FlashTag.prototype.addFlashVars = function(fvs) {
    this.flashVarsStr = fvs;
}

FlashTag.prototype.addFlashVar = function(n, v) {
    if (this.flashVars == null) {
        this.flashVars = new Object();
    }
    this.flashVars[n] = v;
}

FlashTag.prototype.removeFlashVar = function(n) {
    if (this.flashVars != null) {
        this.flashVars[n] = null;
    }
}

FlashTag.prototype.setSwliveconnect = function(swlc) {
    this.genericParam['swliveconnect'] = swlc;
}

FlashTag.prototype.setPlay = function(p) {
    this.genericParam['play'] = p;
}

FlashTag.prototype.setLoop = function(l) {
    this.genericParam['loop'] = l;
}

FlashTag.prototype.setMenu = function(m) {
    this.genericParam['menu'] = m;
}

FlashTag.prototype.setQuality = function(q) {
    if (q != 'low' && q != 'high' && q != 'autolow' && q != 'autohigh' && q != 'best') {
        throw new Exception('UnsupportedValueException',
                            'Supported values are "low", "high", "autolow", "autohigh", and "best".');
    }
    this.genericParam['quality'] = q;
}

FlashTag.prototype.setScale = function(sc) {
    if (sc != 'showall' && sc != 'noborder' && sc != 'exactfit') {
        throw new Exception('UnsupportedValueException', 'Supported values are "showall", "noborder", and "exactfit".');
    }
    this.genericParam['scale'] = sc;
}

FlashTag.prototype.setAlign= function(a) {
    if (a != 'l' && a != 't' && a != 'r' && a != 'b') {
        throw new Exception('UnsupportedValueException', 'Supported values are "l", "t", "r" and "b".');
    }
    this.genericParam['align'] = a;
}

FlashTag.prototype.setSalign= function(sa) {
    if (sa != 'l' && sa != 't' && sa != 'r' && sa != 'b' && sa != 'tl' && sa != 'tr' && sa != 'bl' && sa != 'br') {
        throw new Exception('UnsupportedValueException', 'Supported values are "l", "t", "r", "b", "tl", "tr", "bl" and "br".');
    }
    this.genericParam['salign'] = sa;
}

FlashTag.prototype.setWmode = function(wm) {
    if (wm != 'window' && wm != 'opaque' && wm != 'transparent') {
        throw new Exception('UnsupportedValueException', 'Supported values are "window", "opaque", and "transparent".');
    }
    this.genericParam['wmode'] = wm;
}

FlashTag.prototype.setBase = function(base) {
    this.genericParam['base'] = base;
}

FlashTag.prototype.setAllowScriptAccess = function(sa) {
    if (sa != 'never' && sa != 'always') {
        throw new Exception('UnsupportedValueException', 'Supported values are "never" and "always".');
    }
    this.genericParam['allowScriptAccess'] = sa;
}

FlashTag.prototype.toString = function() {
    
    var flashTag = new String();
    if (false) {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" wmode="transparent" ';
        if (this.id != null) {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
//        flashTag += '<param name="autoplay" value="true"/>';
//        flashTag += '<param name="autoplay" value=true>';
//        flashTag += '<param name="autoplay" value=1>';
        for (var n in this.genericParam) {
            if (this.genericParam[n] != null) {
                flashTag += '<param name="'+n+'" value="'+this.genericParam[n]+'"/>';
            }
        }

        if (this.flashVars != null) {
            var fv = this.getFlashVarsAsString();
            if (fv.length > 0) {
                flashTag += '<param name="flashvars" value="'+fv+'"/>';
            }
        }
        flashTag += '</object>';
    }
    else {
        flashTag += '<embed wmode="transparent" src="'+this.src+'"';
        flashTag += ' width="'+this.width+'"';
        flashTag += ' height="'+this.height+'"';
        flashTag += ' type="application/x-shockwave-flash"';
        if (this.id != null) {
            flashTag += ' name="'+this.id+'"';
        }

        for (var n in this.genericParam) {
            if (this.genericParam[n] != null) {
                flashTag += (' '+n+'="'+this.genericParam[n]+'"');
            }
        }

        if (this.flashVars != null) {
            var fv = this.getFlashVarsAsString();
            if (fv.length > 0) {
                flashTag += ' flashvars="'+fv+'"';
            }
        }
        flashTag += ' pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;
}

FlashTag.prototype.write = function(doc) {
    doc.write(this.toString());
}

FlashTag.prototype.getFlashVarsAsString = function() {
    var qs = new String();
    for (var n in this.flashVars)
    {
        if (this.flashVars[n] != null)
        {
            qs += (escape(n)+'='+escape(this.flashVars[n])+'&');
        }
    }

    if (this.flashVarsStr != null) {
        return qs + this.flashVarsStr;
    }
    return qs.substring(0, qs.length-1);
}

function LoadFlash(movie) {
	try {
		//create new flash object
		var tag = new FlashTag('../video/player_v2.swf', 260, 195, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movie + '&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('bufferTime','1');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e) {
		//unhandled exception
    }
}

function LoadFlashAP(movie,autoPlay){
//function LoadFlashAP(movie,'true'){
	try{

	if (movie.substring(movie.indexOf('.'),movie.length)=='.flv')
	    {movie=movie.substring(0,movie.length-4);}
	
		//create new flash object
		var tag = new FlashTag('../video/player_v2.swf', 260, 195, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movie + '_260&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','true');
		tag.addFlashVar('bufferTime','1');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}

function LoadAdminFlash(movie){
	try{
		//create new flash object
		var tag = new FlashTag('../video/player_v2.swf', 260, 195, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movie + '&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('bufferTime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}


function LoadVCPFlash(movie, thewidth){
	try{
		//create new flash object
		var theheight = Math.round(3 * thewidth / 4);
		var tag = new FlashTag('../video/player_v2.swf', thewidth, theheight, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movie + '&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('bufferTime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}


function PreviewFlashFile(movFile,movWidth,movHeight){
    try{
        var movHeight;
		//create new flash object
		var tag = new FlashTag('../video/player_v2.swf', movWidth, movHeight, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movFile + '&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('bufferTime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}

function PlayFlashFile(movie, thewidth){
	try{
		//create new flash object
		var theheight = Math.round(3 * thewidth / 4);
		var tag = new FlashTag('../video/player_v2.swf', thewidth, theheight, '7,0,0,0');
		//add parameters
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('configFile','http://flash.vitalstream.com/flashgen.cgi?sname=' + movie + '&aname=jobing_vitalstream_com/_definst_');
		tag.addFlashVar('skinName','http://jobing.sitestream.com/flash/skins/clearSkin_1');
		tag.addFlashVar('autoPlay','true');
		tag.addFlashVar('bufferTime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');
		//return generated html
		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}


function LoadV6Flash(movie, theWidth, theHeight){
	try{
		var tag = new FlashTag('../video/playerV6.swf', theWidth, theHeight, '8,0,0,0');
		
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		//tag.addFlashVar('myWidth',theWidth);
		//tag.addFlashVar('myHeight',theHeight);
		//tag.addFlashVar('detectBW','1');
		//tag.addFlashVar('debug','1');
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('bufferTime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');

		return tag.toString();
    }
    catch(e){
		//unhandled exception
    }
}

function LoadV8Flash(movie, theWidth, theHeight) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
	try {
		//var tag = new FlashTag('../video/playerV8.swf', theWidth, theHeight, '8,0,0,0');
		if (theWidth > 260) {
		    var tag = new FlashTag('../video/playerV8-480.swf', theWidth, theHeight, '8,0,0,0')
		    }
		else {
		    var tag = new FlashTag('../video/playerV8-260.swf', theWidth, theHeight, '8,0,0,0')
		};
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		//tag.addFlashVar('detectBW','1');
		tag.addFlashVar('debug',showDebug);
		//tag.addFlashVar('totaltime',totaltime);
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('buffertime','2');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','2');

		return tag.toString();
    }
    catch(e) {
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);  // insert non-flash content
    }
}

function LoadV8FlashAP(movie, theWidth, theHeight) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
    // Same as LoadV8Flash except AutoPlay is set to True
	try {
	    var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
        if(hasRightVersion) {
		    //var tag = new FlashTag('../video/playerV8.swf', theWidth, theHeight, '8,0,0,0');
		    if (theWidth > 260) {
		        var tag = new FlashTag('../video/playerV8-480.swf', theWidth, theHeight, '8,0,0,0')
		        }
		    else {
		        var tag = new FlashTag('../video/playerV8-260.swf', theWidth, theHeight, '8,0,0,0')
		    };
		    tag.setSalign('tl');
		    tag.setQuality('high');
		    tag.addFlashVar('bgColor','0xFFFFFF');
		    tag.addFlashVar('streamName',movie);
		    //tag.addFlashVar('detectBW','1');
		    tag.addFlashVar('debug',showDebug);
		    tag.addFlashVar('autoPlay','true');
		    tag.addFlashVar('buffertime','2');
		    tag.addFlashVar('autoRewind','true');
		    tag.addFlashVar('s','2');

		    return tag.toString();
		}
		else {
		    // flash is too old or we can't detect the plugin
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);  // insert non-flash content
		}
    }
    catch(e) {
		//unhandled exception
    }
}

function LoadFlash512(movie, duration) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
	try {
		var tag = new FlashTag('../video/playerV8_1-512.swf', 517, 400, '8,0,0,0')
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		tag.addFlashVar('debug',showDebug);
		tag.addFlashVar('totaltime',duration);
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('buffertime','3');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','1');
		return tag.toString();
    }
    catch(e) {
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);
    }
}

function LoadFlash256(movie, duration) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
	try {
		var tag = new FlashTag('../video/playerV8-256.swf', 261, 210, '8,0,0,0')
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		tag.addFlashVar('debug',showDebug);
		tag.addFlashVar('totaltime',duration);
		tag.addFlashVar('autoPlay','false');
		tag.addFlashVar('buffertime','3');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','1');
		return tag.toString();
    }
    catch(e) {
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);
    }
}

function LoadFlash512AP(movie, duration) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
	try {
		var tag = new FlashTag('../video/playerV8-512.swf', 517, 400, '8,0,0,0')
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		tag.addFlashVar('debug',showDebug);
		tag.addFlashVar('totaltime',duration);
		tag.addFlashVar('autoPlay','true');
		tag.addFlashVar('buffertime','3');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','1');
		return tag.toString();
    }
    catch(e) {
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);
    }
}

function LoadFlash256AP(movie, duration) {
	if (window.location.toString().indexOf('debug') > -1) {
		var showDebug="1";
		}
	else {
		var showDebug="0";
		}
	
	try {
		var tag = new FlashTag('../video/playerV8-256.swf', 261, 210, '8,0,0,0')
		tag.setSalign('tl');
		tag.setQuality('high');
		tag.addFlashVar('bgColor','0xFFFFFF');
		tag.addFlashVar('streamName',movie);
		tag.addFlashVar('debug',showDebug);
		tag.addFlashVar('totaltime',duration);
		tag.addFlashVar('autoPlay','true');
		tag.addFlashVar('buffertime','3');
		tag.addFlashVar('autoRewind','true');
		tag.addFlashVar('s','1');
		return tag.toString();
    }
    catch(e) {
            var alternateContent = 'Jobing.com uses Flash 8 to provide streaming video content.'
  	        + ' Please download and install the Macromedia Flash Player. '
   	        + '<a href=http://www.macromedia.com/go/getflash/>Get Flash</a>';
            document.write(alternateContent);
    }
}



// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------



<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}
//-->

