// JavaScript Document


			//produits peaux sèches
			//-------------------------------------------------------------------------
			produitsPeauxSeches = new Array();
			produitsPeauxSeches[0] = 'Make-up<br>Remover<br>Gel-textured Oil<br>Face and Eyes';
			produitsPeauxSeches[1] = 'Precious Oil';
			produitsPeauxSeches[2] = 'Nourishing<br>Active<br>Night Care';
			produitsPeauxSeches[3] = 'Nutri-repair<br>Gentle Lip Balm';
			produitsPeauxSeches[4] = 'Nourishing-<br>Intensive Mask';
			produitsPeauxSeches[5] = 'Nourishing<br/>and Firming';
			produitsPeauxSeches[6] = 'Nutri-Repair<br/>Silky Hand<br/>and Nail Cream';
			produitsPeauxSeches[7] = 'Revitalizing<br/>Dry Oil<br/>for the body';
			produitsPeauxSeches[8] = 'Nourishing and<br>Repairing Milky<br>Body Cream';
			produitsPeauxSeches[9] = 'Black Soap<br>body srub';
			produitsPeauxSeches[10] = 'Comfort<br>Repair<br>Cream ';
			produitsPeauxSeches[11] = 'Gentle<br>Repair<br>Emulsion';
			
			
			//produits anti-age
			//-------------------------------------------------------------------------
			produitsAntiAge = new Array();
			produitsAntiAge[0] = 'with distilled<br/>melilotus water ';
			produitsAntiAge[1] = 'Precious Oil';
			produitsAntiAge[2] = 'Redensifying<br/>Lifting Care';
			produitsAntiAge[3] = 'Nourishing-<br/>Active<br/>Night Care';
			produitsAntiAge[4] = 'Redensifying<br>Eye-Lip Care';
			produitsAntiAge[5] = 'Nourishing-<br/>Intensive Mask';
			produitsAntiAge[6] = 'Regenerating<br/>Dry Oil<br/>for the Body';
			produitsAntiAge[7] = 'Nutri-Repair<br/>Silky Hand<br/>and Nail<br/>Cream';
			produitsAntiAge[8] = 'Nourishing<br/>and Firming';
			
			
			//produits anti-rides
			//-------------------------------------------------------------------------
			produitsAntiRides = new Array();
			produitsAntiRides[0] = 'with distilled<br/>melilotus water ';
			produitsAntiRides[1] = 'Anti-wrinkle repairing serum';
			produitsAntiRides[2] = 'Cream';
			produitsAntiRides[3] = 'Night care';
			produitsAntiRides[4] = 'Eye Care';
			produitsAntiRides[5] =  'Anti-wrinkle repairing and firming mask';
			produitsAntiRides[6] = 'Smoothing<br/>Eye Contour<br/>Patches';
			produitsAntiRides[7] = 'Emulsion';
			produitsAntiRides[8] = 'Cream SPF 15';
			produitsAntiRides[9] = 'Instant Plumping and Wrinkle-Filling Elixir';
			
			
			//produits énergie
			//-------------------------------------------------------------------------
			produitsEnergie = new Array();
			produitsEnergie[0] = 'with distilled<br/>melilotus water';
			produitsEnergie[1] = 'Smoothing new-skin elixir,<br/>Super radiance booster';
			produitsEnergie[2] = 'Hydra Energizing<br>Light cream<br/>SPF 15';
			produitsEnergie[3] = 'Hydra-Energizing<br/>Velvet cream<br/>SPF 15';
			produitsEnergie[4] = 'Fresh<br>Anti-Fatigue<br>Eye care';
			
						
			//produits anti-taches
			//-------------------------------------------------------------------------
			produitsAntiTaches = new Array();
			produitsAntiTaches[0] = 'with distilled<br/>melilotus water ';
			produitsAntiTaches[1] = 'Intense Lightening Serum';
			produitsAntiTaches[2] = 'Anti-Brown Spot<br>Protective Cream ';
			produitsAntiTaches[3] = 'Anti-Brown<br>Spot Corrector<br>Concentrate';
			

            //produits hydratation
			//-------------------------------------------------------------------------
			produitsHydratation = new Array();
			produitsHydratation[0] = 'with distilled<br/>melilotus water ';
			produitsHydratation[1] = 'Intense<br>Moisturizing<br>Elixir';
			produitsHydratation[2] = 'Moisturizing<br>Sorbet Cream-Gel';
			produitsHydratation[3] = 'Moisturizing<br>Sorbet Cream';
			produitsHydratation[4] = 'Hydra-Defense<br>moisturizer SPF 15';
			produitsHydratation[5] = 'Instant<br/>Moisturizing<br/>Mask';
			
			//produits hydratation Teintee (AQUASUBLIME)
			//-------------------------------------------------------------------------
			produitsHydratationTeintee = new Array();
			produitsHydratationTeintee[0] = 'Hydra-illuminating<br>tinted cream';
			produitsHydratationTeintee[1] = 'Hydra-radiance<br>brush complexion perfector';


			//produits peaux grasses
			//-------------------------------------------------------------------------
			produitsPeauxGrasses = new Array();
			produitsPeauxGrasses[0] = 'with distilled<br/>melilotus water ';
			produitsPeauxGrasses[1] = 'Purifying<br/>Cleanser Gel';
			produitsPeauxGrasses[2] = 'Astringent<br/>Lotion';
			produitsPeauxGrasses[3] = 'Moisturizing<br/>Balancing<br/>Cream-Gel';
			produitsPeauxGrasses[4] = 'Purifying<br/>Perfector<br/>Concentrate';
			produitsPeauxGrasses[5] = '3 in 1<br/>Clarifying<br/>Mask';
			produitsPeauxGrasses[6] = 'Hydra-Matifying Cream Gel';
			produitsPeauxGrasses[7] = 'Re-Balancing Renewing Care';
			
			
			//produits démaquillage
			//-------------------------------------------------------------------------
			produitsDemaquillage = new Array();
			produitsDemaquillage[0] = 'PUR Foam Cleansing<br/>Gel';
			produitsDemaquillage[1] = 'Cleansing<br/>make-Up remover<br/>Mousse';
			produitsDemaquillage[2] = 'Make-up<br/>Remover milk';
			produitsDemaquillage[3] = 'Cleansing make-Up<br/>Remover Water';
			produitsDemaquillage[4] = '2 to 1<br/>Make-up remover';
			produitsDemaquillage[5] = 'Toner';
			produitsDemaquillage[6] = 'Eyes Make-up<br/>Remover';
			produitsDemaquillage[7] = 'Exfoliating Gel';
			
			
			//produits solaire1
			//-------------------------------------------------------------------------
			produitsSolaires1 = new Array();
			produitsSolaires1[0] = 'Food<br/>Supplement';
			produitsSolaires1[1] = 'Light Facial Cream<br/>SPF50+';
			produitsSolaires1[2] = 'After-Sun<br/>Repair Balm';
			produitsSolaires1[3] = 'Velvet After-Sun <br/>Lotion';
			produitsSolaires1[4] = 'After-Sun<br/>Shower Gel';
			produitsSolaires1[5] = 'Lightweight<br/>Self-Tanning<br/>Gel';
			produitsSolaires1[6] = 'Anti-ageing Refreshing<br>Cream-Gel After-Sun';
			produitsSolaires1[7] = 'Lightweight<br>Self-Tanning Gel';
			produitsSolaires1[8] = 'Self-Tanning Veil';
			
			
			mentionSolaire = 'the most suitable for you ';			
			
			//produits solaire2
			//-------------------------------------------------------------------------
			produitsSolaires2 = new Array();
			produitsSolaires2[0] = 'Food<br/>Supplement';
			produitsSolaires2[1] = 'Ultra-Light Body <br>and Face Spray <br/>SPF 50 and 30';
			produitsSolaires2[2] = 'Non-Greasy Sun Stick<br/>SPF 50';
			produitsSolaires2[3] = 'Velvet Body Lotion<br/>SPF 50 and 30';
			produitsSolaires2[4] = 'Fresh After-Sun<br>Pearly Mist';
			produitsSolaires2[5] = 'Velvet After-Sun <br/>Lotion';
			produitsSolaires2[6] = 'After-Sun<br/>Shower Gel';
			produitsSolaires2[7] = 'Lightweight<br/>Self-Tanning Gel';
			produitsSolaires2[8] = 'Light Facial Cream<br/>SPF 30';
			produitsSolaires2[9] = 'Non-Greasy Fluid<br/>SPF 30';
			produitsSolaires2[10] = 'Golden Glow Tinted<br/>Facial Compact SPF 30'; 
			produitsSolaires2[11] = 'Lightweight<br>Self-Tanning Gel';
			produitsSolaires2[12] = 'Self-Tanning Veil';
			produitsSolaires2[13] = 'Anti-ageing Refreshing<br>Cream-Gel After-Sun '
			
			
			//produits solaire3
			//-------------------------------------------------------------------------
			produitsSolaires3 = new Array();
			produitsSolaires3[0] = 'Anti-ageing Refreshing<br>Cream-Gel After-Sun';
			produitsSolaires3[1] = 'Ultra-Light<br>Body and Face Spray <br/>SPF 20';
			produitsSolaires3[2] = 'Light Facial Cream<br/>SPF 20';
			produitsSolaires3[3] = 'Velvet Body Lotion<br/>SPF 20';
			produitsSolaires3[4] = 'Fresh After-Sun<br>Pearly Mist';
			produitsSolaires3[5] = 'Velvet After-Sun <br/>Lotion';
			produitsSolaires3[6] = 'After-Sun<br/>Shower Gel';
			produitsSolaires3[7] = 'Lightweight<br/>Self-Tanning Gel';
			produitsSolaires3[8] = 'Smooth Gel<br/>SPF 15';
			produitsSolaires3[9] = 'Silky Dry Oil<br/>SPF 15';
			produitsSolaires3[10] = 'Refreshing Face<br>Fluid SPF 20';
            produitsSolaires3[11] = 'Anti-ageing Refreshing<br>Cream-Gel After-Sun';
			produitsSolaires3[12] = 'Lightweight<br>Self-Tanning Gel';
			produitsSolaires3[13] = 'Self-Tanning Veil';
            
            //produits solaire4
			//-------------------------------------------------------------------------
			produitsSolaires4 = new Array();
			produitsSolaires4[0] = 'Food<br/>Supplement';
			produitsSolaires4[1] = 'Ultra-Light<br>Body and Face Spray <br/>SPF 10';
			produitsSolaires4[2] = 'Anti-ageing Refreshing<br>Cream-Gel After-Sun';
			produitsSolaires4[3] = 'Fresh After-Sun<br/>Pearly Mist';	
			produitsSolaires4[4] = 'Lightweight<br/>Self-Tanning Gel';
			produitsSolaires4[5] = 'Velvet After-Sun <br/>Lotion';
			produitsSolaires4[6] = 'After-Sun<br/>Shower Gel';
			produitsSolaires4[7] = 'Lightweight<br>Self-Tanning Gel';
			produitsSolaires4[8] = 'Self-Tanning Veil';
		
	
			//produits solaire5
			//-------------------------------------------------------------------------
			produitsSolaires5 = new Array();
			produitsSolaires5[0] = ' Golden Glow Tinted<br>Facial Compact<br>SPF30';
			produitsSolaires5[1] = 'Sparkling Sun<br>Gloss Lips<br>SPF 10';
			produitsSolaires5[2] = 'Multi-shade Bronzing Powder<br>SPF10';			


