
function SliderDiv(id, className, new_className) {
	this.className = className;
	this.new_class = new_className;
	this.id = id;
	
	this.collapse = function collapse()
	{	
		element = document.getElementById(this.id);
		
		if (element == null) {			
			return false;
		}				
		
		element.className = this.new_class;
	}
	
	this.expand = function expand()
	{		
		element = document.getElementById(this.id);
		
		if (element == null) {			
			return false;
		}	
		
		element.className = this.className;
	}
	
}


function Slider(cookie_name) {
	this.elements = new Array();
	this.cookie_name = cookie_name;
		
	this.collapse = function collapse()
	{
		for(i = 0; i < this.elements.length; i++)
		{
			this.elements[i].collapse();	
		}
		
		this.set_cookie(this.cookie_name, "1");
	}
	
	this.expand = function expand()
	{
		
		for(i = 0; i < this.elements.length; i++)
		{
			this.elements[i].expand();	
		}
		
		this.set_cookie(this.cookie_name, "0");
	}
	
	
	this.add = function add(id, className, new_className) 
	{		
		
		var div = new SliderDiv(id, className, new_className);
		this.elements.push(div);
		
	}
	
	this.set_cookie = function set_cookie(name, value)
	{	
		document.cookie = name + "=" + escape(value) + "; path=/";
	}

	
}

var ext_slider = new Slider("itk_slider");
ext_slider.add("std-layout-spacer", "std-layout-spacer-expand", "std-layout-spacer-collapsed");
ext_slider.add("std-layout-navigation-titel2", "std-layout-navigation-titel2-expand", "std-layout-navigation-titel2-collapsed");
ext_slider.add("std-layout-content", "std-layout-content-expand", "std-layout-content-collapsed");
ext_slider.add("std-layout-navigation", "std-layout-navigation-block", "std-layout-navigation-none");
ext_slider.add("std-layout-navigation-switch", "std-layout-navigation-switch-block", "std-layout-navigation-switch-none");
ext_slider.add("std-layout-navigation-title", "std-layout-navigation-title-block", "std-layout-navigation-title-none");
ext_slider.add("std-layout-navigation-info", "std-layout-navigation-info-block", "std-layout-navigation-info-none");
ext_slider.add("std-layout-navigation-collapsed", "std-layout-navigation-collapsed-none", "std-layout-navigation-collapsed-block");	


var explorer_slider = new Slider("itk_pm_explorer");
explorer_slider.add("cms-explorer-switch", "cms-explorer-switch-block", "cms-explorer-switch-none");
explorer_slider.add("pm-explorer-switch", "pm-explorer-switch-block", "pm-explorer-switch-none");
explorer_slider.add("projektexplorer", "projekt-explorer-block", "projekt-explorer-none");
explorer_slider.add("explorer", "explorer-block", "explorer-none");