function advAJAX(){var obj=new Object();obj.url=window.location.href;obj.method="GET";obj.parameters=new Object();obj.jsonParameters=new Object();obj.headers=new Object();obj.async=true;obj.mimeType="text/xml";obj.username=null;obj.password=null;obj.form=null;obj.disableForm=true;obj.unique=true;obj.uniqueParameter="_uniqid";obj.requestDone=false;obj.queryString="";obj.responseText=null;obj.responseXML=null;obj.status=null;obj.statusText=null;obj.aborted=false;obj.timeout=0;obj.retryCount=0;obj.retryDelay=1000;obj.tag=null;obj.group=null;obj.progressTimerInterval=50;obj.xmlHttpRequest=null;obj.onInitialization=null;obj.onFinalization=null;obj.onReadyStateChange=null;obj.onLoading=null;obj.onLoaded=null;obj.onInteractive=null;obj.onComplete=null;obj.onProgress=null;obj.onSuccess=null;obj.onFatalError=null;obj.onError=null;obj.onTimeout=null;obj.onRetryDelay=null;obj.onRetry=null;obj.onGroupEnter=null;obj.onGroupLeave=null;obj.createXmlHttpRequest=function(){if(typeof XMLHttpRequest!="undefined")
return new XMLHttpRequest();var xhrVersion=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];for(var i=0;i<xhrVersion.length;i++){try{var xhrObj=new ActiveXObject(xhrVersion[i]);return xhrObj;}catch(e){}}
obj.raiseEvent("FatalError");return null;};obj._oldResponseLength=null;obj._progressTimer=null;obj._progressStarted=navigator.userAgent.indexOf('Opera')==-1;obj._onProgress=function(){if(typeof obj.onProgress=="function"&&typeof obj.xmlHttpRequest.getResponseHeader=="function"){var contentLength=obj.xmlHttpRequest.getResponseHeader("Content-length");if(contentLength!=null&&contentLength!=''){var responseLength=obj.xmlHttpRequest.responseText.length;if(responseLength!=obj._oldResponseLength){obj.raiseEvent("Progress",obj,responseLength,contentLength);obj._oldResponseLength=obj.xmlHttpRequest.responseText.length;}}}
if(obj._progressStarted)return;obj._progressStarted=true;var _obj=this;this.__onProgress=function(){obj._onProgress();obj._progressTimer=window.setTimeout(_obj.__onProgress,obj.progressTimerInterval);}
_obj.__onProgress();}
obj._onInitializationHandled=false;obj._initObject=function(){if(obj.xmlHttpRequest!=null){delete obj.xmlHttpRequest["onreadystatechange"];obj.xmlHttpRequest=null;}
if((obj.xmlHttpRequest=obj.createXmlHttpRequest())==null)
return null;if(typeof obj.xmlHttpRequest.overrideMimeType!="undefined")
obj.xmlHttpRequest.overrideMimeType(obj.mimeType);obj.xmlHttpRequest.onreadystatechange=function(){if(obj==null||obj.xmlHttpRequest==null)
return;obj.raiseEvent("ReadyStateChange",obj,obj.xmlHttpRequest.readyState);obj._onProgress();switch(obj.xmlHttpRequest.readyState){case 1:obj._onLoading();break;case 2:obj._onLoaded();break;case 3:obj._onInteractive();break;case 4:obj._onComplete();break;}};obj._onLoadingHandled=obj._onLoadedHandled=obj._onInteractiveHandled=obj._onCompleteHandled=false;};obj._onLoading=function(){if(obj._onLoadingHandled)
return;if(!obj._retry&&obj.group!=null){if(typeof advAJAX._groupData[obj.group]=="undefined")
advAJAX._groupData[obj.group]=0;advAJAX._groupData[obj.group]++;if(typeof obj.onGroupEnter=="function"&&advAJAX._groupData[obj.group]==1)
obj.onGroupEnter(obj);}
obj.raiseEvent("Loading",obj);obj._onLoadingHandled=true;};obj._onLoaded=function(){if(obj._onLoadedHandled)
return;obj.raiseEvent("Loaded",obj);obj._onLoadedHandled=true;};obj._onInteractive=function(){if(obj._onInteractiveHandled)
return;obj.raiseEvent("Interactive",obj);obj._onInteractiveHandled=true;if(!obj._progressStarted)
obj._onProgress();};obj._onComplete=function(){if(obj._onCompleteHandled||obj.aborted)
return;if(obj._progressStarted){window.clearInterval(obj._progressTimer);obj._progressStarted=false;}
obj.requestDone=true;with(obj.xmlHttpRequest){obj.responseText=responseText;obj.responseXML=responseXML;if(typeof status!="undefined")
obj.status=status;if(typeof statusText!="undefined")
obj.statusText=statusText;}
obj.raiseEvent("Complete",obj);obj._onCompleteHandled=true;if(obj.status==200)
obj.raiseEvent("Success",obj);else
obj.raiseEvent("Error",obj);delete obj.xmlHttpRequest['onreadystatechange'];obj.xmlHttpRequest=null;if(obj.disableForm)
obj.switchForm(true);obj._groupLeave();obj.raiseEvent("Finalization",obj);};obj._groupLeave=function(){if(obj.group!=null){advAJAX._groupData[obj.group]--;if(advAJAX._groupData[obj.group]==0)
obj.raiseEvent("GroupLeave",obj);}};obj._retry=false;obj._retryNo=0;obj._onTimeout=function(){if(obj==null||obj.xmlHttpRequest==null||obj._onCompleteHandled)
return;obj.aborted=true;obj.xmlHttpRequest.abort();obj.raiseEvent("Timeout",obj);obj._retry=true;if(obj._retryNo!=obj.retryCount){obj._initObject();if(obj.retryDelay>0){obj.raiseEvent("RetryDelay",obj);startTime=new Date().getTime();while(new Date().getTime()-startTime<obj.retryDelay);}
obj._retryNo++;obj.raiseEvent("Retry",obj,obj._retryNo);obj.run();}else{delete obj.xmlHttpRequest["onreadystatechange"];obj.xmlHttpRequest=null;if(obj.disableForm)
obj.switchForm(true);obj._groupLeave();obj.raiseEvent("Finalization",obj);}};obj.run=function(){obj._initObject();if(obj.xmlHttpRequest==null)
return false;obj.aborted=false;if(!obj._onInitializationHandled){obj.raiseEvent("Initialization",obj);obj._onInitializationHandled=true;}
if(obj.method=="GET"&&obj.unique)
obj.parameters[encodeURIComponent(obj.uniqueParameter)]=new Date().getTime().toString().substr(5)+Math.floor(Math.random()*100).toString();if(!obj._retry){for(var a in obj.parameters){if(obj.queryString.length>0)
obj.queryString+="&";if(typeof obj.parameters[a]!="object")
obj.queryString+=encodeURIComponent(a)+"="+encodeURIComponent(obj.parameters[a]);else{for(var i=0;i<obj.parameters[a].length;i++)
obj.queryString+=encodeURIComponent(a)+"="+encodeURIComponent(obj.parameters[a][i])+"&";obj.queryString=obj.queryString.slice(0,-1);}}
for(var a in obj.jsonParameters){var useJson=typeof[].toJSONString=='function';if(obj.queryString.length>0)
obj.queryString+="&";obj.queryString+=encodeURIComponent(a)+"=";if(useJson)
obj.queryString+=encodeURIComponent(obj.jsonParameters[a].toJSONString());else
obj.queryString+=encodeURIComponent(obj.jsonParameters[a]);}
if(obj.method=="GET"&&obj.queryString.length>0)
obj.url+=(obj.url.indexOf("?")!=-1?"&":"?")+obj.queryString;}
if(obj.disableForm)
obj.switchForm(false);try{obj.xmlHttpRequest.open(obj.method,obj.url,obj.async,obj.username||'',obj.password||'');}catch(e){obj.raiseEvent("FatalError",obj,e);return;}
if(obj.timeout>0)
setTimeout(obj._onTimeout,obj.timeout);if(typeof obj.xmlHttpRequest.setRequestHeader!="undefined")
for(var a in obj.headers)
obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a),encodeURIComponent(obj.headers[a]));if(obj.method=="POST"&&typeof obj.xmlHttpRequest.setRequestHeader!="undefined"){obj.xmlHttpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");obj.xmlHttpRequest.send(obj.queryString);}else if(obj.method=="GET")
obj.xmlHttpRequest.send('');};obj.handleArguments=function(args){if(typeof args.form=="object"&&args.form!=null){obj.form=args.form;obj.appendForm();}
for(a in args){if(typeof obj[a]=="undefined")
obj.parameters[a]=args[a];else{if(a!="parameters"&&a!="headers")
obj[a]=args[a];else
for(b in args[a])
obj[a][b]=args[a][b];}}
obj.method=obj.method.toUpperCase();};obj.switchForm=function(enable){if(typeof obj.form!="object"||obj.form==null)
return;with(obj.form)
for(var nr=0;nr<elements.length;nr++)
if(!enable){if(elements[nr]["disabled"])
elements[nr]["_disabled"]=true;else
elements[nr]["disabled"]="disabled";}else
if(typeof elements[nr]["_disabled"]=="undefined")
elements[nr].removeAttribute("disabled");};obj.appendForm=function(){with(obj.form){obj.method=getAttribute("method").toUpperCase();obj.url=getAttribute("action");for(var nr=0;nr<elements.length;nr++){var e=elements[nr];if(e.disabled)
continue;switch(e.type){case"text":case"password":case"hidden":case"textarea":obj.addParameter(e.name,e.value);break;case"select-one":if(e.selectedIndex>=0)
obj.addParameter(e.name,e.options[e.selectedIndex].value);break;case"select-multiple":for(var nr2=0;nr2<e.options.length;nr2++)
if(e.options[nr2].selected)
obj.addParameter(e.name,e.options[nr2].value);break;case"checkbox":case"radio":if(e.checked)
obj.addParameter(e.name,e.value);break;}}}};obj.addParameter=function(name,value){if(typeof obj.parameters[name]=="undefined")
obj.parameters[name]=value;else
if(typeof obj.parameters[name]!="object")
obj.parameters[name]=[obj.parameters[name],value];else
obj.parameters[name][obj.parameters[name].length]=value;};obj.delParameter=function(name){delete obj.parameters[name];};obj.raiseEvent=function(name){var args=[];for(var i=1;i<arguments.length;i++)
args.push(arguments[i]);if(typeof obj["on"+name]=="function")
obj["on"+name].apply(null,args);if(name=="FatalError")
obj.raiseEvent("Finalization",obj);}
if(typeof advAJAX._defaultParameters!="undefined")
obj.handleArguments(advAJAX._defaultParameters);return obj;}
advAJAX.get=function(args){return advAJAX.handleRequest("GET",args);};advAJAX.post=function(args){return advAJAX.handleRequest("POST",args);};advAJAX.head=function(args){return advAJAX.handleRequest("HEAD",args);};advAJAX.submit=function(form,args){if(typeof args=="undefined"||args==null)
return-1;if(typeof form!="object"||form==null)
return-2;var request=new advAJAX();args["form"]=form;request.handleArguments(args);return request.run();};advAJAX.assign=function(form,args){if(typeof args=="undefined"||args==null)
return-1;if(typeof form!="object"||form==null)
return-2;if(typeof form["onsubmit"]=="function")
form["_onsubmit"]=form["onsubmit"];form["advajax_args"]=args;form["onsubmit"]=function(){if(typeof this["_onsubmit"]!="undefined"&&this["_onsubmit"]()===false)
return false;if(advAJAX.submit(this,this["advajax_args"])==false)
return true;return false;}
return true;};advAJAX.download=function(targetObj,url){if(typeof targetObj=="string")
targetObj=document.getElementById(targetObj);if(!targetObj)
return-1;advAJAX.get({url:url,onSuccess:function(obj){targetObj.innerHTML=obj.responseText;}});};advAJAX.scan=function(){var obj=document.getElementsByTagName("a");for(var i=0;i<obj.length;){if(obj[i].getAttribute("rel")=="advancedajax"&&obj[i].getAttribute("href")!==null){var url=obj[i].getAttribute("href");var div=document.createElement("div");div.innerHTML=obj[i].innerHTML;div.className=obj[i].className;var parent=obj[i].parentNode;parent.insertBefore(div,obj[i]);parent.removeChild(obj[i]);advAJAX.download(div,url);}else i++;}};advAJAX.handleRequest=function(requestType,args){if(typeof args=="undefined"||args==null)
return-1;var request=new advAJAX();window.advajax_obj=request;request.method=requestType;request.handleArguments(args);return request.run();};advAJAX._defaultParameters=new Object();advAJAX.setDefaultParameters=function(args){advAJAX._defaultParameters=new Object();for(a in args)
advAJAX._defaultParameters[a]=args[a];};advAJAX._groupData=new Object();function show(div1,div2){d1=document.getElementById(div1);d2=document.getElementById(div2);d1_tab=document.getElementById(div1+'_tab');d2_tab=document.getElementById(div2+'_tab');d1.style.display="block";d2.style.display="none";d1_tab.className="active";d2_tab.className="disable";}
function change_all(w)
{var ile=8;var ktora;for(var i=1;i<=ile;i++)
{ktora="menuul_"+i;if(i==w){document.getElementById(ktora).style.display="block";}
else if(i!=w){document.getElementById(ktora).style.display="none";}}}
function hymn(wersja){advAJAX.get({tag:"hymn",url:"ajax/hymn.php","wersja":wersja})};advAJAX.setDefaultParameters({onSuccess:function(obj){document.getElementById(obj.tag).innerHTML=obj.responseText;}});function change(pos){advAJAX.get({tag:"submenu",url:"ajax/submenu.php","pos":pos})};advAJAX.setDefaultParameters({onSuccess:function(obj){document.getElementById(obj.tag).innerHTML=obj.responseText;}});function changem(pos){advAJAX.get({tag:"submenu",url:"../ajax/submenu_admin.php","pos":pos})};advAJAX.setDefaultParameters({onSuccess:function(obj){document.getElementById(obj.tag).innerHTML=obj.responseText;}});function show2(id_div,maindiv){var divs=document.getElementById(maindiv).getElementsByTagName('div');for(i=0;i<divs.length;i++)
{document.getElementById(divs[i].id).style.display="none";document.getElementById('tab_'+divs[i].id).className="";}
document.getElementById(id_div).style.display="block";document.getElementById('tab_'+id_div).className="selected";}
function wyniki(game,team,comp){advAJAX.get({tag:"wyniki",url:"ajax/wyniki.php","game":game,"team":team,"comp":comp})};advAJAX.setDefaultParameters({onSuccess:function(obj){document.getElementById(obj.tag).innerHTML=obj.responseText;}});function terminarz(game,team,comp){advAJAX.get({tag:"terminarz",url:"ajax/terminarz.php","game":game,"team":team,"comp":comp})};advAJAX.setDefaultParameters({onSuccess:function(obj){document.getElementById(obj.tag).innerHTML=obj.responseText;}});function Pokaz(co){if(document.getElementById(co).style.display=="block"){document.getElementById(co).style.display="none";}else{document.getElementById(co).style.display="block";}}
function cdtime(container,targetdate){if(!document.getElementById||!document.getElementById(container))return
this.container=document.getElementById(container)
this.currentTime=new Date()
this.targetdate=new Date(targetdate)
this.timesup=false
this.updateTime()}
cdtime.prototype.updateTime=function(){var thisobj=this
this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()},1000)}
cdtime.prototype.displaycountdown=function(baseunit,functionref){this.baseunit=baseunit
this.formatresults=functionref
this.showresults()}
cdtime.prototype.showresults=function(){var thisobj=this
var timediff=(this.targetdate-this.currentTime)/1000
if(timediff<0){this.timesup=true
this.container.innerHTML=this.formatresults()
return}
var oneMinute=60
var oneHour=60*60
var oneDay=60*60*24
var dayfield=Math.floor(timediff/oneDay)
var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
if(this.baseunit=="hours"){hourfield=dayfield*24+hourfield
dayfield="n/a"}
else if(this.baseunit=="minutes"){minutefield=dayfield*24*60+hourfield*60+minutefield
dayfield=hourfield="n/a"}
else if(this.baseunit=="seconds"){var secondfield=timediff
dayfield=hourfield=minutefield="n/a"}
this.container.innerHTML=this.formatresults(dayfield,hourfield,minutefield,secondfield)
setTimeout(function(){thisobj.showresults()},1000)}
function formatresults_en(){if(this.timesup==false){var displaystring="<span style='font-weight:bold;'>"+arguments[0]+"</span> days <span style='font-weight:bold;'>"+arguments[1]+"</span> hours <span style='font-weight:bold;'>"+arguments[2]+"</span> minutes <span style='font-weight:bold;'>"+arguments[3]+"</span> seconds "}
else{var displaystring="Start"}
return displaystring}
function formatresults_pl(){if(this.timesup==false){var displaystring="<span style='font-weight:bold;'>"+arguments[0]+"</span> dni <span style='font-weight:bold;'>"+arguments[1]+"</span> godzin(y) <span style='font-weight:bold;'>"+arguments[2]+"</span> minut(y) <span style='font-weight:bold;'>"+arguments[3]+"</span> sekund(y) "}
else{var displaystring="Start"}
return displaystring}
function formatresults_pl_short(){if(this.timesup==false){var displaystring="<span style='font-weight:bold;'>"+arguments[1]+"</span> godz, <span style='font-weight:bold;'>"+arguments[2]+"</span> min"}
else{var displaystring="Start"}
return displaystring}
function formatresults_de(){if(this.timesup==false){var displaystring=arguments[0]+" Tag(e) "+arguments[1]+" Stunde(n) "+arguments[2]+" Minute(n) "+arguments[3]+" Sekunde(n) "}
else{var displaystring="Start"}
return displaystring}
function formatresults2(){if(this.timesup==false){var displaystring="<span class='lcdstyle'>"+arguments[0]+" <sup>days</sup> "+arguments[1]+" <sup>hours</sup> "+arguments[2]+" <sup>minutes</sup> "+arguments[3]+" <sup>seconds</sup></span> left until this Christmas"}
else{var displaystring=""
alert("Christmas is here!")}
return displaystring}
var displayWaitMessage=true;var activeImage=false;var imageGalleryLeftPos=false;var imageGalleryWidth=false;var imageGalleryObj=false;var maxGalleryXPos=false;var slideSpeed=0;var imageGalleryCaptions=new Array();function startSlide(e)
{if(document.all)e=event;var id=this.id;this.getElementsByTagName('IMG')[0].src='images/'+this.id+'_over.gif';if(this.id=='arrow_right'){slideSpeedMultiply=Math.floor((e.clientX-this.offsetLeft)/5);slideSpeed=-1*slideSpeedMultiply;slideSpeed=Math.max(-10,slideSpeed);}else{slideSpeedMultiply=10-Math.floor((e.clientX-this.offsetLeft)/5);slideSpeed=1*slideSpeedMultiply;slideSpeed=Math.min(10,slideSpeed);if(slideSpeed<0)slideSpeed=10;}}
function releaseSlide()
{var id=this.id;this.getElementsByTagName('IMG')[0].src='images/'+this.id+'.gif';slideSpeed=0;}
function gallerySlide()
{if(slideSpeed!=0){var leftPos=imageGalleryObj.offsetLeft;leftPos=leftPos/1+slideSpeed;if(leftPos>maxGalleryXPos){leftPos=maxGalleryXPos;slideSpeed=0;}
if(leftPos<minGalleryXPos){leftPos=minGalleryXPos;slideSpeed=0;}
imageGalleryObj.style.left=leftPos+'px';}
setTimeout('gallerySlide()',20);}
function showImage()
{if(activeImage){activeImage.style.filter='alpha(opacity=50)';activeImage.style.opacity=0.5;}
this.style.filter='alpha(opacity=100)';this.style.opacity=1;activeImage=this;}
function initSlideShow()
{document.getElementById('arrow_left').onmousemove=startSlide;document.getElementById('arrow_left').onmouseout=releaseSlide;document.getElementById('arrow_right').onmousemove=startSlide;document.getElementById('arrow_right').onmouseout=releaseSlide;imageGalleryObj=document.getElementById('theImages');imageGalleryLeftPos=imageGalleryObj.offsetLeft;imageGalleryWidth=document.getElementById('galleryContainer').offsetWidth-80;maxGalleryXPos=imageGalleryObj.offsetLeft;minGalleryXPos=imageGalleryWidth-document.getElementById('slideEnd').offsetLeft;var slideshowImages=imageGalleryObj.getElementsByTagName('IMG');for(var no=0;no<slideshowImages.length;no++){slideshowImages[no].onmouseover=showImage;}
var divs=imageGalleryObj.getElementsByTagName('DIV');for(var no=0;no<divs.length;no++){if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length]=divs[no].innerHTML;}
gallerySlide();}
function showPreview(imagePath,imageIndex){var subImages=document.getElementById('previewPane').getElementsByTagName('IMG');if(subImages.length==0){var img=document.createElement('IMG');document.getElementById('previewPane').appendChild(img);}else img=subImages[0];if(displayWaitMessage){document.getElementById('waitMessage').style.display='none';}
document.getElementById('largeImageCaption').style.display='none';img.onload=function(){hideWaitMessageAndShowCaption(imageIndex-1);};img.src=imagePath;}
function hideWaitMessageAndShowCaption(imageIndex)
{document.getElementById('waitMessage').style.display='none';document.getElementById('largeImageCaption').innerHTML=imageGalleryCaptions[imageIndex];document.getElementById('largeImageCaption').style.display='none';}
window.onload=initSlideShow;

