function showme(idshow,cat)
{
	// test si pas de catégories 
	if ( cat == undefined )
	{
		idmenu = idshow;
		cat = '';
	}
	else
	{
		idmenu = idshow+'-'+cat;
		cat='&categorie='+cat;
	}
	$('pagin').innerHTML = '<img src="img/ajax-loader.gif" alt="Page en chargement" />';
	var options = { method: "post",evalScripts:true }
	var ajaxCall = new Ajax.Updater("pagin", "tpl/cv-page-"+idshow+".php?mode=js"+cat, options);

	// menu actif
	for (i=0; i<(tab_id.length - 1); i++) {
		$(tab_id[i]).className = "lien_menu_on";
	}
	$(idmenu).className = "lien_menu_off";
}

function hideme(divid)
{
	$(divid).style.display = "none";
}

function showsavoir(idshow,idhide1,idhide2,idhide3,idhide4,idhide5,idhide6){
	if ($(idshow).style.display == "block") {
		$(idshow).style.display = "none" ;
	} else {
		hideme(idhide1);
		hideme(idhide2);
		hideme(idhide3);
		hideme(idhide4);
		hideme(idhide5);
		hideme(idhide6);
		$(idshow).style.display = "block" ;
	}
}

function validform() {
	var control_color = '1px solid #edb5b5';
	var control_color_ok = '1px solid #dcdcd8';
	var control = true;
	var mess='...';
	
	// initialise couleur des champs
	$('nom').style.border = control_color_ok;
	$('prenom').style.border = control_color_ok;
	$('email').style.border = control_color_ok;
	$('contenu').style.border = control_color_ok;

	// si Nom invalide
	if ( $('nom').value == '')
	{
		control = false;
		$('nom').style.border = control_color;
	}
	if ( $('prenom').value == '')
	{
		control = false;
		$('prenom').style.border = control_color;
	}
	if (!verifierMail($('email')) ){
		control = false;
		$('email').style.border = control_color;		
	}
	if ( $('contenu').value == '')
	{
		control = false;
		$('contenu').style.border = control_color;
	}
	
	var mess='Avez-vous correctement rempli les champs obligatoires ?<p>&nbsp;</p>';
	
	if ( control )
	{
		document.formcontact.submit();
		return;
	}
	
	$('contact_message').innerHTML = mess;
	
}

function verifierMail(champ) {
	var str = champ.value;
	var regexp = new RegExp("^[a-zA-Z0-9_\\-\\.]{3,}@[a-zA-Z0-9\\-_]{2,}\\.[a-zA-Z]{2,4}$", "g");

	if(!regexp.test(str)) {
		return false;
	}
	return true;
}


function compnav()
{
	/*document.body.style.overflow = "scroll";*/
	if (navigator.appName == 'Microsoft Internet Explorer')
	{ 
     	if (navigator.appVersion == '4.0 (compatible; MSIE 6.0; Windows NT 5.1)') 
  		{ 
			$(page).style.padding = "0px";
			$(pagin).style.left = "10px";
			$(pagin).style.top = "5px";
  		}
	}
	// modif feuille de style
	/*
	var link = document.createElement('link');
	link.href='css/style_cv_accueil_js.css';
	link.type='text/css';link.rel='stylesheet';
	document.getElementsByTagName('head')[0].appendChild(link);
	*/
	/*crossRules= (document.styleSheets[0].cssRules)?document.styleSheets[0].cssRules:document.styleSheets[0].rules;
	var i = 0;
	while(crossRules[i])
	{
		if(crossRules[i].selectorText=='.savoir')
		{
			crossRules[i].style.display='block';
		}
		else if(crossRules[i].selectorText=='.savoirtxt')
		{
			crossRules[i].style.display='none';
			crossRules[i].style.overflow='visible';
		}

		i++;
	}*/
}

function is_ie6()
{
	if  ((navigator.appName == 'Microsoft Internet Explorer') && ( typeof document.body.style.maxHeight == "undefined" )  )
  	{ 
		return true;
  	}
	else	
	{
		return false;
	} 
	
}

function monEffet(idshow)
{
	if  (is_ie6())
  	{ 
		if ($(idshow).style.display == 'none') 
		{
			$(idshow).style.display= 'block';
		} else {
			$(idshow).style.display= 'none';
		}
  	}
	else	
	{
		var mon_Effet = new Effect.toggle(idshow,'slide');

	} 
	
}
