if ( q_pagemode() == "edit" ) {
	sn_chooserlist = sn_chooserlist.concat( [ "favorite" ] ) ;// notes spéciales home
	sn_chooserlist_ordered[ "content" ] = sn_chooserlist_ordered[ "content" ].concat( [ "favorite" ] ) ;// notes spéciales home
	decor_fulllist = decor_fulllist.concat( [ "favorite" ] ) ;// notes spéciales home
}

function client_initweb(){
	initweb( true ) ;
	$( "#web_headertable_elem" ).remove();
	
	client_preparesilhouettes();
	client_prepareotherlinks();
	if ( window.logad ) logad() ;
}

function client_qsnartema_init(){
	qsnartema_init( true );
	client_preparesilhouettes();
	if ( currsvcid && currsvcid == "#0#artemapage@intl" ) $("#note_000000134 .pimg_noteimage:eq(0)").css({ width : "991px", "position" : "absolute", "left" : "-34px"})
}

function club_get_logintable() {
	var qlub_message = custom_msgs_fr;
	var s ='<form id="js_authenticate" name="js_authenticate" class="zero" method="post" action="http://localhost/err_nocgi.html" enctype="multipart/form-data" accept-charset="utf-8" onsubmit="jsvalidateauth( handleauthresultopenhomepageorservice ) ; return false ;"><input type="submit" style="position: absolute ; left: -4000px; top: -4000px;display:none;" value="submit"/><div id="club_logindiv" style="padding:5px 20px;"><table cellspacing="0" cellpadding="0" border="0" width="300"><tr><td id="club_logintable_prompt" style="padding-bottom:10px;"/></tr><tr><td><table cellspacing="0" cellpadding="3" border="0" width="100%"><tr><td width="40%" align="right" valign="middle" class="club_login_inputtitle">%loginname</td><td align="left"><input name="canuserid" id="edituserid" type="text" maxlength="100" class="club_login_input" onkeyup="filterinputfm( this ) ; return true" onkeypress="club_verify_login( event );" onmousedown="q_stopPropagation( event )"/></td></tr><tr><td align="right" valign="middle" class="club_login_inputtitle">%loginpassword</td><td align="left"><input name="canpassword" id="editpassword" type="password" maxlength="100" class="club_login_input" onkeypress="club_verify_login( event );" onmousedown="q_stopPropagation( event )"/></td></tr><tr><td colspan="2" align="center" valign="middle" style="padding:10px;"><div class="png club_login_btn" onclick="club_login_submit() ; return false" title="%click2identify" onmousedown="q_stopPropagation( event )">%loginbtn</div></td></tr></table></td></tr><tr><td align="left">%forgottenv2<br/><a href="#" onclick="launchforgottenpw(); return false" style="color:blue;">%forgottenlink</a><br/><br/>%subscribe2quomodo<br/><a href="http://www.quomodo.com/inscription-sport?refererpage=loginblock" style="color:blue;">%subscribe2quomodolink</a></td></tr></table></div></form>' ;
	s = s.replace( /%back/ , qlub_message[ "back" ] );
	s = s.replace( /%logintitle/ , qlub_message[ "logintitle" ] );
	s = s.replace( /%loginname/ , qlub_message[ "loginname" ] );
	s = s.replace( /%loginpassword/ , qlub_message[ "loginpassword" ] );
	s = s.replace( /%loginbtn/ , qlub_message[ "loginbtn" ] );
	s = s.replace( /%login/ , qlub_message[ "login" ] );
	s = s.replace( /%forgottenlink/ , qlub_message[ "forgottenlink" ] );
	s = s.replace( /%forgottenv2/ , qlub_message[ "forgottenv2" ] );
	s = s.replace( /%click2identify/ , qlub_message[ "click2identify" ] );
	s = s.replace( /%subscribe2spacelink/ , qlub_message[ "subscribe2spacelink" ] );
	s = s.replace( /%subscribe2spacev2/ , qlub_message[ "subscribe2spacev2" ] );
	s = s.replace( /%subscribe2quomodolink/ , qlub_message[ "subscribe2quomodolink" ] );
	s = s.replace( /%subscribe2quomodo/ , qlub_message[ "subscribe2quomodo" ] );
	return s ;
}

