
function changeVideo(data) {
	bc_video.loadVideo(data);		
}



function ValeurCookie (Pos) {
	var endstr = document.cookie.indexOf (";", Pos);
	if (endstr == -1)
	endstr = document.cookie.length;
	
	return unescape(document.cookie.substring (Pos, endstr));
}

function GetValeurCookie (nom) {
	var cookielength = document.cookie.length;
	var arg = nom + "=";
	var arglength = arg.length;
	var i = 0;
	while (i < cookielength) {
	var j = i + arglength;
	if (document.cookie.substring(i, j) == arg)
	
	return ValeurCookie (j);
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break; 
	
	}
	return null;

}


noter = function(id,note) {
	var isVlogCookie = GetValeurCookie('vlog'+id);
	if (isVlogCookie==null) {
		AjaxRequest.get(
		  {
				'url':'/cgi-bin/vlog/note.cgi'
		    ,'parameters':{ 'id':id, 'note':note}
		    ,'onSuccess':function(req) {alert("Merci d\'avoir not\351 cette vid\351o");}
		  }
		);
		
	}
	else alert("Vous avez d\351j\340 not\351 cette vid\351o");
	
	
	
	/*cookies = document.cookie.gsub(' ','').toQueryParams(';');
	if (!cookies['vlog'+id]) {
		new Ajax.Request('/cgi-bin/vlog/note.cgi',{
			method: 'get',
			parameters: { id: id, note: note }
		});
		alert("Merci d\'avoir not\351 cette vid\351o");
	}
	else alert("Vous avez d\351j\340 not\351 cette vid\351o");*/
}


function effectBio(id){
	var autre = (id == 'Arpin') ? 'Borne' : 'Arpin';
	alert('#txt'+autre);
	if($('#txt'+autre).css('display') == 'block'){
		$('#txt'+autre).fadeOut(800);	
		setTimeout(function() { effectBio2(id) }, 800);
	} else {
		effectBio2(id);
	}

	return false;
}

function effectBio2(id) {
	if($('#txt'+id).css('display') == 'none'){
		$('#txt'+id).fadeIn(800);
	} else {
		$('#txt'+id).fadeOut(800);
	}
	return false;
}

function adMenu(){
	var menu = new flashObj({ 
		url:                 'vlog_menu.swf',
		width:               '640',
		height:    			 '185',
		quality:             'autohigh',
		wmode:               'Transparent',       
		version:             '8.0.24',
		id: 'menu'
	});
	
	if(menu.hasPlugin() && menu.isVersionMin('8.0.24')){
		menu.generate();
	}else {
		document.getElementById('headingVlog').style.display = 'block';
		document.getElementById('c_menu').style.display = 'block';
	}
}	


function openwin(url){
	_winheight = screen.height - 700;
	_winwidth = screen.width - 700;
	_linkexterne = window.open(url,null,'height=600,width=700, top='+_winheight+', left='+_winwidth+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes');
	setTimeout('_linkexterne.focus();',250);
	return false;
}




function FindXY(obj){
	var x=0,y=0;
	while (obj!=null){
		x+=obj.offsetLeft-obj.scrollLeft;
		y+=obj.offsetTop-obj.scrollTop;
		obj=obj.offsetParent;
	}
	return {x:x,y:y};
}

function closeDHTML(){
	document.getElementById('c_cadeau').style.display = 'none';
}


function episodevideo(url) {
	new playerWinMedia({ 
		id:       'player',
		url:      url,
		width:    320,
		height:   240,
		uimode:   'full',
		noplugin: { bgcolor: '#000000', color: '#ffffff' }
	}).generate({
		output:{
			type:     'object',
			id:       'contener_video',
			property: 'innerHTML'
		}
	});

	return false;
}
