
$(document).ready(function()
{
	
	$('.nyro').nyroModal({bgColor: '#000000'});
	var tampon_hauteur = '';
	$('.vignette_bas').each(function()
	{
		temp_hauteur = parseInt($(this).height());
		
		
		if(temp_hauteur > tampon_hauteur)
		{
			tampon_hauteur = temp_hauteur;
		}
		
	});
	$('.vignette_bas').css('height',tampon_hauteur+'px');
	
});						

$(document).ready(function()
{	
	$("#form_newsletter").submit( function() {
		if($('#email').val() == '' || $('#email').val() == 'E-mail')
		{
			return false;
		}
	 });
});

$(document).ready(function()
{

function verifierEMail(email)
{
	var expr=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}[.]?[a-zA-Z]{0,3}$/;
	if(expr.exec(email))
	{
		return true;
	}
	else
	{
		return false;
	}
}
	
	/*$('#form_mvd_awards').submit(function()
	{
			
		var cpt_erreur = 0;
		
		if($('#get_categ_films').val() == 'Choisissez')
			{
				cpt_erreur = cpt_erreur + 1;
				
			}

			/* if($('#get_pays').val() == 'Choisissez')
			{
				cpt_erreur = cpt_erreur + 1;
			
			} 
		 */
		/*$("#form_mvd_awards textarea").each(function(i){
		
			if($(this).val() == '')
			{
				cpt_erreur = cpt_erreur + 1;
				return false;
			}	
		});
		
		$("#form_mvd_awards input").each(function(i){
		// get_nom
		//get_prenom
		//get_societe
		//get_email
		//get_mobile
		//get_fonction
		//get_blog
		//get_nom_video
		//get_producteur
		//get_musique
		//get_scenariste
		//get_categ_films
		//get_video
		//get_logo
		//get_photo
		
			//alert($(this).attr('name'));
			// if($(this).attr('name') != 'get_photo'&& $(this).attr('name') != 'get_scenariste' && $(this).attr('name') != 'get_concepteur' && $(this).attr('name') != 'get_producteur' && $(this).attr('name') != 'get_vide' && $(this).attr('name') != 'get_musique' && $(this).attr('name') != 'get_blog' && $(this).attr('name') != 'get_video' && $(this).attr('name') != '' && $(this).hasClass('off') == false)
			 if($(this).attr('name') != 'get_vide' && $(this).attr('name') != 'website' && $(this).attr('name') != '' && $(this).attr('name') != 'get_video')
			{
					if($(this).attr('name') == 'get_email')
					{
						if(!verifierEMail($(this).val()))
						{
							cpt_erreur = cpt_erreur + 1;
						}
					}
			
					if($(this).val() == '')
					{
						cpt_erreur = cpt_erreur + 1;
					}
			} 
		});
		
		
		if(cpt_erreur != 0)
		{
			$(document).scrollTo(0,500); 
			var tampon_infos = '<b>Les champs marqués d\'une étoile sont obligatoires</b>';
			$("#retour_sur_formulaire").html(tampon_infos);
			$("#retour_sur_formulaire").removeClass('off');
			return false;
		}
		else
		{
			$(document).scrollTo(0,500);
			var tampon_infos = '<b>Votre film est en cours de t&eacute;l&eacute;chargement Merci de ne pas quitter cette page, ou fermer votre navigateur';
			$("#retour_sur_formulaire").html(tampon_infos);
			$("#retour_sur_formulaire").removeClass('off');
		}
		
	});*/
});

$(document).ready(function()
{
	$('.fleche_select').click(function()
	{
	
		if($(this).hasClass('surOff'))
		{
			$(this).next().show();
			$(this).removeClass('surOff');
		}
		else
		{
			$(this).next().hide();
			$(this).addClass('surOff');
		}
	});
	
	$('.item_val').click(function()
	{
		$(this).parent().hide();		
		$(this).parent().parent().find('input').val($(this).html());
		$(this).parent().parent().find('.libelle_input_select_rose').html($(this).html());
		$(this).parent().parent().find('.fleche_select').addClass('surOff');
		
		if($(this).hasClass('fonction'))
		{			
			if($(this).html()=='autre fonction' || $(this).html()=='other')
			{
				$('#autrefonction').show();
			}
			else
			{
				$('#autrefonction').hide();
			}
		}
		else if($(this).hasClass('catego'))
		{
			if($(this).html()=='autre' || $(this).html()=='other')
			{
				$('#autrecatego').show();
			}
			else
			{
				$('#autrecatego').hide();
			}
		}
	});
	
	$('.item_val').mouseover(function()
	{
		$(this).css('color', '#FFFFFF');
		$(this).css('background-color', '#F355A8');
		
	});
	
	$('.item_val').mouseout(function()
	{
		$(this).css('color', '#ED1E79');
		$(this).css('background-color', '#E6E6E6');
	});
	
	 $("input[type=file]").filestyle({ 
		 image: "../images/joindre.png",
		 imageheight : 15,
		 imagewidth : 60,
		 width : 205
	 });
	
});


$(document).ready(function()
{

	$('.txt_conf_detail').each(function()
	{

		var temp_id = $(this).attr('id');
		temp_id = temp_id.replace('conf_detail_','');
		
		
			
			$('#hauteur_'+temp_id).val($(this).height());
			
		
			
			$(this).addClass('off');
			$(this).height('0');
		
	});


	$('.art_plus').click(function()
	{
		
		var temp_id = $(this).attr('id');
		temp_id = temp_id.replace('plus_','');
		
		if($('#deplier_'+temp_id).val() == '0')
		{
			$('#conf_detail_'+temp_id).removeClass('off');
			
			var hauteur = $('#hauteur_'+temp_id).val();
			
			
			$('#conf_detail_'+temp_id).animate({height:hauteur+'px'}, 'fast', function()
			{
				$('#deplier_'+temp_id).val('1');
			});
			$('#plus_'+temp_id).attr('src','../images/moins_conf.png');
		}
		else if($('#deplier_'+temp_id).val() == '1')
		{
			
			$('#conf_detail_'+temp_id).animate({height:'0px'}, 'fast', function()
			{
				$('#conf_detail_'+temp_id).addClass('off');
				$('#conf_detail_'+temp_id).css('display','none');
				$('#deplier_'+temp_id).val('0');
				$('#plus_'+temp_id).attr('src','../images/plus_conf.png');
			});
			
		}
		
	});	
});

function explode(delimiter,string,limit){var emptyArray={0:''};if(arguments.length<2||typeof arguments[0]=='undefined'||typeof arguments[1]=='undefined'){return null;}
if(delimiter===''||delimiter===false||delimiter===null){return false;}
if(typeof delimiter=='function'||typeof delimiter=='object'||typeof string=='function'||typeof string=='object'){return emptyArray;}
if(delimiter===true){delimiter='1';}
if(!limit){return string.toString().split(delimiter.toString());}else{var splitted=string.toString().split(delimiter.toString());var partA=splitted.splice(0,limit-1);var partB=splitted.join(delimiter.toString());partA.push(partB);return partA;}}
 
	

	

