1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
| /*
* RollOver sur le menu
*/
function show(p_elemId, type){
eval('block' + p_elemId + 'head = 0');
eval('block' + p_elemId + 'content = 0');
eval('block' + p_elemId + '' + type + ' = 1');
if(document.getElementById('under_'+p_elemId)){
document.getElementById('under_'+p_elemId).style.display = 'block';
}
if(document.getElementById('li_'+p_elemId)){
document.getElementById('li_'+p_elemId).className = document.getElementById('li_'+p_elemId).className+"_hover";
}
}
function hide(p_elemId, type){
eval('block' + p_elemId + '' + type + '=0');
toTest = eval('block' + p_elemId + 'head + block' + p_elemId + 'content');
if(toTest != 0){
return;
}
if(document.getElementById('under_'+p_elemId)){
document.getElementById('under_'+p_elemId).style.display = 'none';
}
if(document.getElementById('li_'+p_elemId)){
document.getElementById('li_'+p_elemId).className = document.getElementById('li_'+p_elemId).className.replace("_hover","");
}
}
/*
* vide le champs input quand on clique dessus (search)
*/
function vider_champs(nom_champs){
if(document.getElementById(nom_champs)){
document.getElementById(nom_champs).value = '';
}
}
/** Affiche le formulaire de contact cooperative **/
function afficher_contactcoop(elemId){
if(document.getElementById(elemId)){
document.getElementById(elemId).style.display = 'block';
}
if(document.getElementById(elemId+'1')){
document.getElementById(elemId+'1').style.display = 'none';
}
if(document.getElementById(elemId+'2')){
document.getElementById(elemId+'2').style.display = 'inline';
}
}
function cacher_contactcoop(elemId){
if(document.getElementById(elemId)){
document.getElementById(elemId).style.display = 'none';
}
if(document.getElementById(elemId+'1')){
document.getElementById(elemId+'1').style.display = 'inline';
}
if(document.getElementById(elemId+'2')){
document.getElementById(elemId+'2').style.display = 'none';
}
}
/** a+ a- */
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
}
// NOTE Needed to parenthesize options.path and options.domain
// in the following expressions, otherwise they evaluate to undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
$(document).ready(function(){
$('div#outils_titre').css('display', 'block');
$('div#contact_coop').css('display', 'block');
// Get cookie
var cookieName = "habitat-coop_font-size";
var fontSize = $.cookie(cookieName) ;
// Load cookie font size
if (fontSize != null) {
$('body').css('font-size', fontSize);
//setIFrameFontSizeValue(fontSize);
}else{
}
// Increase Font Size
$("a[id='increase-font-size']").click(function(){
//var currentFontSize = $('body').css('font-size');
//alert('avant = ' + currentFontSize);
//var currentFontSizeNum = parseFloat(currentFontSize, 10);
//if(currentFontSizeNum<13){
var newFontSize = '0.9em';
//alert('apres = ' + newFontSize);
$('body').css('font-size', newFontSize);
//setIFrameFontSizeValue(newFontSize);
$.cookie(cookieName, newFontSize), { expires: 7 };
//}
});
// Decrease Font Size
$("a[id='decrease-font-size']").click(function(){
//var currentFontSize = $('body').css('font-size');
//alert('avant = ' + currentFontSize);
//var currentFontSizeNum = parseFloat(currentFontSize, 10);
//if(currentFontSizeNum>11){
var newFontSize = '0.75em';
//alert('apres = ' + newFontSize);
$('body').css('font-size', newFontSize);
//setIFrameFontSizeValue(newFontSize);
$.cookie(cookieName, newFontSize, { expires: 7 });
//}
});
}); |
Partager