get$= function(id) {
	if(!id) return null;
		
	var e = (typeof id == "string") ? document.getElementById(id) : id;
	
	if(!e) return null;
	
	return e;
}
function get_rozmiar_sceny(){
  d=document;
  if (typeof window.innerWidth!='undefined') {
    winWidth = window.innerWidth;
    winHeight = window.innerHeight;
  } else {
    if (d.documentElement && typeof d.documentElement.clientWidth!='undefined' && d.documentElement.clientWidth!=0) {
      winWidth = d.documentElement.clientWidth;
      winHeight = d.documentElement.clientHeight;
    } else {
      if (d.body && typeof d.body.clientWidth!='undefined') {
        winWidth = d.body.clientWidth;
        winHeight = d.body.clientHeight;
      }
    }
  }
  var wyn={};
  wyn.width = winWidth;
  wyn.height = winHeight;
  return wyn;
}
function myTrim(tresc){
  return tresc.replace(new RegExp("(<br />)+|[ \n\r\t]+", "g"), "");
}
function myEmail(tresc){
  var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
  if(tresc.search(emailRegEx) == -1){
    return false;
  }else{
    return true;
  }
}
function myZip(tresc){
  var emailRegEx = /\.zip$/i;
  if(tresc.search(emailRegEx) == -1){
    return false;
  }else{
    return true;
  }
}
function IsNumeric(sText){
   return !isNaN(parseInt(sText,10));
}
function dodatki(){
  var tabButt = document.getElementsByTagName("button");
  for(i=0;i<tabButt.length;i++){
    if(tabButt[i].className==""){
      tabButt[i].className="butMenu";
      tabButt[i].onmouseover = function(){this.className="butMenuHover"};
      tabButt[i].onmouseout = function(){this.className="butMenu"};
    }
  }
}
function rozmiarDiv(iObj){
    var obj={};
    obj.width=get$(iObj).offsetWidth;
    obj.height=get$(iObj).offsetHeight;
    return obj;
}
function confirmation() {
	var answer = confirm("Czy jesteś pewien?");
	if (answer){
		return true;
	}
	else{
		return false;
	}
}
function chkZip(){
  if(get$("action").value=="dodaj" && !myZip(get$("plik").value)){
    alert("Wgrywaj plik tylko typu zip");
    return false;
  }
  return true;
}
