
function activateField(videosListID,idData)
{
	document.getElementById('videosList0').className = 'random-video';
	document.getElementById('videosList1').className = 'random-video';
	document.getElementById('videosList2').className = 'random-video';
	document.getElementById('videosList3').className = 'random-video';
	document.getElementById(videosListID).className = 'random-video-active';
	document.getElementById('videosListData0').innerHTML = document.getElementById("Data"+idData).innerHTML;
}
function changeVideo (id , flv , image , fullscreen ){
		document.getElementById('PlayAgain').style.display = 'none';
		document.getElementById('player').style.display = 'block';
		var PlayerPath = "http://i1.makcdn.com/clipat/image/flowplayer.commercial-3.1.2.swf";
		player(flv , false);
		playList(id)
}

function playList(id){
		var params = {
			bgcolor:"#000000",
			allowScriptAccess:'always',
			allowFullScreen: "true",
			wmode: "opaque"
		};
		
		var flashvars = {};
		var attributes = {};			
		swfobject.embedSWF("http://cdn.maktoob.com/images/flvPlayer/playList2.swf?conf=http://clipat.maktoob.com/relatedVideos.php?videoId="+id, "playList" , "380", "120", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
}

function replay(){
	document.getElementById('PlayAgain').style.display = 'none';
	document.getElementById('player').style.display = 'block';
	player( $f('player').getClip(0) , false);
}
			
function player(flv , ads){
	var clipPath = flv;
	$f("player", { src: PlayerPath, wmode: 'opaque'} , {
					clip:{autoBuffering:true ,accelerated:true},
					key: '#$67c3ac88e68a747234d',
					playlist: [clipPath],
					play: { url: 'Play.swf', opacity: 0.8, label: null, replayLabel: 'Play again', fadeSpeed: 500, rotateSpeed: 50 },
					plugins: {controls: {fullscreen : true,playlist: false,all: false,play: true,volume:true,mute:true,time:true,scrubber: true }},
					play: { replayLabel: 'replay', fadeSpeed: 500, rotateSpeed: 50 },
					onFinish : function()
							{
								document.getElementById('PlayAgain').style.display = 'block';
								document.getElementById('player').style.display = 'none';
							}
				}
		);
}

function player(flv , ads){
	var clipPath = flv;
	if ( ads == true ){
		
		$f("player",  { src: PlayerPath, wmode: 'opaque'}  , {
						clip:{accelerated:true ,autoBuffering:true ,accelerated:true},
						key: '#$67c3ac88e68a747234d',
						playlist: [clipPath],
						play: { replayLabel: 'اعادة', fadeSpeed: 500, rotateSpeed: 50 },
						plugins: {controls: {fullscreen : true,playlist: false,all: false,play: true,volume:true,mute:true,time:true,scrubber: true }},
						logo:{url: '/clipat-icon.png',top:'83%',right:'15%',opacity: 0.8,displayTime: 0,fadeSpeed: 1,linkUrl:'',fullscreenOnly: false},
						onLoad : function() {OAS_AD('x65');},
						onFinish : function()
							{
								document.getElementById('PlayAgain').style.display = 'block';
								document.getElementById('player').style.display = 'none';
							}
					}
			);
			
	} else {
		
		$f("player", { src: PlayerPath, wmode: 'opaque'} , {
						clip:{accelerated:true ,autoBuffering:true ,accelerated:true},
						key: '#$67c3ac88e68a747234d',
						playlist: [clipPath],
						play: { replayLabel: 'اعادة', fadeSpeed: 500, rotateSpeed: 50 },
						plugins: {controls: {fullscreen : true,playlist: false,all: false,play: true,volume:true,mute:true,time:true,scrubber: true }},
						logo:{url: '/clipat-icon.png',top:'83%',right:'15%',opacity: 0.8,displayTime: 0,fadeSpeed: 1,linkUrl:'',fullscreenOnly: false},
						onFinish : function()
							{
								document.getElementById('PlayAgain').style.display = 'block';
								document.getElementById('player').style.display = 'none';
							}
					}
		);
		
	}
}
