
/**
 * Zwraca obiekt o zadanym ID
 *
 * @param string id Id obiektu
 * @return Object
 */
function $( id )
{
	return document.getElementById( id );
}

/**
 * Pobiera cookie 
 */
function getCookie (n){
	var r=null,a=n+"=",b=a.length,c=window.decodeURIComponent(document.cookie),l=c.length,i=0,j,e;
	while(i<l){j=i+b;if(c.substring(i,j)==a){e=c.indexOf(";",j);
	if(e==-1)e=c.length;r=(c.substring(j,e));break;}i=c.indexOf(" ",i)+1;
	if(i==0)break;}
	return r;
}

/**
 * ustawia w elemencie o podanym id podany tekst
 */
function changeText( id, text )
{
	$(id).innerHTML = text;

	return false;
}

/**
 * sprawdza zgodnosc itemu z podanym wyrazeniem regularnym
 */
function validPattern(item, pattern) {
	var valid = new RegExp(pattern, 'g');
	if(!valid.exec(item))
		return false;
	return true;
}
