И так, делается это следующим образом.
Сразу после <body> вставляешь скрипт, который подключает куки, заменяет функцией Twrite() твои onclick:
Code
<script type="text/javascript">
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') {
options = options || {};
if (value === null) {
value = '';
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();
}
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 {
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]);
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
};
$(document).ready(function(){
var tab_cookie = $.cookie('tab_cookie');
if(tab_cookie==null || tab_cookie=='norm') { Twrite('nenorm'); }
if(tab_cookie=='nenorm') { Twrite('norm'); }
});
function Twrite(tab) {
if(tab=='norm') {
$('.norm').hide();
$('#norm').hide();
$('#nenorm').show();
$('.nenorm').show();
$.cookie('tab_cookie', 'nenorm', {expires: 365, path: '/'});
}
if(tab=='nenorm') {
$('.norm').show();
$('#norm').show();
$('#nenorm').hide();
$('.nenorm').hide();
$.cookie('tab_cookie', 'norm', {expires: 365, path: '/'});
}
}
</script>
Далее заменяешь свой выше указанный html код на:
Code
<a href="javascript:;" id="norm" style="display:inline" onclick="Twrite('norm');" title="Norm">Norm</a>
<a href="javascript:;" id="nenorm" style="display:none" onclick="Twrite('nenorm')">NeNorm</a>
<div class="norm">NORM TEXT</div>
<div class="nenorm" style="display:none">NE NORM TEXT</div>
В принципе все, помог - плюсуй, т.к. хочу получить группу Проверенный