	// ELEMENT HEIGHT CHANGE
	function setHeight(el, mod, start_value, end_value) {
		interval = 30;
		el.style.height = start_value + "px";

		if (el.setHeight) {
			clearInterval(el.setHeight);
		}
		el.setHeight = setInterval(function() {
			elementHeight = parseInt(el.style.height.replace("px", ""));
			if (Math.abs(end_value * 100 - elementHeight * 100) / 100 < 0.01) {
				el.style.height = end_value + "px";
				clearInterval(el.setHeight);
				return true;
			} else {
				el.style.height = (elementHeight + (end_value - elementHeight) * mod) + "px";
			}
		}, interval);
	}
	// FIN ELEMENT HEIGHT CHANGE

	// ELEMENT WIDTH CHANGE
	function setWidth(el, mod, start_value, end_value) {
		interval = 30;
		el.style.width = start_value + "px";

		if (el.setWidth) {
			clearInterval(el.setWidth);
		}
		el.setWidth = setInterval(function() {
			elementWidth = parseInt(el.style.width.replace("px", ""));
			if (Math.abs(end_value * 100 - elementWidth * 100) / 100 < 0.01) {
				el.style.width = end_value + "px";
				clearInterval(el.setWidth);
				return true;
			} else {
				el.style.width = (elementWidth + (end_value - elementWidth) * mod) + "px";

			}
		}, interval);
	}
	// FIN ELEMENT WIDTH CHANGE

	function size(id,max,pas,start,offset){
		if(offset == null)
			offset = 1;
		if(start == null)
			start = 0;
		var obj = document.getElementById(id);
		var larg=parseInt(obj.style.width.split('px'));
		larg=parseInt(larg+pas);
		if((larg+pas) >= max)
			larg= max;
		if((larg+pas) <=0 )
			larg= 0;
		setWidth(obj, offset, start, larg);
	}

	function sizeV2(classe,max,pas,start,offset){
		if(offset == null)
			offset = 1;
		if(start == null)
			start = 0;
		//var obj = document.getElementById(id);
		var obj = getElementsByClassName(document, "div", classe)[0];
		var larg=parseInt(obj.style.width.split('px'));
		larg=parseInt(larg+pas);
		if((larg+pas) >= max)
			larg= max;
		if((larg+pas) <=0 )
			larg= 0;
		setWidth(obj, offset, start, larg);
	}

	function deployH(oElm,multiple){
		oElm.parentNode.style.height=parseInt(oElm.firstChild.style.height.split('px'))*multiple+'px';
	}
	function deployW(oElm,multiple){
		oElm.parentNode.style.width=parseInt(oElm.firstChild.style.width.split('px'))*multiple+'px';
	}
	function swapDeployH(oElm,multiple){
		var height_IMG = parseInt(oElm.firstChild.style.height.split('px'));
		var height_LI = parseInt(oElm.parentNode.style.height.split('px'));
		var to = height_IMG*multiple;

		if(!height_LI){
			height_LI = height_IMG;
		}
		if( height_LI == height_IMG )
		{
			oElm.parentNode.style.height=(height_IMG*multiple)+'px';
		}else{
			oElm.parentNode.style.height=(height_LI/multiple)+'px';
		}
	}


	function deployHV2(oElm,multiple){
		oElm.parentNode.style.height=parseInt(oElm.parentNode.firstChild.firstChild.style.height.split('px'))*multiple+'px';
	}
	function deployWV2(oElm,multiple){
		oElm.parentNode.style.width=parseInt(oElm.parentNode.firstChild.firstChild.style.width.split('px'))*multiple+'px';
	}

	function deployHH(oElm,haut){
		oElm.parentNode.style.height=parseInt(oElm.firstChild.style.height.split('px'))+haut+'px';
	}
	function deployWW(oElm,larg){
		oElm.parentNode.style.width=parseInt(oElm.firstChild.style.width.split('px'))+larg+'px';
	}
	function swapClasse(oElm, classe1, classe2){
		if(oElm.className == classe2){
			oElm.className = classe1;
		}else{
			oElm.className = classe2;
		}
	}

	// SCRIPT AFFICHE LE BLOC SELECTIONNE
	function show(id){
		var contentObj = document.getElementById(id);
		if (contentObj != null){
			var state = contentObj.style.display;
			contentObj.style.display='block';
		}
	}
	// FIN SCRIPT AFFICHE LE BLOC SELECTIONNE

	// SCRIPT AFFICHE LE BLOC SELECTIONNE
	function hide(id){
		var contentObj = document.getElementById(id);
		if (contentObj != null){
			var state = contentObj.style.display;
			contentObj.style.display='none';
		}
	}
	// FIN SCRIPT AFFICHE LE BLOC SELECTIONNE

	// SCRIPT CACHE TOUS LES BLOCS
	function hideAll(prefixID,tot){
		for(var i=1; i<=tot; i++){
			var contentObj = document.getElementById(prefixID+i);
			if (contentObj != null){
				var state = contentObj.style.display;
				contentObj.style.display='none';
			}
		}
	}
	// FIN SCRIPT CACHE TOUS LES BLOCS

	// SCRIPT AJOUT SUPPRESSION DE CLASSES
	function addClassName(oElm,strClass) {
		oElm.className = oElm.ClassName != '' ? oElm.className+' '+strClass : strClass;
	}

	function removeClassName(oElm,strClass){
		var regex = new RegExp(" "+strClass+"|"+strClass+" |"+strClass);

		var str = oElm.className;
		var reg = new RegExp(strClass);

		if (reg.test(str))
			oElm.className = oElm.className.replace(regex, "");
	}

	function swapClassName(oElm,strClass1,strClass2){
		removeClassName(oElm,strClass1);
		removeClassName(oElm,strClass2);
		addClassName(oElm,strClass2);
	}
	// FIN SCRIPT AJOUT SUPPRESSION DE CLASSES

	// GETELEMENTSBYCLASSNAME
	function getElementsByClassName(oElm, strTagName, strClassName){
	    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	    var arrReturnElements = new Array();
	    strClassName = strClassName.replace(/\-/g, "\\-");
	    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	    var oElement;
	    for(var i=0; i<arrElements.length; i++){
	        oElement = arrElements[i];
	        if(oRegExp.test(oElement.className)){
	            arrReturnElements.push(oElement);
	        }
	    }
	    return (arrReturnElements)
	}
	// FIN GETELEMENTSBYCLASSNAME

	// SHORTCUT GETELEMENTSBYCLASSNAME
	function gEbC(strClassName){
		return getElementsByClassName(document, "div", strClassName)[0];
	}
	// FIN SHORTCUT GETELEMENTSBYCLASSNAME

	// SCRIPT DE MENUARTICLE DU MENU HAUT DE LA HP
	function MenuArticle(id,node,classNode,classOn,classOff){
		if(document.getElementById(id))
		{
			var mylist=document.getElementById(id);
			//var listitems= mylist.getElementsByTagName(node);
			var listitems= getElementsByClassName(mylist, "div", classNode);
			var lng = listitems.length;
			var reg = new RegExp(classOn);

			for (i=0; i<lng; i++){

				listitems[i].onclick = function(){
					var arr = this.className.split(" ");
					for (j=0; j<lng; j++){
						if (reg.test(listitems[j].className)){
							listitems[j].className = arr[0]+' '+classOff;

							// pb sous FF
							// this.firstChild.nodeName renvoie #text au lieu de A
							if(this.firstChild.nodeName == "#text"){
								var arr2 = this.firstChild.nextSibling.className.split(" ");
								listitems[j].firstChild.nextSibling.className = arr2[0]+' '+classOff;
							}
							else{
								var arr2 = this.firstChild.className.split(" ");
								listitems[j].firstChild.className = arr2[0]+' '+classOff;
							}
						}
					}
					this.className = arr[0]+' '+classOn;

					// pb sous FF
					// this.firstChild.nodeName renvoie #text au lieu de A
					if(this.firstChild.nodeName == "#text")
						this.firstChild.nextSibling.className = arr2[0]+' '+classOn;
					else
						this.firstChild.className = arr2[0]+' '+classOn;
				}
			}
		}
	}
	// FIN SCRIPT DE MENUARTICLE DU MENU HAUT DE LA HP

	function getElementsByClass(searchClass, node, tag) {
		var classElements = new Array();
		if ( node == null )
			node = document;
		if ( tag == null )
			tag = '*';
		var els = node.getElementsByTagName(tag);
		var elsLen = els.length;
		var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
		for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}

	var size =  new Array();
	size[0] = '1';
	size[1] = '1.2';
	size[2] = '1.4';

	var lng = size.length;
	var zi = 0;
	zi = 0;

	function tailleFonte(classe, taille) {
		cibles = getElementsByClass(classe);
		for(var xi = 0; xi < cibles.length; xi++) {
			cibles[xi].style.fontSize = "100%";
		}
		if(taille) {
			zi++;
			document.getElementById("moins").style.display = 'block';
			if (zi == lng - 1){
				document.getElementById("plus").style.display = 'none';
			}
		} else {
			zi--;
			document.getElementById("plus").style.display = 'block';
			if (zi == 0) {
				document.getElementById("moins").style.display = 'none';
			}
		}
		for (zj=0; zj < cibles.length; zj++) {
			cibles[zj].style.fontSize = parseInt(cibles[zj].style.fontSize.split('%'))*size[zi]+'%';
		}
	}

	function habillage(bodyBGColor, bodyBGImg, bodyBGImgRepeat, bodyBGImgPosition, DossierBGColor, contentBGColor, contentBGImg, contentBGImgRepeat, contentBGImgPosition, id){
		//alert("habillage pas IE6");
		var bodyBG ="";
		var contentBG ="";

		if(bodyBGColor != ""){
			bodyBG = bodyBGColor;
			document.body.style.background = bodyBG+"";
		}
		if(bodyBGImg != ""){
			bodyBG = bodyBG+" url("+bodyBGImg+")";
			if(bodyBGImgRepeat !="")
				bodyBG = bodyBG+" "+bodyBGImgRepeat;
			if(bodyBGImgPosition !="")
				bodyBG = bodyBG+" "+bodyBGImgPosition;
			document.body.style.background = bodyBG+"";
		}

		if(contentBGColor != ""){
			contentBG = contentBGColor;
			document.getElementById(id).style.background = contentBG+"";
		}
		if(contentBGImg != ""){
			contentBG = contentBG+" url("+contentBGImg+")";
			if(contentBGImgRepeat !="")
				contentBG = contentBG+" "+contentBGImgRepeat;
			if(contentBGImgPosition !="")
				contentBG = contentBG+" "+contentBGImgPosition;
			document.getElementById(id).style.background = contentBG+"";
		}

		//bloc_dossier .blocPlein .bloc_article
		var bloc_dossier = getElementsByClassName(document, "div", "bloc_dossier");
		for(i=0;i<bloc_dossier.length;i++){
			var c_bloc_dossier = bloc_dossier[i].childNodes;
			for(j=0;j<c_bloc_dossier.length;j++){
				var reg = new RegExp("bloc_article");
				if (reg.test(c_bloc_dossier[j].className)){
					c_bloc_dossier[j].style.background = DossierBGColor;
				}
			}
		}
	}

	function addDOMLoadEvent(func) {
	   if (!window.__load_events) {
	      var init = function () {
	          // quit if this function has already been called
	          if (arguments.callee.done) return;

	          // flag this function so we don't do the same thing twice
	          arguments.callee.done = true;

	          // kill the timer
	          if (window.__load_timer) {
	              clearInterval(window.__load_timer);
	              window.__load_timer = null;
	          }

	          // execute each function in the stack in the order they were added
	          for (var i=0;i < window.__load_events.length;i++) {
	              window.__load_events[i]();
	          }
	          window.__load_events = null;

	          // clean up the __ie_onload event
	          /*@cc_on @*/
	          /*@if (@_win32)
	              document.getElementById("__ie_onload").onreadystatechange = "";
	          /*@end @*/
	      };

	      // for Mozilla/Opera9
	      if (document.addEventListener) {
	          document.addEventListener("DOMContentLoaded", init, false);
	      }

	      // for Internet Explorer
	      /*@cc_on @*/
	      /*@if (@_win32)
	          document.write("<scr"+"ipt id=__ie_onload defer src=javascript:void(0)><\/scr"+"ipt>");
	          var script = document.getElementById("__ie_onload");
	          script.onreadystatechange = function() {
	              if (this.readyState == "complete") {
	                  init(); // call the onload handler
	              }
	          };
	      /*@end @*/

	      // for Safari
	      if (/WebKit/i.test(navigator.userAgent)) { // sniff
	          window.__load_timer = setInterval(function() {
	              if (/loaded|complete/.test(document.readyState)) {
	                  init(); // call the onload handler
	              }
	          }, 10);
	      }

	      // for other browsers
	      window.onload = init;

	      // create event function stack
	      window.__load_events = [];
	   }

	   // add function to event stack
	   window.__load_events.push(func);
	}

	/* compteur + limitation de caracteres */

	function restrictinput(maxlength,e,placeholder){
		if (window.event&&event.srcElement.value.length>=maxlength)
			return false;
		else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
			var pressedkey=/[a-zA-Z0-9\.\,\/]/;
			if (pressedkey.test(String.fromCharCode(e.which)))
				e.stopPropagation();
		}
	}

	function countlimit(maxlength,e,placeholder){
		var theform=eval(placeholder);
		var lengthleft=maxlength-theform.value.length;
		var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder);
		if (window.event||e.target&&e.target==eval(placeholder)){
			if (lengthleft<0)
				theform.value=theform.value.substring(0,maxlength);
			placeholderobj.innerHTML=lengthleft;
		}
	}

	function displaylimit(thename, theid, thelimit){
		var theform=theid!=""? document.getElementById(theid) : thename
		var limit_text='<span class="Fleft">Caractères : '+thelimit+' max /&nbsp;</span><span class="Fleft" id="'+theform.toString()+'">'+thelimit+'</span><span class="Fleft">&nbsp;en cours</span>';
		if (document.all||document.getElementById&&!document.all)
			document.write(limit_text);
		if (document.all){
			eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
			eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
		}
		else if (document.getElementById&&!document.all){
			document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
			document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
		}
	}

	//Fonctions des pages Perso mon Profil

