function show(rid) {
    document.getElementById(rid).style.display = "block";
}

function hide(rid) {
    document.getElementById(rid).style.display = "none";
}

function flip(rid) {
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
    document.getElementById(rid).style.display = current;
}

function validation() {
	if (document.step1.author.value == "") {
		alert("Veuillez renseigner un nom d'auteur pour la fiche!");
		return false;
	}
	
	if (document.step1.title.value == "") {
		alert("Veuillez renseigner un titre pour la fiche!");
		return false;
	}
	
	if (document.step1.description.value == "") {
		alert("Veuillez renseigner une description pour la fiche!");
		return false;
	}
}

function deleteFiche() {
	var response = confirm("Êtes-vous sûr de vouloir supprimer DÉFINITIVEMENT cette fiche?");

    if (response);
    else return false;;
}

function wordCut($text, $limit, $msg){
   if (strlen($text) > $limit){
       $txt1 = wordwrap($text, $limit, '[cut]');
       $txt2 = explode('[cut]', $txt1);
       $ourTxt = $txt2[0];
       $finalTxt = $ourTxt.$msg;
   }else{
       $finalTxt = $text;
   }
   return $finalTxt;
}

