var min=8;
var max=34;
var minh=16;
var maxh=52
//augmentation des paragraphes
function increaseFontSize() {
	
	var listeTags = new Array('p','li','label','input','h4','h2','h3');
		
		//augmentation des paragraphes
		
	for(j=0;j<listeTags.length;j++) {

	   var tag = document.getElementsByTagName(listeTags[j]);
	   
	   for(i=0;i<tag.length;i++) {
		  if(tag[i].style.fontSize) {
			 var s = parseInt(tag[i].style.fontSize.replace("px",""));
		  } else {
			 var s = 12;
		  }
		  if(s!=max) {
			 s += 1;
		  }
		  tag[i].style.fontSize = s+"px";
	   }
	}   
}



function decreaseFontSize() {
	
	var listeTags = new Array('p','li','label','input','h4','h2','h3');
		
	//diminution des paragraphes
	for(j=0;j<listeTags.length;j++) {

	   var tag = document.getElementsByTagName(listeTags[j]);
	
		for(i=0;i<tag.length;i++)
		{
      		if(tag[i].style.fontSize) {
         		var s = parseInt(tag[i].style.fontSize.replace("px",""));
      		} else {
         		var s = 12;
     	 	}
      		if(s!=min) {
         		s -= 1;
      		}
      		tag[i].style.fontSize = s+"px"
  		 }     
	}
}


/**
*
*  UTF-8 data encode / decode
*  http://www.webtoolkit.info/
*
**/
 
var Utf8 = {
 
	// public method for url encoding
	encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// public method for url decoding
	decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	}
 
}


function direct_email(){
        var chaine_mail = '<a rel="nofollow" href="mailto:';
        chaine_mail += '?subject= Lien : ' + encodeURIComponent( document.title );
        chaine_mail += '&amp;body= Je recommande cette page : ' + encodeURIComponent( document.title );
        chaine_mail += '. Consultable à cette adresse : ' + encodeURIComponent(window.location.href);
        chaine_mail += '"  class=\"outil_mail\"><span>mail</span></a>';
        document.write(chaine_mail);
}


function includeJavascript(src) {
   if (document.createElement && document.getElementsByTagName) {
        var head_tag = document.getElementsByTagName('head')[0];
        var script_tag = document.createElement('script');
        script_tag.setAttribute('type', 'text/javascript');
        script_tag.setAttribute('src', src);
        head_tag.appendChild(script_tag);
    }
}

function includeCss(href) {
   if (document.createElement && document.getElementsByTagName) {
        var head_tag = document.getElementsByTagName('head')[0];
        var css_tag = document.createElement('link');
        css_tag.setAttribute('type', 'text/css');
		css_tag.setAttribute('rel', 'stylesheet');
        css_tag.setAttribute('href', href);
        head_tag.appendChild(css_tag);
    }
}