function openMenu(id){
	
	//sous menu
    if((id.toString()).indexOf(".") != -1 ){
		
		var cut = (id.toString()).split(".");
		var menu = cut[0];
		var smenu = cut[1];
		
		for(j=1; j<3;j++){	
		
			document.getElementById('sMenu' + menu + '.' + j).style.display = 'none';
		
		}
		
		document.getElementById('sousMenu3').style.display = 'block';
		
	    document.getElementById('sMenu' + menu).style.display = 'block';
		document.getElementById('sMenu' + id).style.display = 'block';
		document.getElementById('rub' + menu).className = 'rub'+menu+'On';
		document.getElementById('sRub' + id).className = 'menuItemClick';
	
	}
	
	//menu simple
	else{
		
		if(id==3){
			document.getElementById('sousMenu3').style.display = 'block';
		}
		
		
		document.getElementById('sMenu' + id).style.display = 'block';
		document.getElementById('rub' + id).className = 'rub'+id+'On';
	}
}

function closeMenu(id){
	
	document.getElementById( 'sMenu' + id ).style.display = 'none';
	document.getElementById('sousMenu3').style.display = 'none';
	
	if((id.toString()).indexOf(".") == -1 ){
				
		document.getElementById('rub'+id).className = 'rub'+id;	
		
	}
	else{
		
		document.getElementById('sRub' + id).className = 'menuItem';
		
		
	}
	
	for(i= 1; i < 7 ; i++){
			
		if(i != 4){
			
			document.getElementById( 'sMenu' + i ).style.display = 'none';
		}
	}
}


