
function $ ( obj ) { return document.getElementById(obj); }

function _send_biuletyn_test (){
  if ( $('cid_t').checked == true  ) var cid = 'true' ;
  if ( $('cid_n').checked == true  ) var cid = 'false' ;
  
  if (  $('email').value == '' )
    {
    alert ( 'Podaj adres e-mail' );
    $('email').focus();
    } 
  else
    {
    advAJAX.get({
        url: "biuletyn_test/send_message.php?",
        parameters : {
          "email" : $('email').value , 
          "cid" : cid 
        },
        onSuccess : function(obj) { 
        
        $('div_form_b').innerHTML = obj.responseText ;
        
        },
        onError : function(obj) { alert("Error: " + obj.status); }
    });  
    }
  }

function _submit ( form_name , value  ){
  //$('p').value = value ;
  //$(form_name).submit();  
  window.location.href = '?k=portfolio&p=' + value ;
  }
  
function _open (co){
  if ( co == 'szukaj' ) co = 'query=' + document.getElementById('query').value;
  window.location.href= '?' + co ;
  }

form_rej_uslugi_klick = 0 ;

function rejestNask(me){
 var form = document.form_rej_uslugi;
 form.registrar.disabled=me.checked;
 form.authinfo.disabled=me.checked;
 if (me.checked) {
     form.registrar.value="pole zablokowane";
     form.authinfo.value="pole zablokowane";
 } else {
     form.registrar.value="";
     form.authinfo.value="";
 }
}

function dubluj(war, tekst1 , tekst2){

tekst1= document.all(tekst1);
tekst2= document.all(tekst2);
var a=document.form_rej_uslugi.kores_t.value;
if(a=='on' )
{
tekst1.value=war;
tekst2.value=war;
}
}


function dubluj2(){
  if(form_rej_uslugi_klick==0){
  document.form_rej_uslugi.nazwisko_k.value=document.form_rej_uslugi.nazwisko.value;
  document.form_rej_uslugi.ulica_k.value=document.form_rej_uslugi.ulica.value;
  document.form_rej_uslugi.kod_k.value=document.form_rej_uslugi.kod.value;
  document.form_rej_uslugi.poczta_k.value=document.form_rej_uslugi.poczta.value;
  document.form_rej_uslugi.kraj_k.value=document.form_rej_uslugi.kraj.value;
  var a=document.form_rej_uslugi.wojewodztwo.value;
  document.form_rej_uslugi.wojewodztwo_k.value=a;
  form_rej_uslugi_klick=1;
  }
  else{
  form_rej_uslugi_klick=0;
  document.form_rej_uslugi.nazwisko_k.value='';
  document.form_rej_uslugi.ulica_k.value='';
  document.form_rej_uslugi.kod_k.value='';
  document.form_rej_uslugi.poczta_k.value='';
  document.form_rej_uslugi.kraj_k.value='';
  document.form_rej_uslugi.wojewodztwo_k.value='';
  }
}

function dokoszyka (plik){
  var ilosc5 = prompt ("Podaj ilość produktów dodanych do koszyka","1");
  if(ilosc5>0){
    var plik2;
    plik2=plik+'&ilosc='+ilosc5;
    parent.location.href=plik2;
    }
  }

function amenu(div){
 div1= document.getElementById(div);
 div1.style.top= 100;
 }

function amenu2(div){
 div1= document.getElementById(div);
 div1.style.top= -1000;
 }

function pasek(txt){
   window.status = txt;
  }

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function otworz(plik) {

window.location=plik;

}


function produkt_popup(url, displayWindow ){
var Win = window.open(url, displayWindow ,'width=100,height=100,top=30,left=100,resizable=yes,scrollbars=yes,menubar=no');
}
function intro_popup(url, width, height){
var Win = window.open(url,"intro_popup1",'width=' + width + ',height=' + height + ',top=30,left=100,resizable=yes,scrollbars=no,menubar=no');
}


function popup(url ){
var Win = window.open(url, 'mapa' ,'width=100,height=100,top=30,left=100,resizable=yes,scrollbars=yes,menubar=no');
}

function displayWindow(url, width, height){
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',top=30,left=100,resizable=no,scrollbars=no,menubar=no');
}

function displayWindow1(url, width, height){
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',top=20,left=250,resizable=no,scrollbars=no,menubar=no');
}

function displayWindow2(url, width, height){
var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',top=220,left=380,resizable=no,scrollbars=no,menubar=no');
}


function test(){
var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
if (!re_mail.test(emailform.email.value)) {
alert('Podałeś błędny adres email !!!');
}
else { emailform.submit(); }
}
function moveover(txt) {
   window.status = txt;
   setTimeout("erase()",1300);
}
function erase() {
   window.status="";
}


function test1()
{
var re_mail=logowanie_55.email_h.value;
if(logowanie_55.email_h.value=='')
{
alert('Podaj adres e-mail !!!');
}
else
{
logowanie_55.submit();
}



}
function otworz(plik)
{
parent.location.href=plik;
}



function pasek(txt)
{
   window.status = txt;
}

function pasek1(txt)
{
   window.status = txt;

   setTimeout("erase()",1500);
}



 function edit_kat( object0, object1, object2 )
 {

 obiekt0= document.getElementById(object0);
 obiekt1= document.getElementById(object1);
 obiekt2= document.getElementById(object2);

 obiekt0.style.display = '';
 obiekt1.style.display = '';
 obiekt2.style.display = 'none';

  }


 function edit_kat_n( object0, object1, object2 )
 {

 obiekt0= document.getElementById(object0);
 obiekt1= document.getElementById(object1);
 obiekt2= document.getElementById(object2);

 obiekt0.style.display = 'none';
 obiekt1.style.display = 'none';
 obiekt2.style.display = '';

  }


function aktualizujParent(nowyURL)
{
//var ilosc5= document.form_wybor.ilosc_sztuk.value;
//if(ilosc5<0)ilosc=1;
//nowyURL=nowyURL+'&ilosc='+ilosc5;
window.document.location= nowyURL;
alert ('Dodałeś produkt do koszyka');
}


