﻿//menu
function montre(id) {
 var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;

	for (var i = 0; i<=100; i++) {
	    j = i + 1;
	    if (document.getElementById('sous_menu'+i)) {
		    if (document.getElementById(id)==document.getElementById('sous_menu'+i)){
		            document.getElementById('sous_menu'+i).style.display='block';
		           
		           var mtop = ((j-1)*38)-((j-1)*2)+5;
		           
		           if(IE6==true) mtop -= (4 + (j-1)*3);
		           
		           document.getElementById('sous_menu'+i).style.marginTop=mtop+"px";
		        }
		        else{
		            document.getElementById('sous_menu'+i).style.display='none';
		        }
		     }
	}
}

function displayField(){
	    
	    
	    
	    
	
	}


//Expand - Collapse
$(document).ready(function(){
 
    var nbrElt = $(".expand p a").length;

    $(".expand p a").click(show);
    
    function show() {
        var id = $(this).attr("id");
        
        for (var i=1; i <= nbrElt ; i++) {
            if (id != i) {
                $("#"+i).attr("class","TopPlus");
                $("#sub"+i).css("display","none");
            }
        }
        
        //change image
        if ($(this).attr("class") == "TopPlus")
            $(this).attr("class","TopMoins");
        else
            $(this).attr("class","TopPlus");            
        
        $("#sub"+id).toggle();
    }
    
    //generate class for table
	if ($("#CentralContent table").attr("class") != "none") {
		if ($("#CentralContent table").get() != "") {
		
			$("#CentralContent table").each(function(i) {
				var nbrTd = $("#CentralContent table:eq("+i+") tbody tr:first td").length;
				if ($(this).attr("class") == "" || $(this).attr("class") == undefined) {
					$("#CentralContent table tbody:eq("+i+")").before("<thead></thead>");
					
					$("#CentralContent table:eq("+i+")").attr("class","roundedTable");
					
					if (nbrTd == 1) {
						$("#CentralContent table:eq("+i+") tbody tr:first td").attr("class","top");
						$("#CentralContent table:eq("+i+") tbody tr:first td").attr("align","center");
					}
					else {
						$("#CentralContent table:eq("+i+") tbody tr:first td:first").attr("class","topLeft");
						$("#CentralContent table:eq("+i+") tbody tr:first td:first").attr("align","center");
						
						$("#CentralContent table:eq("+i+") tbody tr:first td:last").attr("class","topRight");
						$("#CentralContent table:eq("+i+") tbody tr:first td:last").attr("align","center");
					}
					
					
					$("#CentralContent table:eq("+i+") tbody tr:first").attr("align","center");
					
					$("#CentralContent table:eq("+i+") tbody tr:last td:first").attr("class","bottomLeft");
					$("#CentralContent table:eq("+i+") tbody tr:last td:last").attr("class","bottomRight");
					
					$("#CentralContent table thead:eq("+i+")").append($("#CentralContent table:eq("+i+") tbody tr:first"));
				}
			});
		}
	}
	
	 $("#forgotPassword").toggle(
          function () {
           
            $("#forgotEmail").show("slow");
         
                     
          },
          function () {
           
            $("#forgotEmail").hide("slow");
            
           
          }
        );
		
});