function ongletInit(){
	window.document.getElementById( "onglet1_txt" ).style.display = "block";
	if ( window.document.getElementById( "onglet2_img" ) != null ){
	window.document.getElementById( "onglet2_txt" ).style.display = "none";
	}
	window.document.getElementById( "onglet3_txt" ).style.display = "none";
	if ( window.document.getElementById( "onglet4_img" ) != null ){
		window.document.getElementById( "onglet4_txt" ).style.display = "none";
	}	
}

function onglet( id, type )
{
	
	

		bt = window.document.getElementById( id + "_img" );
		txt = window.document.getElementById( id + "_txt" );
		
		
		
	
			if ( type == "out" ){
				if ( txt.style.display == "none" || txt.style.display == "undefined" || txt.style.display == "" ){
				
					bt.style.visibility = 'hidden';
				
				}
				
			}else if ( type == "over" ){
				
				bt.style.visibility = 'visible';
				
			}	
	  
	

}

function ongletClick ( id ) {

	bt = window.document.getElementById( id + "_img" );
	txt = window.document.getElementById( id + "_txt" );

	window.document.getElementById( "onglet1_img" ).style.visibility = "hidden";
	
	if ( window.document.getElementById( "onglet2_img" ) != null ){
	window.document.getElementById( "onglet2_img" ).style.visibility = "hidden";
	}
	window.document.getElementById( "onglet3_img" ).style.visibility = "hidden";
	
	if ( window.document.getElementById( "onglet4_img" ) != null ){
		window.document.getElementById( "onglet4_img" ).style.visibility = "hidden";
	}
	
	window.document.getElementById( "onglet1_txt" ).style.display = "none";
	
	
	if ( window.document.getElementById( "onglet2_img" ) != null ){
		window.document.getElementById( "onglet2_txt" ).style.display = "none";
	}
	
	window.document.getElementById( "onglet3_txt" ).style.display = "none";
	
	if ( window.document.getElementById( "onglet4_img" ) != null ){
		window.document.getElementById( "onglet4_txt" ).style.display = "none";
	}
		
	bt.style.visibility = "visible";
	txt.style.display = "block";

}

