﻿var VideoID         = 0;
var VideoHeader     = "";
var VideoCaption    = "";

/*
function LoadFlash() 
{
    var objectString = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='650' height='500' id='WDC' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='WDC.swf' /><param name='quality' value='high' /><embed src='WDC.swf' quality='high' bgcolor='#ffffff' width='650' height='500' name='WDC' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
    document.getElementById("flashcontent").innerHTML = objectString;
}

function ChangeMovie() 
{
    var objectString = "<object type='application/x-shockwave-flash' width='300' height='232' data='http://multimedia.johncom.co.za/flvplayer3.99.swf?file=http://multimedia.johncom.co.za/flvideo/'+VideoID+'.flv&autostart=false&showfsbutton=true&image=http://multimedia.johncom.co.za/thumb/1_'+VideoID+'_overlay.jpg'><param name='movie' value='http://multimedia.johncom.co.za/flvplayer3.99.swf?file=http://multimedia.johncom.co.za/flvideo/"+VideoID+".flv&autostart=false&showfsbutton=true&image=http://multimedia.johncom.co.za/thumb/1_"+VideoID+"_overlay.jpg' /><param name='wmode' value='transparent' /><param name='allowScriptAccess' value='sameDomain' /><embed src='http://multimedia.johncom.co.za/flvplayer3.99.swf?file=http://multimedia.johncom.co.za/flvideo/"+VideoID+".flv&autostart=false&showfsbutton=true' loop='false' width='300' height='232' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
    var sArticleVideo = "<table cellpadding='0' cellspacing='0' border='0' ><tr><td class='VideoTitle'>Featured Video</td></tr><tr><td style='width:300px; vertical-align:top; background-color:#FFFFFF;'>" + objectString + "</td></tr><tr><td class='VideoCaption'><span class='VideoCaption'>" + VideoCaption + "</span></td></tr></table>";
    document.getElementById("flashvideo").innerHTML = sArticleVideo;
}
*/

function ChangeMovie(vidid) 
{   
    $("flashcontent").style.display         = "block";
    $("videoHeader").style.display          = "block";
    $("videoCaption").style.display         = "block";
    
	var flashvars = {  
		file: "http://multimedia.johncom.co.za/flvideo/" + vidid + ".flv",  
		image: "http://multimedia.johncom.co.za/thumb/1_" + vidid + ".jpg",  
		showfsbutton: "true",
		autostart: "false"
		};
	
	var params = {  
		allowfullscreen: "false",
		wmode: "transparent",
		allowScriptAccess: "sameDomain"
		};
	var attributes = {};
	
	swfobject.embedSWF("http://multimedia.johncom.co.za/flvplayer3.99.swf", "flashcontent", "320", "280", "8","", flashvars, params, attributes);
	
	if(VideoHeader == "")
	    VideoHeader = "Featured video";
	
	$("videoHeader").innerHTML = VideoHeader;
	$("videoCaption").innerHTML = "<div class='VideoCaption'>" + VideoCaption + "</div><hr class='VideoSpacer' /><br/>";
}

function LoadAudio(file, caption) 
{   
    //alert("http://localhost/theheraldv2/" + file);

    $("audioContent").style.display         = "block";
    $("audioCaption").style.display         = "block";
    
	var flashvars = {
	    playerID:"1",
	    bg:"0xF8F8F8",
	    leftbg:"0xEEEEEE",
		rightbg:"0xCCCCCC",
		rightbghover:"0x999999",
		lefticon:"0x666666",
		righticon:"0x666666",
		righticonhover:"0xFFFFFF",
		text:"0x666666",
		slider:"0xff0000",
		track:"0xFFFFFF",
		loader:"0x999999",
		border:"0x666666",
		autostart:"no",
		soundFile:"http://196.44.3.77:99/" + file
	    };
	
	var params = {};
	var attributes = {};
	
	swfobject.embedSWF("http://196.44.3.77:99/images/audio/player.swf", "audioContent", "290", "24", "8","", flashvars, params, attributes);
	var AudioCaption = caption;
	
	
	$("audioCaption").innerHTML = "<div class='VideoCaption'>" + AudioCaption + "</div><hr class='VideoSpacer' /><br/>";
}

function ap_stopAll(somevar)
{
    //This is a hack: The player has an embedded call to a jquery function, not required here
}

