// JavaScript Document
$(document).ready(function() {
  
  ShowMenu.attrConst();

  
});

var ShowMenu = {
    h: 0,
    c:0,
    d:0,
    e:0,
    f:0,
    
    attrConst:function() {
      this.c = $("#conteneur").height();
      this.e = $("#footer").innerHeight();
      this.f = $("#footer").innerHeight() - $("#footer").height();
      this.init();
    },
    
    init:function() {
      
       this.h = ( window.innerHeight ) ? window.innerHeight : document.documentElement.clientHeight;
       	//			document.title= 'this.c = '+ this.c + ' this.h '+ this.h + ' // - ( this.c + this.f)='+( this.c + this.f) + " // " + this.h;
       this.d = this.c;
       if ( ( this.c + this.f) < this.h ) {
       		this.d = this.h - this.c;       
          $("#conteneur").height( this.h );
          $("#global").height( this.h );  
          if ($.browser.msie) {			 	
				 		$("#footer").css({float: 'none', position: 'absolute', bottom: '0px'} );
					} else {
				   	$("#footer").css({marginTop: this.d +'px'});
					}
       }
				if ( this.d  < this.c ) {
					 $("#sntpri-band").css({'height':this.h-8});
				} else {
				   $("#sntpri-band").css({'height':this.d-8});
				}
    }
}

onresize = function() {
  ShowMenu.init();
}

var ProgressivBg = {

    tg:0,
    tspan:0,
    
    init:function(fTarget) {
			this.attrItem([
				{a_name: 'accueil', 		spanName:'sp_accueil'},
				{a_name: 'lire', 				spanName:'sp_lire'},
				{a_name: 'signer', 			spanName:'sp_signer'},
				{a_name: 'signataires', spanName:'sp_signataires'},
				{a_name: 'contact', 		spanName:'sp_contact'},
				{a_name: 'documents',   spanName:'sp_documents'}
			], fTarget)
		},
    
    attrItem:function(fP, fTarget) {
			for ( i= 0 ; i < fP.length ; i++ ) {
				if (fP[i].a_name != fTarget) {
					$("."+fP[i].spanName).css({opacity:0});
					$("."+fP[i].a_name).mouseover(function(fSpan){ return(function(){ $("."+fSpan).stop(); $("."+fSpan).animate({opacity: 1},200); });}(fP[i].spanName));
					$("."+fP[i].a_name).mouseout(function(fSpan){  return(function(){ $("."+fSpan).stop(); $("."+fSpan).animate({opacity: 0},150) });}(fP[i].spanName));
				} else {
					$(".sp_"+fTarget).css({opacity: 1});
					$("."+fTarget).css({color: '#B10015'});
				}
    	}
    }
}