function navGammeSolaire(id){


	 for(i=1; i<6; i++){
		
		document.getElementById('page' + i).style.display = 'none';  
	
	 }
	   
	document.getElementById('page' + id).style.display = 'block';  
}


// -------------------- Contacts --------------

function visible( obj, v ) {
	obj.style.display = ( v ) ? 'block' : 'none';
}

function checkChars( str_length, max_chars ) {
	return max_chars - str_length;
}

function charsChecker( obj, alertObj, max_chars )
{
	obj.onblur = obj.onkeyup = function()
	{
		var n = checkChars( this.value.length, max_chars );
		
		if ( n < 0 ) {
			alertObj.innerHTML = 'Please remove ' + (-n) + ' chars from your text field.';
		}
		else {
			alertObj.innerHTML = n;
		}
	};
	
	obj.onblur();
}

function isValidEmail( $str )
{ 
	var $isValid = true;
	
	$str = $str + '';
	
	//
	if ($str.indexOf("@") == -1) {
		$isValid = false;
	}
	// 
	var $array = new Array();
	$array = $str.split("@");
	//
	if ( $array.length != 2 )
	{
		$isValid = false;
		return $isValid;
	}
	
	if ($array[0] == "") {
		$isValid = false;
	}
	if ($array[1].indexOf(".") == -1) {
		$isValid = false;
	}
	// 
	var $array2 = new Array();
	$array2 = $array[1].split(".");
	//
	if ($array2[0] == "") {
		$isValid = false;
	}
	if ($array2[1] == "") {
		$isValid = false;
	}
	// 
	return $isValid;
}

function isValidZipCode( str )
{
	var isValid = true;
	
	str = str + '';
	
	if ( str.substr(0,1) == '0' )
	{  
		if ( isNaN( str.substr(1,4) ) ) {
			isValid = false; 
		}
		else
		{
			if ( str.substr(1,4) == '0000' ) {
				isValid = false; 
			}
		}
	}
	else
	{  
		if ( isNaN( str ) ) { 
			isValid = false;
		}
	}
	
	if ( str.length != 5 ) { 
		isValid = false; 
	}
	
	return isValid;
}

