$.setcookie=function(name,value,opt){document.cookie=name+'='+escape(value)+(opt.expires?';expires='+new Date(+new Date()+opt.expires*864e5).toGMTString():'')+'; path=/'}
$.tJSON=function(v){return eval('('+v+')')};
$.fromJSON=function(v){
var t=[],i;
jQuery.each(v, function(index, value) {
   t.push(index+':'+value);
 })
return '{'+t.join(',')+'}';
}


    ta=$.cookie('tabsy');
    if (ta)
    {
        if (ta.length > 50)
        {
           ta = null;
        }
    }
    else
    {
        $.cookie('tabsy', '', { expires: -1 }); // delete cookie
    }

        if (ta)
            ta=$.tJSON(unescape(ta));

function makeSlieable(trigger,container)
{
	$(trigger).click(function(){

	    if(ta && ta[this.id])
        {
			$(container).slideUp()
			ta[this.id]=0
        }
        else
        {
			$(container).slideDown()
			if (!ta)
			{
                ta = [];
            }
			ta[this.id]=1
	    }
       // $.setcookie('tabsy',$.fromJSON(ta),{expires:365});
        $.cookie('tabsy', $.fromJSON(ta), { expires: 365 }); // delete cookie
        return false;
	}).end();
	
if (ta){
	if(!ta[trigger.id])
        {
			$(container).hide();
        }
        else
        {
			$(container).show();
	    }
 } else {
	$(container).hide();
	}
}




