use the function hasClass to know whether an element has an class
example:
//store state in cookie
if(li.hasClass(CLASSES.open)){
TreeState = false;
}else{
TreeState = true;
}
example:
//store state in cookie
if(li.hasClass(CLASSES.open)){
TreeState = false;
}else{
TreeState = true;
}