var custom_msgs_fr = { 
	"login" : "Connectez-vous à votre site",
	"logintitle" : "Cliquez pour fermer le panneau de connexion",
	"loginname" : "Identifiant : " ,
	"loginpassword" : "Mot de passe : " ,
	"loginbtn" : "Connexion",
	"forgotten" : "oublié" ,
	"forgottenv2" : "Vous avez oublié vos identifiants ?" ,
	"forgottenlink" : "Cliquez ici pour les recevoir par e-mail." ,
	"click2identify" : "Cliquez pour vous authentifier" ,
	"subscribe2space" : "Vous n'êtes pas membre du site ? Cliquez ici pour vous inscrire." ,
	"subscribe2spacev2" : "Vous n'êtes pas encore membre du site ?",
	"subscribe2spacelink" : "Cliquez ici pour vous inscrire.",
	"subscribe2quomodo" : "Vous voulez vous aussi créer un site Internet ?",
	"subscribe2quomodolink" : "Créer un site Quomodo."
} ;

function qsn_getcontainertemplate( container ) { //container : pour l'instant : le mode edit ou view
	var mode =  container ;
	var containerid = "qsnelem_containertemplate" + ( ( mode == "edit" ) ? "_edit" : "" ) ;
	if ( ge( containerid ) ) return ge( containerid ) ;
	var divtemplates = ge( "qsnelem_container_templates" ) ;
	if ( ! divtemplates ) {
		divtemplates = document.createElement( "DIV" ) ;
		divtemplates.id = "qsnelem_container_templates" ;
		ge( "q_author_stuff" ).appendChild( divtemplates ) ;
	}
	var div = document.createElement( "DIV" ) ;
	div.className = "note" ; // vh : pour que le template dégage lors de la webbisation
	if ( mode == "edit" ) {
		div.innerHTML = '<table id="' + containerid + '" class="note stickynote qsn_note container qmc1 bg_self__noteborder_self__isdark_self__text_bw" style="top: -2000px ; left : -2000px" onmousedown="qsn_beginDrag( this , event )" cellspacing="0" cellpadding="0"><tr><td><div class="richtarget notetoolbarholder" style="position : relative ; top : 0px ; left : 0px"><div class="qlubcontainer_secorner"></div><table width="100%" cellspacing="0" cellpadding="0" style="position : relative ; top : 0px ; left : 0px"><tr><td><table class="qlubcontainer_noteheader qmc2_qmc1 bg_self__text_bw" width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td class="qmc3 headericon" valign="top"></td><td align="left"><div class="qlubcontainer_headerbckg"><textarea type="text" class="qlubcontainer_headertext qmc2_qmc1 bg_self__text_bw" value="" onmousedown="q_stopPropagation( event )" onfocus="qsn_container_focusdefault( this ); " onblur="qsn_container_blurdefault( this ); " ></textarea></div><div class="qlubcontainer_headermeasure"></div></td></tr></table></td></tr><tr><td align="left" class="qlubcontainer_content"></td></tr></table></div></td></tr><tr><td align="center"><div style="position:relative ; height : 36px"><table class="cancelokelem" cellspacing="0" cellpadding="0" border="0" style="padding: 8px 0px ; position : absolute ; top : 0px ; left : 0px"><tr><td align="right"><div class="cancelokbtn btnbtn" onmousedown="q_stopPropagation( event )" onmouseover="q_mouseoverbutton( this ); this.style.color=\'#FFF\'" onmouseout="q_mouseoutbutton( this ); this.style.color=\'#333\'" onclick="qsn_canceledit( false, this ) ; return false;" style="position :relative ; overflow:hidden"><div class="divimg" style="position : absolute ; top:0px;left:0px;"></div><div class="divtxt" style="position : absolute ; top:0px;left:0px;">' + qsn_message[ "cancel" ] + '</div></div></td><td width="25"></td><td align="left"><div class="cancelokbtn btnbtn" onmousedown="q_stopPropagation( event )" onmouseover="q_mouseoverbutton( this ); this.style.color=\'#FFF\'" onmouseout="q_mouseoutbutton( this ); this.style.color=\'#333\'" onclick="qsn_saveedit() ; return false;" style="position :relative ; overflow:hidden"><div class="divimg" style="position : absolute ; top:0px;left:0px; "></div><div class="divtxt" style="position : absolute ; top:0px;left:0px; ">' + qsn_message[ "ok" ] + '</div></div></td></tr></table></div></td></tr></table>' ;
	} else {
		div.innerHTML = '<table id="' + containerid + '" class="note stickynote qsn_note container qmc1 bg_self__isdark_self__text_bw qmc2_qmc1 bd_self" style="top: -2000px ; left : -2000px;" onmouseover="qsn_mouseover( this , event )" onmouseout="qsn_mouseout( this , event )" onmousedown="qsn_beginDrag( this , event )" cellspacing="0" cellpadding="0"><tr><td><div class="notetoolbarholder" style="position : relative ; top : 0px ; left : 0px ; z-index : 1"></div><div class="richtarget" style="position : relative ; top : 0px ; left : 0px"><div class="qlubcontainer_secorner"></div><table width="100%" cellspacing="0" cellpadding="0" border="0" style="position : relative ; top : 0px ; left : 0px"><tr><td><table class="qlubcontainer_noteheader qmc2_qmc1 bg_self__text_bw" width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td class="qmc3 headericon" valign="top"></td><td align="left"><div class="qlubcontainer_headerbckg"><h3 class="qlubcontainer_headertext"></h3></div></td></tr></table></td></tr><tr><td align="left" class="qlubcontainer_content"></td></tr><tr><td align="right" class="qlubcontainer_signature qmc1 text_contrast150">Quomodo</td></tr></table></div></td></tr></table>' ;
	}
	divtemplates.appendChild( div ) ;
	return ge( containerid ) ;
}

