// FIX SPLIT REGEX FOR MULTIPLE BROWSERS
var nativeSplit = nativeSplit || String.prototype.split;
String.prototype.split = function (s /* separator */, limit) {
    // If separator is not a regex, use the native split method
    if (!(s instanceof RegExp))
	    return nativeSplit.apply(this, arguments);

    /* Behavior for limit: If it's...
     - Undefined: No limit
     - NaN or zero: Return an empty array
     - A positive number: Use limit after dropping any decimal
     - A negative number: No limit
     - Other: Type-convert, then use the above rules */
    if (limit === undefined || +limit < 0) {
	    limit = false;
    } else {
	    limit = Math.floor(+limit);
	    if (!limit)
		    return [];
    }

    var	flags = (s.global ? "g" : "") + (s.ignoreCase ? "i" : "") + (s.multiline ? "m" : ""),
	    s2 = new RegExp("^" + s.source + "$", flags),
	    output = [],
	    lastLastIndex = 0,
	    i = 0,
	    match;

    if (!s.global)
	    s = new RegExp(s.source, "g" + flags);

    while ((!limit || i++ <= limit) && (match = s.exec(this))) {
	    var zeroLengthMatch = !match[0].length;

	    // Fix IE's infinite-loop-resistant but incorrect lastIndex
	    if (zeroLengthMatch && s.lastIndex > match.index)
		    s.lastIndex = match.index; // The same as s.lastIndex--

	    if (s.lastIndex > lastLastIndex) {
		    // Fix browsers whose exec methods don't consistently return undefined for non-participating capturing groups
		    if (match.length > 1) {
			    match[0].replace(s2, function () {
				    for (var j = 1; j < arguments.length - 2; j++) {
					    if (arguments[j] === undefined)
						    match[j] = undefined;
				    }
			    });
		    }

		    output = output.concat(this.slice(lastLastIndex, match.index), (match.index === this.length ? [] : match.slice(1)));
		    lastLastIndex = s.lastIndex;
	    }

	    if (zeroLengthMatch)
		    s.lastIndex++;
    }

    return (lastLastIndex === this.length) ?
	    (s.test("") ? output : output.concat("")) :
	    (limit      ? output : output.concat(this.slice(lastLastIndex)));
};


// RETURN HTTPREQUEST OBJECT
function getXMLHttp()
{
    var xmlhttp=false;

    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
     try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) {
      try {
       xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
       xmlhttp = false;
      }
     }
    @end @*/
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	    try {
		    xmlhttp = new XMLHttpRequest();
	    } catch (e) {
		    xmlhttp=false;
	    }
    }
    if (!xmlhttp && window.createRequest) {
	    try {
		    xmlhttp = window.createRequest();
	    } catch (e) {
		    xmlhttp=false;
	    }
    }
    return xmlhttp;
}


function playVideo(name, target, caption)
{
if (!target) target = "video_flash"; 

var flashvars = {
	videoPath: "/flash/" + name + ".flv",
	autoPlay: "true"
};
var params = {
	wmode: "transparent",
	scale: "scale",
	base:  "/flash"
};
var attributes = {};

document.getElementById('videobox').style.display = 'block';
document.getElementById('video_caption').innerHTML = caption;

swfobject.embedSWF("/flash/ET_videos.swf", target, "640", "480", "7","/flash/expressInstall.swf", flashvars, params, attributes);

pageTracker._trackPageview("/flash/" + name + ".swf");
return false;
}

function closeVideo(target, swftarget)
{
var flashvars = {};
var params = {};
var attributes = {};

swfobject.embedSWF("/flash/ET_videos.swf", swftarget, "640", "480", "7","/flash/expressInstall.swf", flashvars, params, attributes);
document.getElementById(target).style.display = 'none';
document.getElementById('video_caption').innerHTML = '';
}