﻿/**
 * @author Rafael Costa
 */
function showContent()
{
	$("#content_theme").show();

	$("#flash_internal").hide();
	
	$("#content_theme").animate({opacity: 0}, 0);
	
	$("#content_theme").animate({opacity: 1}, 1500);
}

var nEmails = 0;
var nTotalEmails = 0;
var nMaxEmails = 4;

function addEmail()
{
	if (nTotalEmails < nMaxEmails) {
		nEmails++;
		nTotalEmails++;
		var sHtml = "<div id=\"email_" + nEmails + "\"><br><strong>Le ou les emails de tes amis</strong><br><input type=\"text\" name=\"mail[]\" size=\"60\" maxlength=\"120\">&nbsp;<a href=\"javascript:void(0)\" onclick=\"addEmail();\"><img src=\"images/more_email.gif\" align=\"absmiddle\" /></a>&nbsp;<a href=\"javascript:void(0)\" onclick=\"removeEmail(" + nEmails + ");\"><img src=\"images/less_email.gif\" align=\"absmiddle\" /></a><br></div>";
		$("#emails_dynamic").append(sHtml);
	}
	else
	{
		alert("Tu ne peux indiquer que 5 amis à la fois");
	}
}

function removeEmail(nId)
{
	$("#email_"+nId).remove();
	nTotalEmails--;
}

function pop3(zz)
{
        ad = "http://www.explorateurs-energie.com/php/animations.php?anim=" + zz;
        fenetre = window.open(ad, "fen", "width=620, height=640");
        fenetre.focus();
}

function switchVideo(sNameVideo, sTitleEpisode)
{
	$("#flash_static").html("");
	
	var sURLVideo = "sURLVideo=http://www.explorateurs-energie.com/serietele/" + sNameVideo; 
	var sTxtTitle = "sTxtTitle="+sTitleEpisode;
	
	var sFlashVars = sURLVideo + "&" + sTxtTitle;
	
	
	var sHtml = '<object width="320" height="290"><param name="movie" value="flash/player_video.swf"><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="flashvars" value="'+sFlashVars+'" /><embed src="flash/player_video.swf" flashvars="'+sFlashVars+'" width="320" height="290" bgcolor="#000000" wmode="transparent"></embed></object>';
	
	$("#flash_static").html(sHtml);	
}

function mouseOver(htmlElement, srcImg)
{
	$("#"+htmlElement).attr("src", "images/"+srcImg);
}

function mouseOut(htmlElement, srcImg)
{
	$("#"+htmlElement).attr("src", "images/"+srcImg);
}

function popupVideo(srcFLV, sTitle)
{
	window.open('popup_video.php?srcFLV='+srcFLV+'&sTitle='+sTitle, 'Videos', 'width=340,height=310,toolbar=no,menubar=no,location=no,status=no,scrollbars=no');
}
