/**
 * @author 
 */

medialink = {
	
	setDisplay:function(idOrEl,value){
	    var el = (typeof(idOrEl) == "string") ? medialink.getEl(idOrEl) : idOrEl;
		if (el != null){
        	el.style.display = value;
		}		
	}
	,
	showDiv:function(id) {medialink.setDisplay(id, 'block');}
	,
	
	hideDiv:function(id) {medialink.setDisplay(id, 'none');}
	,
	
	getEl:function(id){
    	return (document.getElementById) ? document.getElementById(id) : null;
	},
	
	initVideo:function(flv, width, height, div, autoPlay)
	{
	    // 576x324
	    // 346x197
	    // MDLK_PROMO_DOTCOM576x324.flv
        var fo = new SWFObject("/swfs/FlowPlayerWhite.swf", "FlowPlayer", width, height, "0", "#ffffff", true);
        fo.addParam("allowScriptAccess", "always"); 
       // fo.addVariable("config", "{ showPlayListButtons: true, playList: [ {overlayId: 'play' }, { url: 'http://flowplayer.org/video/honda_accord.flv' } ], initialScale: 'fit' }");
 //autoPlay='false';
	fo.addVariable("config", "{ showMenu: false, showFullScreenButton: false, autoPlay: " + autoPlay + ", playList: [{ url: '" + flv + "' }], menuItems: [ true, false, false, false, false, false ], autoBuffering: true, loop: false, bufferBarColor1: 0xFFFFFF, bufferBarColor2: 0xFFFFFF, bufferingAnimationColor: 0xFFFFFF, initialScale: 'scale' }");
        fo.write(div);
	},
	
	initSmallVideo:function(flv){
        var fo = new SWFObject("/swfs/FlowPlayer.swf", "FlowPlayer", "346", "197", "0", "#ffffff", true);
        fo.addParam("allowScriptAccess", "always"); 
       // fo.addVariable("config", "{ showPlayListButtons: true, playList: [ {overlayId: 'play' }, { url: 'http://flowplayer.org/video/honda_accord.flv' } ], initialScale: 'fit' }");
        fo.addVariable("config", "{ playList: [{ url: '/images/buttons/black.png', overlay: '/images/buttons/video_play.png' },{ url: '/flvs/MDLK_PROMO_DOTCOM576x324.flv' }], hideControls: true, autoBuffering: true, initialScale: 'scale' }");
        fo.write("fp1Small");
	}
}

        function popUp(URL) {
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=0,menubar=1,resizable=1,width=800,height=600,left = 112,top = 84');");
        }