function client_container_renderhtml( div , r ) {
	qsn_container_renderhtml( div , r , true ) ;
	if ( ! r.header || r.header.display != "true" ) div.style.borderStyle = "none" ;
}

function client_preparesilhouettes(){
	$( "#home_silhouettes td.link" )
		.hover( function( event ){ 
			$( this ) // Case
				.css( "color" , ( event.type == "mouseenter" ) ? "white" : "#1E3B7E" )
				.toggleClass( "fond_fonce", ( event.type == "mouseenter" ) );
			
			$( "a", this ).css( "color" , ( event.type == "mouseenter" ) ? "white" : "#1E3B7E" ); // Lien
			$( "a .clubcolorc21, a .ex-clubcolorc21", this )
				.toggleClass( "clubcolorc21", ( event.type != "mouseenter" ) )
				.toggleClass( "ex-clubcolorc21", ( event.type == "mouseenter" ) );
						
			var img = $( ".home_silhouette", this ).get( 0 ); // Image
			img.className = ( event.type == "mouseenter" ) ? img.className.replace( "_blue_", "_white_" ) : img.className.replace( "_white_", "_blue_" ); 
		} )
		.one( "click", function(){ $( "a", this ).click(); } );
}

function client_prepareotherlinks(){
	$( "#home_otherlinks tr" )
		.hover( function( event ){ 
			$( this ).toggleClass( "fond_fonce", ( event.type == "mouseenter" ) );
			$( "a", this )
				.css( { 
					"color" : ( ( event.type == "mouseenter" ) ? "white" : "blue" ),
					"text-decoration" : ( ( event.type == "mouseenter" ) ? "underline" : "none" )
				} );
		} );
}
