function printContents(lang,co,typ)
{
	iWidth = window.screen.width;
	iHeight = window.screen.height;
    wt = 630;
    ht = 460;
    lt = (iWidth - wt) / 2;
    tp = (iHeight - ht) / 2;
    window.open("print.php?lang="+lang+"&co="+co+"&typ="+typ, '', 'height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,resizable=no,scrollbars=yes');
}


function popup (wys, szer, zrodlo, nr, id)
	{
	szer = szer+20;
	wys = wys+70;
	var misiu = "./show3.php?img=" + zrodlo + "&nr="+nr+"&id="+id+"";
	okno = window.open(misiu,"okno", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,dependent=yes,width=" + szer + ",height=" + wys + ",top=10,left=10");
	okno.focus();
	}
	
	
		
	
	

function checkFormZapytanieOgolne(){

var email = document.getElementById('email1').value ;
var emailPat=/^(.+)@(.+)\.(.+)$/ ;
var matchArray=email.match(emailPat);
var komunikat='';

  //komunikat+=sprawdzPole('firma',"- Podaj nazwę firmy\n");
  komunikat+=sprawdzPole('nazwisko',"- Wpisz dane osobowe lub nazwę firmy\n");
  komunikat+=sprawdzPole('telefon',"- Podaj telefon kontaktowy\n");
  komunikat+=sprawdzPole('trescmail',"- Wpisz treść pytania\n");
  
  if (email=='')
    komunikat+="- Podaj e-mail\n";
    
  
  if (email!='' && matchArray==null)
  komunikat+="* podany adres e-mail jest niewłaściwy\n";

  if(komunikat!=''){
    alert("Wypełnij wymagane pola:\n\n"+komunikat);
    return false;
  }
  else{
    return true;
  }
}







function checkFormZapytanieOgolneS(){

var email = document.getElementById('emailf').value ;
var emailPat=/^(.+)@(.+)\.(.+)$/ ;
var matchArray=email.match(emailPat);
var komunikat='';

  //komunikat+=sprawdzPole('firma',"- Podaj nazwę firmy\n");
	
 	komunikat+=sprawdzPole('firma',"- Wpisz nazwę firmy,nazwę instytucji\n");

 komunikat+=sprawdzPole('adres',"- Wpisz adres\n");
  komunikat+=sprawdzPole('osoba',"- Wpisz osobę kontaktową\n");
   komunikat+=sprawdzPole('produkt',"- Wpisz nazwę produktu\n");
	 komunikat+=sprawdzPole('model',"- Wpisz model\n");
	  komunikat+=sprawdzPole('nr',"- Wpisz numer seryjny\n");	
	  komunikat+=sprawdzPole('karta_gwarancyjna',"- Wpisz numer karty gwarancyjnej\n");
	  komunikat+=sprawdzPole('usterka',"- Wpisz opis usterki\n");

  
  if (email=='')
    komunikat+="- Podaj e-mail\n";
    
  
  if (email!='' && matchArray==null)
  komunikat+="* podany adres e-mail jest niewłaściwy\n";

  if(komunikat!=''){
    alert("Wypełnij wymagane pola:\n\n"+komunikat);
    return false;
  }
  else{
    return true;
  }
}









function checkFormZapytanieOgolne2(){

var email = document.getElementById('emailm').value ;
var emailPat=/^(.+)@(.+)\.(.+)$/ ;
var matchArray=email.match(emailPat);
var komunikat='';


  komunikat+=sprawdzPole('trescmailm',"- Wpisz opis problemu/zapytania\n");
 
  
  if (email=='')
    komunikat+="- Podaj e-mail\n";
    
  
  if (email!='' && matchArray==null)
  komunikat+="* podany adres e-mail jest niewłaściwy\n";

  if(komunikat!=''){
    alert("Wypełnij wymagane pola:\n\n"+komunikat);
    return false;
  }
  else{
    return true;
  }
}



function sprawdzPole(pole,komunikat){
  pole=document.getElementById(pole).value;
  if(!pole || pole=='' || pole==undefined)
    return komunikat;
  else
    return '';
}