function isValidPhone($str)
{

	
	var $isValid = true;
	
	$str = $str + '';
	var $prefix = $str.substr(0,2); 
	
	if ( $prefix != "01" && $prefix != "02" && $prefix != "03" && $prefix != "04" && $prefix != "05" && $prefix != "08" && $prefix != "09") {
		$isValid = false;  
	}
	if ($str.length != 10) { 
		$isValid = false;
	}
	
	return $isValid;
}

function isValidMobile( $str )
{
	
	
	var $isValid = true;
	
	$str = $str + '';
	
	var $prefix = $str.substr(0,2); 
	
	
	if ($prefix != "06") {
		$isValid = false;
	}
	if ($str.length != 10) {
		$isValid = false;
	}
	
	return $isValid;
}

function formatDate( str, separator )
{
	var _ = str;
	
	var _split = str.split( separator );
	
	var s_jj = new String( _split[0] );
	var s_mm = new String( _split[1] );
	var s_aaaa = new String( _split[2] );
	
	var jj = new Number( s_jj );
	var mm = new Number( s_mm );
	
	if ( jj < 10 ) { 
		s_jj = '0' + jj;
	}
	
	if ( mm < 10 ) { 
		s_mm = '0' + mm;
	}
	
	_ = s_jj + separator + s_mm + separator + s_aaaa;
	
	return _;
}

function isValidDate( str, separator )
{
	var $isValid = true;
	
	str = str + '';
	str = formatDate( str, separator );
	
	var _split = str.split( separator );
	
	if ( _split.length != 3 ) {
		$isValid = false;
	}
	else
	{
		if ( (_split[0].length == 2) && (_split[1].length == 2) && (_split[2].length == 4) )
		{
			if ( isNaN( new String(_split[0]) ) || isNaN( new String(_split[1]) ) || isNaN( new String(_split[2]) ) )
			{
				$isValid = false;
			}
			else
			{
				var c1 = new Number( new String(_split[0]) );
				var c2 = new Number( new String(_split[1]) );
				var c3 = new Number( new String(_split[2]) );
				
				if ( c1 > 31 || c2 > 12 ) {
					$isValid = false;
				}
				else 
				{
					var _date = new Date();
				
					_date.setYear( c3 );
					_date.setMonth( c2 - 1 );
					_date.setDate( c1 );
					
					var test_jj = ( _date.getDate() < 10 ) ? '0' + _date.getDate() : _date.getDate();
					var test_mm = ( (_date.getMonth() + 1) < 10 ) ? '0' + (_date.getMonth() + 1) : (_date.getMonth() + 1);
					
					var test_date = test_jj + separator + test_mm + separator + _date.getFullYear();
					
					if ( test_date != str ) {
						$isValid = false;
					}
				}
			}
		}
		else
		{
			$isValid = false;
		}
	}
	
	return $isValid;
}

function checkForm( objs )
{
	 
	
	
	for ( var i = 0; i < objs.length; i++ )
	{ 
		if ( objs[i].type == 'text' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( (objs[i].elt.value.length < 1) || (objs[i].elt.value.length > objs[i]._max) ) 
			{	
				if ( !optional ) 
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
			
			if ( typeof( objs[i]._min ) != 'undefined' )
			{
				if ( objs[i].elt.value.length < objs[i]._min )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
			}
		}
		else if ( objs[i].type == 'checkbox' )
		{
			var n = 0;
			
			for ( var ii = 0; ii < objs[i].elt.length; ii++ )
			{
				if ( objs[i].elt[ii].checked ) {
					n++;
				}
			}
			
			objs[i]._min = ( typeof( objs[i]._min ) == 'undefined' ) ? 0 : objs[i]._min;
			objs[i]._max = ( typeof( objs[i]._max ) == 'undefined' ) ? objs[i].elt.length : objs[i]._max;
			
			if ( (n < objs[i]._min) || (n > objs[i]._max) )
			{
				if ( typeof( objs[i].callback ) != 'undefined' ) {
					objs[i].callback( objs[i] );
				}
				else {
					alert( objs[i].msg );
				}
				
				return false;
			}
		}
		else if ( objs[i].type == 'mail' )
		{ 
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidEmail( objs[i].elt.value ) )
			{
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
		}
		else if ( objs[i].type == 'zipcode' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidZipCode( objs[i].elt.value ) )
			{
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
		}
		else if ( (objs[i].type == 'phone') || (objs[i].type == 'mobile') )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidPhone( objs[i].elt.value ) && !isValidMobile( objs[i].elt.value ) )
			{ 
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {  
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 ) 
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
						
						return false;
					}
				}
			}
		}
		else if ( objs[i].type == 'date' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidDate( objs[i].elt.value, '/' ) )
			{ 
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
						
						return false;
					}
				}
			}
		}
		else if ( objs[i].type == 'noZero' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !optional )
			{
				if ( objs[i].elt.value == '0' )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {  
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
			}
		}else if ( objs[i].type == 'pays' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( objs[i].elt.value == 0 )
			{ 
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
			}
		}
	}
	
	return true;
}



