
function toggleview(id){ 
	var element;
	var expdate = new Date();
	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
	
	element = document.getElementById(id);
	if(element != null){
		if(element.style.display == ''){
			element.style.display = 'none';
			setcookie('category' + id,'0',expdate,null,false);			
		} else {
			element.style.display = '';
			setcookie('category' + id,'1',expdate,null,false);			
		}
			
		//element.style.display=='' ?  element.style.display='none' : element.style.display='';
	}
	
 }
 
 function loadview(categoryID){
	
	var element;
	if(!(catCookie = getcookie('category' + categoryID)))
		catCookie = 1;
	
	element = document.getElementById(categoryID);
	if(catCookie == 0){		
		element.style.display = 'none';			
	} else {
		element.style.display = '';				
	}
		
 }
 
 
function getcookie(name) {
    if(name=='') {return null};
    var start = document.cookie.indexOf(name+"=");
    var len = start + name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}




function setcookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}