//	var tabIdsVerrous = new Array('verrou_sexe', 'verrou_age', 'verrou_signe', 'verrou_ville', 'verrou_situation_famille', 'verrou_enfants', 'verrou_activite', 'verrou_profession', 'verrou_animaux', 'verrou_caractere1', 'verrou_caractere2', 'verrou_caractere3', 'verrou_styledevie', 'verrou_look', 'verrou_presentation', 'verrou_aime', 'verrou_aimepas', 'verrou_devise', 'verrou_centres_interet', 'verrou_ronde7', 'verrou_blog', 'verrou_albums', 'verrou_annonces', 'verrou_questions' , 'verrou_amis', 'verrou_filleuls');
	var tabIdsVerrous = new Array('verrou_sexe', 'verrou_age', 'verrou_signe', 'verrou_ville', 'verrou_situation_famille', 'verrou_enfants', 'verrou_activite', 'verrou_profession', 'verrou_animaux', 'verrou_caractere1', 'verrou_caractere2', 'verrou_caractere3', 'verrou_styledevie', 'verrou_look', 'verrou_presentation', 'verrou_aime', 'verrou_aimepas', 'verrou_devise', 'verrou_blog', 'verrou_albums' );
	function montre_cache(id)
	{
		var obj = document.getElementById(id);
		var id_hidden = id + "_value";
		if (obj.className == "montre")
		{
			obj.className = "cache";
			document.formulaire[id_hidden].value = "0";
		}
		else
		{
			obj.className = "montre";
			document.formulaire[id_hidden].value = "1";
		}
	}
	function montre_tout()
	{
	//
	// pour ajouter des section sur les verrous modifier la liste des tabIdsVerrous plus haut
	//
	// verifier la liste dans /extension/perso/design/femmeactuelle/monprofil
	//
		for (var i=0; i<tabIdsVerrous.length; i++)
		{
			var id = tabIdsVerrous[i];
			var id_hidden = id + "_value";
			var obj = document.getElementById(id);
			obj.className = "montre";
			document.formulaire[id_hidden].value = "1";
		}
	}
	function cache_tout()
	{
		for (var i=0; i<tabIdsVerrous.length; i++)
		{
			var id = tabIdsVerrous[i];
			var id_hidden = id + "_value";
			var obj = document.getElementById(id);
			obj.className = "cache";
			document.formulaire[id_hidden].value = "0";
		}
	}
		// SCRIPT DE NOTATION
	function desactivate_all_note_pics()
	{
		for (i=1; i<=10; i++)
		{
			obj_id = "note_" + i;
			obj = document.getElementById(obj_id);

			if (obj.className == "rect_on") obj.className = "rect_off";
			/*
			if (obj.className == "left_half_on") obj.className = "left_half_off"
			else if (obj.className == "right_half_on") obj.className = "right_half_off"
			*/
		}
	}

	function activate_note_pics(note_pics_id)
	{
		var obj = document.getElementById(note_pics_id);

		note_nb = note_pics_id.substring(5,note_pics_id.length);

		//if (obj.className == "left_half_off" || obj.className == "right_half_off")
		if (obj.className == "rect_off")
		{

			for (i=1; i<=note_nb; i++)
			{
				obj2_id = "note_" + i;
				obj2 = document.getElementById(obj2_id);

				if (obj2.className == "rect_off") obj2.className = "rect_on";

				/*
				if (obj2.className == "left_half_off") obj2.className = "left_half_on"
				else if (obj2.className == "right_half_off") obj2.className = "right_half_on"
				*/
			}
			pointer = document.getElementById("your_notation_pointer");
			pointer.style.marginLeft = 40 + ( note_nb * 14 ) - 6 +  "px"; /* padding-left du bloc + (largeur d'un rectangle * note sélectionnée) - 1/2 taille du picto */

		}
		else
		{
			desactivate_all_note_pics();
			activate_note_pics(note_pics_id)
		}

	}
	// FIN SCRIPT DE NOTATION
	
	
	// SCRIPT DE NOTATION VOS PHOTO MULTIPLE
	function desactivate_all_note_pics2(node_id)
	{
		for (i=1; i<=10; i++)
		{
			obj_id = node_id + "_" + i;
			obj = document.getElementById(obj_id);

			if (obj.className == "rect_on") obj.className = "rect_off";
			/*
			if (obj.className == "left_half_on") obj.className = "left_half_off"
			else if (obj.className == "right_half_on") obj.className = "right_half_off"
			*/
		}
	}

	function activate_note_pics2(note_pics_id,idlenght)
	{
		var obj = document.getElementById(note_pics_id);
		var node_id =  note_pics_id.substring(0,idlenght);				

		note_nb = note_pics_id.substring(idlenght+1,note_pics_id.length);
				
		//if (obj.className == "left_half_off" || obj.className == "right_half_off")
		if (obj.className == "rect_off")
		{

			for (i=1; i<=note_nb; i++)
			{
				obj2_id = node_id + "_" + i;
				obj2 = document.getElementById(obj2_id);

				if (obj2.className == "rect_off") obj2.className = "rect_on";

				/*
				if (obj2.className == "left_half_off") obj2.className = "left_half_on"
				else if (obj2.className == "right_half_off") obj2.className = "right_half_on"
				*/
			}
			var note_pointer = 'your_notation_pointer' + node_id;
			pointer = document.getElementById(note_pointer);
			pointer.style.marginLeft = 40 + ( note_nb * 14 ) - 6 +  "px"; /* padding-left du bloc + (largeur d'un rectangle * note sélectionnée) - 1/2 taille du picto */

		}
		else
		{			
			desactivate_all_note_pics2(node_id);
			activate_note_pics2(note_pics_id,idlenght)
		}

	}
	// FIN SCRIPT DE NOTATION VOS PHOTO MULTIPLE
	

	// SCRIPT CRAVATE
	var tie_collapser_status;
	var widget_collapser_status = [];

	function collapse_tie(action)
	{

		container = document.getElementById("tie_block");
		obj = document.getElementById("tie_main_ctnt");
		bot = document.getElementById("tie_collapser_link");

		if (action != "")
		{
			if (tie_collapser_status == "+")
			{
				action = "-";
				tie_collapser_status = "-";
			}
			else if (tie_collapser_status == "-")
			{
				action = "+";
				tie_collapser_status = "+";
			}
			else
			{
				action = "-";
				tie_collapser_status = "-";
			}
		}

		if (action == "+")
		{
			container.className = "collapsed";
			bot.style.backgroundImage = "url(../images/png/tie/tie_block_bot_minus.png)";
		}
		else
		{
			container.className = "not_collapsed";
			bot.style.backgroundImage = "url(../images/png/tie/tie_block_bot_plus.png)";
			//obj_label.innerHTML = "+"
		}

		return tie_collapser_status;

	}

	function widget_collapser(wb_action, obj)
	{
		aff_obj = obj.parentNode.parentNode;
		cur_obj = aff_obj.id;


		if (wb_action != "")
		{

			if (widget_collapser_status[cur_obj] == "-")
			{
				wb_action = "+";
				widget_collapser_status[cur_obj] = "+";
			}
			else
			{
				wb_action = "-";
				widget_collapser_status[cur_obj] = "-";
			}
		}


		if (wb_action == "+")
		{
			aff_obj.className = "tie_widget_block wb_collapsed";
			obj.innerHTML = "-";
		}
		else
		{
			aff_obj.className = "tie_widget_block wb_not_collapsed";
			obj.innerHTML = "+";
		}


		return widget_collapser_status[cur_obj];

	}
	// FIN SCRIPT CRAVATE

	// SCRIPT MENU HOME
	function swap_menu( bg, id ) {
	  document.getElementById( 'haut_home' ).style.background = '#'+bg;
	  document.getElementById( 'li'+disp ).style.background = 'transparent';
	  document.getElementById( 'a'+disp ).style.textAlign = 'left';
	  document.getElementById( 'li'+id ).style.background = '#'+bg;
	  document.getElementById( 'a'+id ).style.textAlign = 'right';
	  document.getElementById( 'flash'+id ).style.display = '';
	  if( disp != id ) {
	    document.getElementById( 'flash'+disp ).style.display = 'none';
	    disp = id;
	  }
	}
	// FIN SCRIPT MENU HOME
	
	function vote_note(){
		location.reload(true);
	}