function checkForm2( objs )
{
	for ( var i = 0; i < objs.length; i++ )
	{ 
		if ( objs[i].type == 'text' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( (objs[i].elt.value.length < 1) || (objs[i].elt.value.length > objs[i]._max) ) 
			{	
				if ( !optional ) 
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
			
			if ( typeof( objs[i]._min ) != 'undefined' )
			{
				if ( objs[i].elt.value.length < objs[i]._min )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
			}
		}
		else if ( objs[i].type == 'checkbox' )
		{
			var n = 0;
			
			for ( var ii = 0; ii < objs[i].elt.length; ii++ )
			{
				if ( objs[i].elt[ii].checked ) {
					n++;
				}
			}
			
			objs[i]._min = ( typeof( objs[i]._min ) == 'undefined' ) ? 0 : objs[i]._min;
			objs[i]._max = ( typeof( objs[i]._max ) == 'undefined' ) ? objs[i].elt.length : objs[i]._max;
			
			if ( (n < objs[i]._min) || (n > objs[i]._max) )
			{
				if ( typeof( objs[i].callback ) != 'undefined' ) {
					objs[i].callback( objs[i] );
				}
				else {
					alert( objs[i].msg );
				}
				
				return false;
			}
		}
		else if ( objs[i].type == 'mail' )
		{ 
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidEmail( objs[i].elt.value ) )
			{
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
		}
		
		else if ( objs[i].type == 'zipcode' )
		{
			
			
			
			if(objs[i].elt.value == '' || objs[i].elt.value == 'undefined '){
				return false;
			}
			
			
			/*var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidZipCode( objs[i].elt.value ) )
			{
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
					
						return false;
					}
				}
			}
			*/
		}
		
		else if ( (objs[i].type == 'phone') || (objs[i].type == 'mobile') )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidPhone( objs[i].elt.value ) && !isValidMobile( objs[i].elt.value ) )
			{ 
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {  
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 ) 
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
						
						return false;
					}
				}
			}
		}
		else if ( objs[i].type == 'date' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !isValidDate( objs[i].elt.value, '/' ) )
			{ 
				if ( !optional )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
				else
				{
					if ( objs[i].elt.value.length > 0 )
					{
						if ( typeof( objs[i].callback ) != 'undefined' ) {  
							objs[i].callback( objs[i] );
						}
						else {
							alert( objs[i].msg );
						}
						
						return false;
					}
				}
			}
		}
		else if ( objs[i].type == 'noZero' )
		{
			var optional = false;
			
			if ( typeof( objs[i].optional ) != 'undefined' ) {
				optional = objs[i].optional;
			}
			
			if ( !optional )
			{
				if ( objs[i].elt.value == '0' )
				{
					if ( typeof( objs[i].callback ) != 'undefined' ) {  
						objs[i].callback( objs[i] );
					}
					else {
						alert( objs[i].msg );
					}
					
					return false;
				}
			}
		}
	}
	
	return true;
}



var intV = 0;

function hideMsg( obj )
{
	clearInterval( intV );
	
	visible( obj, false );
}

function affichMsg( container, box, msg )
{
	visible( container, true );
	
	var winY = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
	
	container.style.top = winY + 'px'; 
	box.innerHTML = msg;	
	
	hideMsg_str = 'hideMsg(' + container.id + ')';
	
	intV = setInterval( hideMsg_str, 3000 );
}