testFormularza={
  rodzajePol:{
    niepuste:[/.+/,'Proszę wypełnić pole'],
    email:[/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/,'Niepoprawny format emaila'],
    liczbacalkowita:[/^\d+$/,'Prawid&#322;ow&#261; warto&#347;ci&#261; tego pola jest liczba ca&#322;kowita'],
    liczbarzeczywista:[/^(\d+|\d+,\d+)$/,'Prosz&#281; poda&#263; liczb&#281; rzeczywist&#261; (mo&#380;na u&#380;y&#263; przecinka)'],
    data:[/^\d+\-\d+\-\d{4}$/,'Prosz&#281; wpisa&#263; dat&#281; w formacie DD-MM-RRRR (numer dnia-numer miesi&#261;ca-rok) np. 23-02-2003'],
    kodpocztowy:[/^\d{2}\-\d{3}$/,'Niepoprawny format kodu pocztowego np. 06-600'],
    telefon:[/\+\d{11}/,'Niepoprawny format nr telefonu np. +48666666666'],
    m20m100:[/^.{3,40}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 40 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m3m25:[/^.{3,25}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 25 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m5m80:[/^.{3,60}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 60 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m20m200:[/^.{3,200}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 200 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
		m20m4000:[/^.{20,4000}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 4000 znak&#243;w, ale te&#380; nie mniej ni&#380; 20.'],
    duzelitery:[/^[A-Z]+$/,'Prosz&#281; u&#380;ywa&#263; wy&#322;&#261;cznie du&#380;ych liter w tym polu'],
		max:[/^[.\s]{20,4000}$/,'Max'],
    banner:[/^\d{4}\x\d{4}$/,'Niepoprawny format banera np. 9999x9999'],
    url:[/^http\:\/\/www.+\.[a-z]{2,5}$/,'Prosz&#281; poda&#263; prawid&#322;owy adres strony www np. http://www.strona.pl']
  },
  testuj:function(f){
    var i,rodz;
  
	
	var items = {pole1: 'm20m100', pole2: 'm20m100', pole3: 'm20m100', pole4: 'm20m100' , pole5: 'm20m100',pole6: 'm20m100' , pole_email: 'email', pole_email2: 'email', pole_niepuste1: 'niepuste' , pole_niepuste2: 'niepuste' , pole_niepuste3: 'niepuste', pole_niepuste4: 'niepuste'  , pole_niepuste5: 'niepuste' , pole_liczbacalkowita1: 'liczbacalkowita', pole_liczbacalkowita2: 'liczbacalkowita', pole_liczbacalkowita3: 'liczbacalkowita', polemax: 'm20m4000' }
	
	
    
    for(i=0;i<f.elements.length;i++){
		
      E=f.elements[i];
			
			
			
			//alert (E.getAttribute('id'));
     
      if(rodz=this.rodzajePol[items[E.getAttribute('id')]])
      
        if(!rodz[0].test(E.value)){
          E.focus();
          
          E.select();
         
          
          document.getElementById("error").style.display = "block";
          
          document.getElementById("error").innerHTML=(E.getAttribute('komunikat')||rodz[1]);
					
					
         
          return false;          
        } 
    }
    
    
    
    return true;
  }
  
  
  
}


testFormularza1={
  rodzajePol:{
    niepuste:[/.+/,'Proszę wypełnić pole'],
    email:[/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/,'Prosz&#281; poda&#263; prawid&#322;owy adres e-mail'],
    liczbacalkowita:[/^\d+$/,'Prawid&#322;ow&#261; warto&#347;ci&#261; tego pola jest liczba ca&#322;kowita'],
    liczbarzeczywista:[/^(\d+|\d+,\d+)$/,'Prosz&#281; poda&#263; liczb&#281; rzeczywist&#261; (mo&#380;na u&#380;y&#263; przecinka)'],
    data:[/^\d+\-\d+\-\d{4}$/,'Prosz&#281; wpisa&#263; dat&#281; w formacie DD-MM-RRRR (numer dnia-numer miesi&#261;ca-rok) np. 23-02-2003'],
    kodpocztowy:[/^\d{2}\-\d{3}$/,'Niepoprawny format kodu pocztowego np. 06-600'],
    telefon:[/\+\d{11}/,'Niepoprawny format nr telefonu np. +48666666666'],
    m20m100:[/^.{3,40}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 40 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m3m25:[/^.{3,25}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 25 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m5m80:[/^.{3,60}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 60 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
    m20m200:[/^.{3,200}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 200 znak&#243;w, ale te&#380; nie mniej ni&#380; 3.'],
		m20m4000:[/^.{20,4000}$/,'Prosz&#281; wpisa&#263; nie wi&#281;cej ni&#380; 4000 znak&#243;w, ale te&#380; nie mniej ni&#380; 20.'],
    duzelitery:[/^[A-Z]+$/,'Prosz&#281; u&#380;ywa&#263; wy&#322;&#261;cznie du&#380;ych liter w tym polu'],
		max:[/^[.\s]{20,4000}$/,'Max'],
    banner:[/^\d{4}\x\d{4}$/,'Niepoprawny format banera np. 9999x9999'],
    url:[/^http\:\/\/www.+\.[a-z]{2,5}$/,'Prosz&#281; poda&#263; prawid&#322;owy adres strony www np. http://www.strona.pl']
  },
  testuj1:function(f){
    var i,rodz;
  
	
var items = {pole1: 'm20m100', pole2: 'm20m100', pole3: 'm20m100', pole4: 'm20m100' , pole5: 'm20m100',pole6: 'm20m100' , pole_email: 'email', pole_email2: 'email', pole_niepuste1: 'niepuste' , pole_niepuste2: 'niepuste' , pole_niepuste3: 'niepuste', pole_niepuste4: 'niepuste'  , pole_niepuste5: 'niepuste' , pole_liczbacalkowita1: 'liczbacalkowita', pole_liczbacalkowita2: 'liczbacalkowita', pole_liczbacalkowita3: 'liczbacalkowita' }
	
	
    
    for(i=0;i<f.elements.length;i++){
		
      E=f.elements[i];
			
			
			
			//alert (E.getAttribute('id'));
     
      if(rodz=this.rodzajePol[items[E.getAttribute('id')]])
      
        if(!rodz[0].test(E.value)){
          E.focus();
          
          E.select();
         
          
          document.getElementById("error1").style.display = "block";
          
          document.getElementById("error1").innerHTML=(E.getAttribute('komunikat')||rodz[1]);
					
					
         
          return false;          
        } 
    }
    
    
    
    return true;
  }
  
  
  
}


function zliczanie(pole, nazwa, maxZnak) {
    if (pole.value.length > maxZnak)
        {pole.value = pole.value.substring(0, maxZnak);}  
    else
        {nazwa.value = maxZnak - pole.value.length;}
  }
	
	
function zliczaj(nr_f, nr_l, nr_t) { 
    with(document.forms[0]) { 

        var tekst = elements[nr_t].value; // caĹ‚y text z pola textarea 
        var dl_tresc = elements[nr_t].value.length; // dĹ‚ugoĹ› tekstu z textarea 
        var maxlen = 30; // maxymalna dozwolona dĹ‚ugoĹ›Ä‡ 
        var prawdziwa = 0; // licznik znakĂłw 
        var entery = 0; 
        
        for (i=0; i<dl_tresc; i++) { 
            if (tekst.charAt(i) == "\n") { 

                prawdziwa++; 
                entery++;
 
                if (navigator.appName != "Netscape") 
                    i++; 
            } 
            prawdziwa++; 
        } // koniec for i 
        
        elements[nr_l].value= maxlen - prawdziwa; // wyĹ›wietl komunikat o licznie znakĂłw 
        if (prawdziwa>maxlen) { 
            if (navigator.appName != "Netscape") 
                elements[nr_t].value = elements[nr_t].value.substring(0,maxlen);
            else 
                elements[nr_t].value = elements[nr_t].value.substring(0,maxlen-entery);
    
        elements[nr_l].value = 30 - maxlen; 
        alert("Maksymalna długość to " + maxlen +"!"); 
        } 
    } // koniec with 
} 
	
	
	
function otworz(dokument, szerokosc, wysokosc) {

window.open(dokument,'noweOkno','left=100,top=100,screenX=100,screenY=100, width=' + szerokosc + ', height=' + wysokosc + ', innerWidth=' + szerokosc + ', innerHeight=' + wysokosc + ', directories=0, location=0, menubar=0, scrollbars=1, status=1, toolbar=0, resizable=0')

}	



function zmien(formularz){
             if(formularz.check_all.checked) {
             zaznacz(formularz)} else {
             odznacz(formularz)}}
            
             function zaznacz(formularz){
             for (i = 0; i < formularz.elements.length; i++){
             formularz.elements[i].checked=true}}
            
             function odznacz(formularz){
             for (i = 0; i < formularz.elements.length; i++){
             formularz.elements[i].checked=false }}
