//The Akamai Server Address
var theURL = "http://kojo.vividas.com/CreateOpportunities/"

//The Testing Server Address
// var theURL = "http://monster/dev/reece/kojoTv/testVids/"
var theVideo 

var theMovies = new Array()
theMovies[0] = theURL + "4954_CO1_644.viv"
theMovies[1] = theURL + "4954_CO2_644.viv"
theMovies[2] = theURL + "4954_CO3_644.viv"
theMovies[3] = theURL + "4954_CO4_644.viv"
theMovies[4] = theURL + "4954_CO5_644.viv"
theMovies[5] = theURL + "4954_CO6_644.viv"
theMovies[6] = theURL + "4954_CO7_644.viv"

function openWindow (movieString) {
	//alert(theURL+ movieString+'.viv')
	window.open('videoPlayer/popUp.html?clipToPlay='+theURL+ movieString+'.viv','videoWindow','width=700,height=580,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1')
}

/* Functions Straight from the Vividas Supplied files */
function PageQuery(q) {
    if(q.length > 1)
        this.q = q.substring(1, q.length);
    else
        this.q = null;

    this.keyValuePairs = new Array();
    if(q) {
        for(var i=0; i < this.q.split("&").length; i++) {
            this.keyValuePairs[i] = this.q.split("&")[i];
        } // for
    } // if

    this.getKeyValuePairs = function() { return this.keyValuePairs; }

    this.getValue = function(s) {
        for(var j=0; j < this.keyValuePairs.length; j++) {
            if(this.keyValuePairs[j].split("=")[0] == s)
                return this.keyValuePairs[j].split("=")[1];
        }

        return false;
    } // inner func

    this.getParameters = function() {
        var a = new Array(this.getLength());

        for(var j=0; j < this.keyValuePairs.length; j++) {
            a[j] = this.keyValuePairs[j].split("=")[0];
        } // for

        return a;
    } // inner func

    this.getLength = function() { return this.keyValuePairs.length; }
}
function pressPlay() {
	playPressedFull(theVideo, true, 0, 0, 4000, 0, false, true);
}
function queryString(key)
{
    var page = new PageQuery(window.location.search);

    return unescape(page.getValue(key));
}

function launchQueryString()
{
    var clip = queryString('clipToPlay');
    var windowMode = queryString('windowMode');

    if(clip != 'false') {
		
		theVideo = clip
		
		vividasPlayerLoaderAutoPlay(clip, true, true)
        //vividasPlayerLoaderAutoPlay(clip, false);
    } // if
}

function closeWindow()
{
    if(navigator.userAgent.toLowerCase().indexOf("msie") > 0)
        window.opener = self;

    setTimeout("self.close()", 500);

    if(_ocx)
        document[OCXName].Stop();
    else
        document[AppletName].terminate();
}/* End Vividas Supplied files */