	function $(id)
	{
		return document.getElementById(id);
	}
	
	function getRealHeight(obj)
	{
		paddingTop = getStyle(obj,'paddingTop','int');
		paddingBottom = getStyle(obj,'paddingBottom','int');
			
		if(navigator.userAgent.indexOf('MSIE') != -1){
			realHeight = obj.offsetHeight;

			//specjalnie dla IE trzeba odjac jeszcze szerokosc borderow..
			realHeight -= getStyle(obj,'borderTopWidth','int');
			realHeight -= getStyle(obj,'borderBottomWidth','int');
		}
		else 
			realHeight = obj.clientHeight;
		
		return (realHeight-paddingTop-paddingBottom);
	}
	
	function getStyle(obj,s,type)
	{
		if(!not(obj.style[s]))
			r = obj.style[s];
		else
			r = false;
		
		if(!not(type)){
			if(type = 'int'){
				r = parseInt(r);
				if(isNaN(r)) {
					r = 0
				};
				
				return r;
			}
		}
		return r;
	}
	
	function toggleDisp(id)
	{
		var elem = document.getElementById(id);
		if(elem.style.display == "block")
			elem.style.display= "none";
		else
			elem.style.display="block";
	}
	
	function not(v)
	{
		if(typeof v == 'undefined'){
			return true;
		}

		if(typeof v == 'null'){
			return true;
		}

		if(typeof v == null){
			return true;
		}

		return false;
	}
	
	function setStyle(obj,s,v,fix,debug)
	{
		if(not(debug)){
			var debug = false;
		}
		
		if(!not(fix)){
			v += fix;
		}
		
		if(navigator.userAgent.indexOf('MSIE') != -1){
			switch(s){		
				case 'opacity' : 
					v = 'alpha(opacity='+(v * 100)+')';
					s = 'filter';
					break;

				case 'cssFloat' :
					s = 'styleFloat';
					break;
				
				case 'minHeight' :
					//s = 'height';
					break;
			}
		}
		
		if(debug){
			alert(obj+" / "+s+" = "+v);
		}
		
		obj.style[s] = v;
		return obj.style[s];
	}
	
	function setClass(obj,tempClassName,add)
	{
		if(not(add)){
			var add = false;
		}
		
		if(not(obj)){
			return false;
		}
		
		if(obtainClass(obj,tempClassName))
			return obj.className;
		
		if(add){
			obj.className += ' '+tempClassName;
		}
		else {
			obj.className = tempClassName;
		}
		
		return obj.className;
	}
	
	function unsetClass(obj,tempClassName)
	{
		eval('var regs = /(^|\\s)'+tempClassName+'($|\\s)/i');
		obj.className = obj.className.replace(regs,'$1$2');
		obj.className = obj.className.replace(/\s\s/,' ')
	}
	
	function obtainClass(obj,tempClassName)
	{
		if(not(obj)){
			return false;
		}
		
		if(not(tempClassName)){
			var temp = new Array();
			temp = obj.className.split(' ');
			return temp;
		}
		else {
			eval('var regs = /(^|\\s)'+tempClassName+'($|\\s)/i');
			return regs.test(obj.className);
		}
	}
	

