function przepisz(ch)
{  
// przepisuje dane teleadresowe w formularzu zamówienia
	var pierwszy=new Array();  
	var drugi=new Array();
	
	pierwszy[0]=document.forms["dane_form"]["firma"];		drugi[0]=document.forms["dane_form"]["firma2"];	
	pierwszy[1]=document.forms["dane_form"]["imie"];		drugi[1]=document.forms["dane_form"]["imie2"];	
	pierwszy[2]=document.forms["dane_form"]["nazwisko"];	drugi[2]=document.forms["dane_form"]["nazwisko2"];
	pierwszy[3]=document.forms["dane_form"]["ulica"];		drugi[3]=document.forms["dane_form"]["ulica2"];
	pierwszy[4]=document.forms["dane_form"]["nr"];			drugi[4]=document.forms["dane_form"]["nr2"];
	pierwszy[5]=document.forms["dane_form"]["kod"];			drugi[5]=document.forms["dane_form"]["kod2"];
	pierwszy[6]=document.forms["dane_form"]["miasto"];		drugi[6]=document.forms["dane_form"]["miasto2"];
	
	if(ch.checked)
		for (i=0; i<drugi.length; i++)  drugi[i].value=pierwszy[i].value;
	else
		for (i=0; i<drugi.length; i++)  drugi[i].value='';
}

function show(path,w,h,styl){
  document.write('<embed style="'+styl+'" src="'+path+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="'+h+'" width="'+w+'"></embed>');
}

//validatory formularzy
function validate(f,v,a,x){ for(a=0;x=f[a++];) if((v=window[x.getAttribute('valid')])&&!v(x.value)) {alert(x.getAttribute('alert'));return!x.focus()} }
function niepuste(x){return x>''}
function ismail(e){return /^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e)}

function isthesame()
{
	var obrazek = document.dane_form.Obrazek.value;

	if(document.dane_form.Kod.value == obrazek)
		return true;
	else{
		document.dane_form.Kod.focus();
		return false;
	}
}

function ischecked()
{
	if(document.dane_form.reg.checked)
		return true;
	else
		return false;
}

function chborder(co,jak){ co=document.getElementById(co);  // koloruje ramkę inputtexta przy focusie
  if (jak) {
//    co.style.borderColor="#E06F1F"; 
    co.style.borderWidth="2px"; 
    co.style.margin="1px"; 
  }  
  else {
//    co.style.borderColor="gray" 
    co.style.borderWidth="1px"; 
    co.style.margin="2px"; 
  }  
}
    
//wyswietlanie rozwijanej pomocy
function wiecej(co){
	p=document.getElementById(co);
	p.style.display=(p.style.display=='none'?'':'none');
}
