﻿// JScript File


var AxAddDiggVideo = {
	delay: 200,
	prepare: function() { 
	
		InputVar = new Array(IdVideo,readCookie("GenreInternaute"));
			    
	},
	call: proxies.AjaxFunc.AddDiggVideo,
	finish: function (p) 
	{ 
		document.getElementById("NbDigg" + readCookie("GenreInternaute")).innerHTML = p + "<br>votes";
		document.getElementById("LienVotez").innerHTML = "<img border='0' src='/images/vote_off.gif'><span class='ActionText disable'>Vous avez voté pour cette vidéo.</span>";
	},
	onException: ajax.alertException
}

var AxAddDiggRecit = {
	delay: 200,
	prepare: function() { 
	
		InputVar = new Array(IdRecit,readCookie("GenreInternaute"));
			    
	},
	call: proxies.AjaxFunc.AddDiggRecit,
	finish: function (p) 
	{ 
		document.getElementById("NbDigg" + readCookie("GenreInternaute")).innerHTML = p + "<br>votes";
		document.getElementById("LienVotez").innerHTML = "<img border='0' src='/images/vote_off.gif'><span class='ActionText disable'>Vous avez voté pour ce recit.</span>";
	},
	onException: ajax.alertException
}

var AxAddDiggPlayList = {
	delay: 200,
	prepare: function() { 
	
		InputVar = new Array(IdPlayList,readCookie("GenreInternaute"));
			    
	},
	call: proxies.AjaxFunc.AddDiggPlayList,
	finish: function (p) 
	{ 
		document.getElementById("NbDigg" + readCookie("GenreInternaute")).innerHTML = p + "<br>votes";
		document.getElementById("LienVotez").innerHTML = "<img border='0' src='/images/vote_off.gif'><span class='ActionText disable'>Vous avez voté pour cette playlist.</span>";
	},
	onException: ajax.alertException
}


function ChooseSexe(Sexe)
{
	SetCookie("GenreInternaute", Sexe, 1);
}

function HideChooseSexe()
{
	var target = $('Resume');
	
	var fx = new Fx.Styles(target, {duration: 1000, wait: false});
	fx.options.transition = Fx.Transitions['Expo']['easeOut'];
	fx.options.duration = 1000;
	
	fx.start({'left': 0});
	
	
	target = $('ChooseSexe');
	$('ChooseSexe').style.display = "none";
	fx = new Fx.Styles(target, {duration: 1000, wait: false});
	fx.options.transition = Fx.Transitions['Expo']['easeOut'];
	fx.options.duration = 1000;
	fx.start({'left': 0});
}

function AddDiggVideo()
{
	
	if (readCookie("GenreInternaute") == null || readCookie("GenreInternaute") == "")
	{
	
		var target = $('Resume');
		var fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -415});
		
		
		target = $('ChooseSexe');
		$('ChooseSexe').style.display = "inline";
		fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -410});
	}
	else
	{
		HideChooseSexe();
		SoapMethod = "POST";
		ajax.Start(AxAddDiggVideo);
	}
}

function AddDiggPlayList()
{
	
	if (readCookie("GenreInternaute") == null || readCookie("GenreInternaute") == "")
	{
	
		var target = $('Resume');
		var fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -268});
		
		
		target = $('ChooseSexe');
		$('ChooseSexe').style.display = "inline";
		fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -268});
	}
	else
	{
		HideChooseSexe();
		SoapMethod = "POST";
		ajax.Start(AxAddDiggPlayList);
	}
}



function AddDiggRecit()
{
	
	if (readCookie("GenreInternaute") == null || readCookie("GenreInternaute") == "")
	{
	
		var target = $('Resume');
		var fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -415});
		
		
		target = $('ChooseSexe');
		$('ChooseSexe').style.display = "inline";
		fx = new Fx.Styles(target, {duration: 1000, wait: false});
		fx.options.transition = Fx.Transitions['Expo']['easeOut'];
		fx.options.duration = 1000;
		fx.start({'left': -410});
	}
	else
	{
		HideChooseSexe();
		SoapMethod = "POST";
		ajax.Start(AxAddDiggRecit);
	}
	
	
}