function a_blur() {
	
	var arr = document.getElementsByTagName( 'a' );
	for( i=0; i<arr.length; i++ ) {

	arr[i].setAttribute('onFocus', 'blur()');
	
	}
}





function validate(f){
var v,i,e
for(i=0;e=f[i++];)
  if(v=window[e.getAttribute('valid')]){   
   if(!v(e.value))
    {    
    alert(e.getAttribute('alert'));e.focus();return 1}
    }
}

function niepuste(x){return x>''}
function ismail(e){return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e))||(e=='')}
function noempymail(e){return (/^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e))>''}
function isnumopt(x){return x==~~x}
function isnum(x){return x==parseInt(x)}
function iscnum(x){return (/[\d]/.test(x))>''}
function istel(e){return (/\+[0-9]{11,18}/.test(e))>''}

function submitForm(){
  if(!validate($('contact').elements)) window.document.contact.submit();
}

function clearfield(element,wartosc){
  if(element.value==wartosc){
      element.value = ""
      element.style.textAlign='left';      
      element.style.color="#0d386f";
    }
}

function submfield(element,wartosc){
  if($('fraza').value!=wartosc && $('fraza').value!=''){
  $(element).submit();
  }
}

function submfield2(element){
  if($('fraza2').value!=''){
  $(element).submit();
  }
}


function subscribe(element,co){
 if($('newsletterId').value!=''){
 $('newsletterAction').value=co
  $(element).submit()
  }
}

function checkForm(element){
ns = wymagane.split(",")
for(a=0;a<ns.length;a++){
tm = ns[a]
  $(element).elements[tm].style.border = "1px solid #fa9c1d"
}
}
// onsubmit="return(!validate(this.elements))"
function submitform(element){
  ns = wymagane.split(",")
    dalej = false;
    for(a=0;a<ns.length;a++){
      tm = ns[a]
      if(tm=='zgoda') dalej = $(element).elements[tm].checked
      else dalej = niepuste($(element).elements[tm].value)        
   }
  
  if(dalej) $(element).submit();
  else alert(subalert)
}

function printMe() {  
  ppage = $('drukowalne').innerHTML
	newWindow = window.open("","PrintWindow","width=400,height=600,scrollbars=no")
	newWindow.document.open()
	newWindow.document.write('<html><title>BIP.DPIN.PL</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="10" marginwidth="10">') 	
	newWindow.document.write(ppage) 	
	newWindow.document.write('</body></html>')
	newWindow.document.close()
  newWindow.print();
	newWindow.close();
}


