// new layout menu and logo functions/////
var clikid = "none";
var clikimg = "none";
var baselogo = "none"

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function swapstate(currid,currimg,currlogo) {
	//alert("currid "+currid+" currimg "+currimg+" currlogo "+currlogo);
// if params passed set items 	
if (currid && currid.length > 0) 		{					
  var lgo = document.getElementById("logo");
	var lgomenu = document.getElementById(currid);
	lgo.style.background = "url(../images/" + currlogo + ")";	
	lgo.style.backgroundRepeat="no-repeat";
	lgo.style.backgroundPosition ="65px 55px"; 
	lgomenu.src= "../images/" + currimg;
}
}


function swapImage(itemid, itemurl) {			
document[itemid].src= "../images/" + itemurl;
}
// End new layout menu and logo functions/////

// old versions///
/*function swapstate(currid,currimg,currlogo) {
	alert("swapstate");
	var lgo = document.getElementById("logo");
	lgo.style.background = "url(../images/" + currlogo + ")";	
	lgo.style.backgroundRepeat="no-repeat";
	lgo.style.backgroundPosition ="65px 55px"; 
if (clikid!="none")	{
	document[clikid].src= "../images/" + clikimg;
 }
  clikid = currid;
	clikimg = currimg
}
*/
/*
function swapImage(itemid, itemurl, istate) {			
	if (itemid!=clikid)
	{
		
		if (istate=="out") {}
else {}; 
document[itemid].src= "../images/" + itemurl;
	}
else 
	{

		}
}
*/
//End old versions


// FLV video code START ###############

