
function Toggle(item) {
   visible=($(item).style.display!="none")
   if (visible) {
     $(item).style.display="none";
   } else {
     $(item).style.display="block";
   } 
}

function Expand() {
   divs=$("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
   }
}

function Collapse() {
   divs=$("DIV");
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
   }
}



function toggleMenu ( itemId ) {
        var item = $( itemId + "Menu" );
        if ( item.style.display != "none" ) {
          item.style.display = "none";
        } else {
          item.style.display = "block";
        }
}
      
function toggleSearch() {
        var searchForm = $( "fullSearch" );
        var videoList = $( "list" );
        
        if ( searchForm.style.display != "block" ) {
          if ($( "noResult" )) $( "noResult" ).style.display = "none";
          searchForm.style.display = "block";
          videoList.style.display = "none";
        } else {
         if ($( "noResult" )) $( "noResult" ).style.display = "block";
          searchForm.style.display = "none";
          videoList.style.display = "block";
        }
}

function EcrireCookie(nom, valeur){
	var argv = EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}

function goURL(daURL) {
    window.open(daURL,"","toolbar=0,status=0,scrollbars=1,resizable=0,menubar=0,width=800, height=600left=400,top=300");
}

function checkEn( select ) {
  if ( select.value == "en" ) {
    alert("Not yet available.");
    return false;
  } else  {
    return true;
  }
}
//////////////////////////////////////
function togglePartenaires( disp ) {
            if (disp == "none") {
              $('partenaires').style.display = "none";
            } else {
              $('partenaires').style.display = "block";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('help').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";	
			  $('sendVideo').style.display = "none";
            }
}


function toggleFaq( disp ) {       			
            if (disp == "none") {
              $('faq').style.display = "none";
            } else {
			  $('faq').style.display = "block";
              $('partenaires').style.display = "none";
              $('help').style.display = "none";
              $('qui').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";
			  $('sendVideo').style.display = "none";
            }
}
          
function toggleQui( disp ) {                    
            if (disp == "none") {
              $('qui').style.display = "none";
            } else {
              $('qui').style.display = "block";
              $('partenaires').style.display = "none";
              $('help').style.display = "none";
              $('faq').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";
			  $('sendVideo').style.display = "none";			  
            }
}

function toggleHelp( disp ) {          
            if (disp == "none") {
              $('help').style.display = "none";
            } else {
              $('help').style.display = "block";
              $('partenaires').style.display = "none";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";
			  $('sendVideo').style.display = "none";			  
            }
}

function toggleMail( disp ) {         
            if (disp == "none") {
              $('mail').style.display = "none";
            } else {
              $('mail').style.display = "block";
              $('partenaires').style.display = "none";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('help').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";	
			  $('sendVideo').style.display = "none";				  
            }
}	
          	
function toggleCredit( disp ) {          
            if (disp == "none") {
              $('credit').style.display = "none";
            } else {
              $('credit').style.display = "block";
              $('partenaires').style.display = "none";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('help').style.display = "none";
			  $('mail').style.display = "none";
			  $('contact').style.display = "none";	
			  $('sendVideo').style.display = "none";				  
            }
}	
          
function toggleContact( disp ) {          
            if (disp == "none") {
              $('contact').style.display = "none";
            } else {
              $('contact').style.display = "block";
              $('partenaires').style.display = "none";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('help').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";	
			  $('sendVideo').style.display = "none";				  
            }
}
          	
function toggleSendVideo( disp ) {
          
            if (disp == "none") {
              $('sendVideo').style.display = "none";
            } else {
              $('sendVideo').style.display = "block";
			  $('partenaires').style.display = "none";
              $('faq').style.display = "none";
              $('qui').style.display = "none";
			  $('help').style.display = "none";
			  $('mail').style.display = "none";
			  $('credit').style.display = "none";
			  $('contact').style.display = "none";	
			  if ($('iframe_login').src == "") $('iframe_login').src = "/web/login.php";				  
            }
}	
                  
function checkSendMail(form) {
			if ( form.eMailDestination.value == "") {
					alert("Saisissez un destinataire !  SVP")
					form.eMailDestination.focus()
					form.eMailDestination.select()
					return false
			}
			form.submit.disabled="disabled"
			$("message").style.display = "block";
			$("message").innerHTML = "Envoi mail en cours ....";			
			return true		  
}

function checkSendContact(form) {
			if ( form.message.value == "") {
					alert("Saisissez une message!  SVP")
					form.message.focus()
					form.message.select()
					return false
			}
			form.submit.disabled="disabled"
			$("message_contact").style.display = "block";
			$("message_contact").innerHTML = "Envoi mail en cours ....";			
			return true		  
}
function checkSearch(form) {
        if ( form.key_word.value == "") {
                alert("Saisissez un mot clé!  SVP")
                form.key_word.focus()
                form.key_word.select()
                return false
        }
        return true
}

function showQuiz( id ) {
            if (parseInt(id) == 1) {
              $('quizzDiv').innerHTML = "<h3>Quiz 1&nbsp;&nbsp;| &nbsp;&nbsp;<a href='javascript:showQuiz(2);return false;'>quizz 'SauF' : Sciences au Féminin</a></h3><br /><iframe width='800' height='600' frameborder='0' scrolling='no' src='http://www.physifolies.fr/quizz/quizz.swf'>";
            } else if (parseInt(id) == 2) {
             $('quizzDiv').innerHTML = "<h3><a href='javascript:showQuiz(1);return false;'>Quiz</a> 1&nbsp;&nbsp;| &nbsp;&nbsp;quizz 'SauF' : Sciences au Féminin</h3><br /><iframe width='800' height='625' frameborder='0' scrolling='no' src='http://www.tvsciences.com/web/quiz/SauF/SauF.swf'>";
            }
}