function restoreClass( id )
{ 	
	window.document.getElementById('erreur').innerHTML = '';
	
	clearInterval( intV );
	window.document.getElementById( id ).className = 'textField';
}

function highLighted( obj )
{
	window.document.getElementById('erreur').innerHTML = obj.msg;
	
	//obj.elt.className = 'hightLForm'; 
	//intV = setInterval( ('restoreClass(\'' + obj.elt.id + '\')'), 3000 );
}

function similarStr( str1, str2 ) {
	//alert('str1:' + str1 + "str2:"+ str2);
	return (str1 === str2);
}

function checkEmailSim()
{
	var v = similarStr( window.document.getElementById('email').value, window.document.getElementById('confemail').value );
	
	if ( !v ) {
		highLighted( {elt:window.document.getElementById('confemail'),msg:'Vos deux adresses e-mail ne sont pas similaires.'} );
	}
	
	return v;
}

function checkMPSim()
{
	var v = similarStr( window.document.getElementById('mp').value, window.document.getElementById('confmp').value );
	
	if ( !v ) {
		highLighted( {elt:window.document.getElementById('confmp'),msg:'Vos deux adresses e-mail ne sont pas similaires.'} );
	}
	
	return v;
}

/******************************************************** POPUPS ******************************************************/
function getBrowserCodeName()
{
	var name = null;
	
	if ( document.getElementById && !document.all )
	{
		name = 'NS6';
	}
	else if ( document.all )
	{
		name = 'IE';
	}
	else if ( navigator.appName == 'Netscape' && navigator.appVersion.charAt( 0 ) == '4' )
	{
		name = 'NS';
	}
	else if ( navigator.userAgent.indexOf( 'Mac' ) != -1 )
	{
		name = 'MAC';
	}
	
	return name;
}


function detectIE6(){
	var IE6 = false

	var strChUserAgent = navigator.userAgent;
	var intSplitStart = strChUserAgent.indexOf("(",0);
	var intSplitEnd = strChUserAgent.indexOf(")",0);
	var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);

	if(strChMid.indexOf("MSIE 6") != -1) IE6 = true;

	return IE6;
}



function getScrollY() {
  scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}


function affichPopup( nom ){
	
	/*Sous IE6 on masque les listes de formulaires*/
	if ( detectIE6() ){
		
		tags = document.getElementsByTagName( "select" );
	
		for( i=0; i<tags.length; i++ ){
				tags.item( i ).style.visibility = "hidden";
			}
	
	}
		
	maskPage();
	window.document.getElementById( 'mask_page' ).style.display = "block";	
	

	window.document.getElementById( nom ).style.display = "block";
	
}

function closePopup( nom ){
	
	/*Sous IE6 on masque les listes de formulaires*/
	if ( detectIE6() ){
		
		tags = document.getElementsByTagName( "select" );
	
		for( i=0; i<tags.length; i++ ){
				tags.item( i ).style.visibility = "visible";
			}
	
	}
	
	window.document.getElementById( 'mask_page' ).style.display = "none";
	
	window.document.getElementById( nom ).style.display = "none";
	
}


//Init des positions du masque
function maskPage()
{
	var obj = document.getElementById('mask_page').style;
	
	//var winY = document.documentElement.scrollTop;
	var winY = getScrollY();
	var winL = 1024;
	//var winH = document.documentElement.clientHeight;
	var winH = "";
	if ( window.innerHeight ) winH = window.innerHeight;
	if ( document.documentElement ) winH = document.documentElement.clientHeight;
	if ( document.body ) winH = document.body.clientHeight;
	
	if ( getBrowserCodeName() == 'IE' )
	{ 
		obj.width = winL;
		obj.height = winH + winY;
	}
	else if ( getBrowserCodeName() == 'NS6' || getBrowserCodeName() == 'NS' )
	{
		obj.width = winL + 'px';
		obj.height = ( winH + winY ) + 'px';
	}
}


function removeAlt() {

	for ( var i = 0; i< document.images.length; i++ ) 
	{
	
		if ( typeof( document.images[i].alt ) == 'string' ) {
		
		document.images[i].alt = "";
		
		}
	
		if ( typeof( document.images[i].title ) == 'string' ) {
		
		document.images[i].title = "";
		
		}
	
	}

}

