 function show_ct_friends(id)
  {
		advAJAX.get({
			url: "http://www.carp-team.com/new/show.php?id=" + id,
			onSuccess : function(obj) { document.getElementById('show_friends').innerHTML = obj.responseText; },
			onError : function(obj) { alert("Error: " + obj.status); }
		});
  }



  function check_item()
   {
     var pict = document.getElementById('i1').value;
     var desc = document.getElementById('i2').value;
     var pric = document.getElementById('i3').value;

     if( document.getElementById('i4').checked )
       {
        document.getElementById('s1').style.visibility='hidden';

        if( pict.length == 0 || desc.length == 0 || pric.length == 0 )
          {
            act = confirm('Nie uzupełniłeś wszystkich danych !\nCzy mimo to zapisać ogłoszenie ?');
             if( act == false )
               { document.getElementById('s1').style.visibility='visible'; return false; }
             else { return true; }
                
          }
       }
     else
       {
          alert('Musisz wyrazić zgodę na warunki zamieszczania ogłoszeń !');
          return false;
       }
   }



   function popup(url) 
    {
     okno = window.open(url,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
     okno.focus();
    }

   function haha()
    {
      if( document.getElementById('kw').value.length < 3 )
        {
          alert('Wpisz co najmniej 3 znaki !');
          return false;
        }
    }

   function ChckRegister()
    {
	
	var nick1 = document.getElementById('nick1').value;
	var pswd1 = document.getElementById('pswd1').value;
	var pswd2 = document.getElementById('pswd2').value;
	var name = document.getElementById('name').value;
	var city = document.getElementById('city').value;
	var mail = document.getElementById('mail').value;
      var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi");
      var wynik = re.test(mail);

 	var error = 0;
	var msg = '';


      if(nick1.length < 5) { msg = msg + "Login musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(pswd1.length < 5) { msg = msg + " Hasło musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(pswd1 != pswd2 ) { msg = msg + " Hasło i jego powtórzenie są niezgodne \n"; error = 1; }
      if(name.length < 5) { msg = msg + " Nazwisko i imię musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(city.length < 5) { msg = msg + " Nazwa miejscowości musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(wynik == false) { msg = msg + " Adres e-mail jest nieprawidłowy \n"; error = 1; } 
      if(!document.getElementById('accept').checked) { msg = msg + " Przy braku akceptacji warunków regulaminu dalsza rejestracja jest niemozliwa \n"; error = 1; }

      if (error == 1)
	  {
          alert(msg); return false;
        }
    }

   function ChckProf()
    {
	
	var name = document.getElementById('name').value;
	var city = document.getElementById('city').value;
	var mail = document.getElementById('mail').value;
      var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi");
      var wynik = re.test(mail);

 	var error = 0;
	var msg = '';


      if(name.length < 5) { msg = msg + " Nazwisko i imię musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(city.length < 5) { msg = msg + " Nazwa miejscowości musi zawierać co najmniej 5 znaków \n"; error = 1; }
      if(wynik == false) { msg = msg + " Adres e-mail jest nieprawidłowy \n"; error = 1; } 

      if (error == 1)
	  {
          alert(msg); return false;
        }
    }

function chckPswd()
    {
	var msg = '';
      var error = 0;
	var _old = document.getElementById('_ps1').value;
	var _new = document.getElementById('_ps2').value;
	var _con = document.getElementById('_ps3').value;

      if(_old.length < 6) { document.getElementById('_ps1').style.background='#FF0000'; error = 1; }
      if(_new.length < 6) { document.getElementById('_ps2').style.background='#FF0000'; error = 1; }
      if(_con.length < 6) { document.getElementById('_ps3').style.background='#FF0000'; error = 1; }

     if(error == 1) { return false; }
    }

function ChckNewPost()
	{
		var subj = document.getElementById('subj').value;
		var desc = document.getElementById('desc').value;

		if(subj.length < 5 || desc.length < 5)
			{
				alert('Proszę uzupełnić dane'); 
				return false;
			}
	}

function InputShow(chck,textar)
	{
        if(document.getElementById(chck).checked) 
         { document.getElementById(textar).style.display='block';  } 
        else 
         { document.getElementById(textar).style.display='none';  }
  	}

function powieksz(nazwa,szer,wys) 
{
     config='left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes';
     stadion=window.open('','x',config);
     stadion.document.writeln('<html><head>');
     stadion.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"/>');
     stadion.document.writeln('<title>Pelny rozmiar</title>');
     stadion.document.writeln('</head>');
     stadion.document.writeln('<body style="padding:0px; margin:0px;">');
     stadion.document.writeln('<a href="javascript:self.close();"><img name="obr" src="'+nazwa+'" alt="image"/></a>');
     stadion.document.writeln('</body></html>');
     stadion.focus();
}

function cytat()
 {
   document.getElementById('desc').value = document.getElementById('desc').value + document.getElementById('cytat').innerHTML;
 }
    

function MailForm()
 {
  
  var mail = document.getElementById('mailbox');
  var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi");
  var wynik = re.test(mail.value);

  if(wynik == false ) 
    { 
      alert('Adres e-mail jest nieprawidłowy.'); 
       mail.value='';
       mail.focus();
      return false; 
    }

 }