var debugsize;
function loader(param1, param2, param3, param4) {

var requiredvideo = param1;
var requiredimage = param2;
var requiredwidth = param3;
var requiredheight = param4;
var totalheight = requiredheight+30;

/* Config Variables - Uncomment and edit values to customize player. */

playerFile = "../FLVvideo/player/single_video_player.swf";
//streamingServerURL = ""; 
fpFileURL = "../../FLVvideo/"+requiredvideo;
fpPreviewImageURL = "../Images/"+requiredimage;
//fpAction = "";
//colorScheme = "";
//cpBackgroundColor = "000000";
//cpBackgroundOpacity = "60";
//cpButtonsOpacity = "100";
//cpCounterPosition = "330x4";
//cpFullscreenBtnPosition = "454x12";
//cpHidePanel = "button";
//cpHideDelay = "0";
//cpInfoBtnPosition = "470x12";
//cpPlayBtnPosition = "60x12";
//cpPlayBtnColor = "";
//cpPosition = "0x246";
//cpRepeatBtnPosition = "438x12";
//cpScrubberPosition = "194x8";
//cpScrubberColor = "";
//cpScrubberLoadedColor = "";
//cpScrubberElapsedColor = "";
cpVolumeStart = "90";
//cpStopBtnPosition = "85x12";
//cpStopBtnColor = "";
//cpVolumeBtnPosition = "118x2";
//cpVolumeCtrlColor = "";           460
cpSize = requiredwidth+"x24";
//defaultBufferLength = "1";
defaultEndAction = "previewImage";
//defaultStopAction = "previewImage";
//fpButtonOpacity = "60";
//fpButtonPosition = "240x118";
//fpButtonSize = "126x126";
//fpButtonColor = "";
fpPreviewImageSize = "fit";
//msgBackgroundColor = "000000";
//msgBackgroundOpacity = "90";
playerSize = requiredwidth+"x"+totalheight;
playerBackgroundColor = "000000";
//         playerBackgroundColor = "5c85a4";
//playerAutoResize = "on";
//videoScreenPosition = "0x0";
videoScreenSize = requiredwidth+"x"+requiredheight;
//tooltipTextColor = "000000";
//tooltipBGColor = "CCCCCC";
//debugsize ="cpSize: " +cpSize+" playerSize: " +playerSize+" videoScreenSize: "+videoScreenSize+" totalheight: " +totalheight;
//////////////////////////////
// Nothing below here needs to be edited.
//////////////////////////////
if (typeof playerFile == 'undefined') { playerFile = 'mcmp.swf'; }
if (typeof fpFileURL != 'undefined') { mcflashvars = 'fpFileURL='+fpFileURL; }
if (typeof playerSize == 'undefined') { playerSize = '480x270'; }
var psep = playerSize.indexOf("x");
playerWidth = playerSize.substring(0,psep);
playerHeight = playerSize.substring(psep+1);
if (typeof streamingServerURL != 'undefined') { mcflashvars += '&streamingServerURL='+streamingServerURL; }
if (typeof fpAction != 'undefined') { mcflashvars += '&fpAction='+fpAction; }
if (typeof fpPreviewImageURL != 'undefined') { mcflashvars += '&fpPreviewImageURL='+fpPreviewImageURL; }
if (typeof colorScheme != 'undefined') { mcflashvars += '&colorScheme='+colorScheme; }// New in v0.8
if (typeof cpBackgroundColor != 'undefined') { mcflashvars += '&cpBackgroundColor='+cpBackgroundColor; }
if (typeof cpBackgroundOpacity != 'undefined') { mcflashvars += '&cpBackgroundOpacity='+cpBackgroundOpacity; }
if (typeof cpButtonsOpacity != 'undefined') { mcflashvars += '&cpButtonsOpacity='+cpButtonsOpacity; }
if (typeof cpCounterPosition != 'undefined') { mcflashvars += '&cpCounterPosition='+cpCounterPosition; }
if (typeof cpFullscreenBtnPosition != 'undefined') { mcflashvars += '&cpFullscreenBtnPosition='+cpFullscreenBtnPosition; }
if (typeof cpHideDelay != 'undefined') { mcflashvars += '&cpHideDelay='+cpHideDelay; }
if (typeof cpHidePanel != 'undefined') { mcflashvars += '&cpHidePanel='+cpHidePanel; }
if (typeof cpInfoBtnPosition != 'undefined') { mcflashvars += '&cpInfoBtnPosition='+cpInfoBtnPosition; }
if (typeof cpPlayBtnPosition != 'undefined') { mcflashvars += '&cpPlayBtnPosition='+cpPlayBtnPosition; }
if (typeof cpPlayBtnColor != 'undefined') { mcflashvars += '&cpPlayBtnColor='+cpPlayBtnColor; }// New in v0.8
if (typeof cpPosition != 'undefined') { mcflashvars += '&cpPosition='+cpPosition; }
if (typeof cpRepeatBtnPosition != 'undefined') { mcflashvars += '&cpRepeatBtnPosition='+cpRepeatBtnPosition; }
if (typeof cpScrubberPosition != 'undefined') { mcflashvars += '&cpScrubberPosition='+cpScrubberPosition; }
if (typeof cpScrubberColor != 'undefined') { mcflashvars += '&cpScrubberColor='+cpScrubberColor; }// New in v0.8
if (typeof cpScrubberLoadedColor != 'undefined') { mcflashvars += '&cpScrubberLoadedColor='+cpScrubberLoadedColor; }// New in v0.8
if (typeof cpScrubberElapsedColor != 'undefined') { mcflashvars += '&cpScrubberElapsedColor='+cpScrubberElapsedColor; }// New in v0.8
if (typeof cpVolumeStart != 'undefined') { mcflashvars += '&cpVolumeStart='+cpVolumeStart; }
if (typeof cpStopBtnPosition != 'undefined') { mcflashvars += '&cpStopBtnPosition='+cpStopBtnPosition; }
if (typeof cpStopBtnColor != 'undefined') { mcflashvars += '&cpStopBtnColor='+cpStopBtnColor; }// New in v0.8
if (typeof cpVolumeBtnPosition != 'undefined') { mcflashvars += '&cpVolumeBtnPosition='+cpVolumeBtnPosition; }
if (typeof cpVolumeCtrlColor != 'undefined') { mcflashvars += '&cpVolumeCtrlColor='+cpVolumeCtrlColor; }// New in v0.8
if (typeof cpSize != 'undefined') { mcflashvars += '&cpSize='+cpSize; }
if (typeof defaultBufferLength != 'undefined') { mcflashvars += '&defaultBufferLength='+defaultBufferLength; }
if (typeof defaultEndAction != 'undefined') { mcflashvars += '&defaultEndAction='+defaultEndAction; }
if (typeof defaultStopAction != 'undefined') { mcflashvars += '&defaultStopAction='+defaultStopAction; }
if (typeof fpButtonOpacity != 'undefined') { mcflashvars += '&fpButtonOpacity='+fpButtonOpacity; }
if (typeof fpButtonPosition != 'undefined') { mcflashvars += '&fpButtonPosition='+fpButtonPosition; }
if (typeof fpButtonSize != 'undefined') { mcflashvars += '&fpButtonSize='+fpButtonSize; }
if (typeof fpButtonColor != 'undefined') { mcflashvars += '&fpButtonColor='+fpButtonColor; }// New in v0.8
if (typeof fpPreviewImageSize != 'undefined') { mcflashvars += '&fpPreviewImageSize='+fpPreviewImageSize; }
if (typeof msgBackgroundColor != 'undefined') { mcflashvars += '&msgBackgroundColor='+msgBackgroundColor; }
if (typeof msgBackgroundOpacity != 'undefined') { mcflashvars += '&msgBackgroundOpacity='+msgBackgroundOpacity; }
if (typeof playerBackgroundColor != 'undefined') { mcflashvars += '&playerBackgroundColor='+playerBackgroundColor; }
if (typeof playerAutoResize != 'undefined') { mcflashvars += '&playerAutoResize='+playerAutoResize; }// New in 0.7
if (typeof playerSize != 'undefined') { mcflashvars += '&playerSize='+playerSize; }
if (typeof videoScreenSize != 'undefined') { mcflashvars += '&videoScreenSize='+videoScreenSize; }
if (typeof videoScreenPosition != 'undefined') { mcflashvars += '&videoScreenPosition='+videoScreenPosition; }
if (typeof tooltipTextColor != 'undefined') { mcflashvars += '&tooltipTextColor='+tooltipTextColor; }// New in 0.7
if (typeof tooltipBGColor != 'undefined') { mcflashvars += '&tooltipBGColor='+tooltipBGColor; }// New in 0.7
mccode();
}



function mccode() {
//alert("debugsize here "+debugsize);
	var str='';
//str+='<div id="videobox">';

  str+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,0,0" width="'+playerWidth+'" height="'+playerHeight+'">\n';
	str+='<param name="movie" value="'+playerFile+'">';
	str+='<param name="allowScriptAccess" value="always">';
	str+='<param name="quality" value="high">';
	str+='<param name="allowFullScreen" value="true">';
	str+='<param name="FlashVars" value="'+mcflashvars+'">\n';
	str+='<embed src="'+playerFile+'" width="'+playerWidth+'" height="'+playerHeight+'" quality="high" allowFullScreen="true" allowscriptaccess="always" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application\/x-shockwave-flash" FlashVars="'+mcflashvars+'"><\/embed>\n';
	str+='<\/object>';

	//str+='</div>';
	/*var id="videobox"
	  var newdiv = document.createElement('div');
   newdiv.setAttribute('id', id); 
       newdiv.style.width = 100%; 
       newdiv.style.height = 300;      
   newdiv.style.background = "#00C";
   newdiv.style.border = "4px solid #000";
   document.body.appendChild(newdiv);
     newdiv.innerHTML = str;
	*/
	document.write(str);
}







//FLV video code END ##################