function AddPicture(address)
{
PictureWindow = window.open(address, 'okienko', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no')
}

<!--
function snapIn(jumpSpaces,position)
{ var msg = "Home4you.eu"; var out = ""; for (var i=0; i<position; i++) { out += msg.charAt(i) } for (i=1;i<jumpSpaces;i++) { out += " " } out += msg.charAt(position); window.status = out;
if (jumpSpaces <= 1) { position++; if (msg.charAt(position) == ' ') { position++ } jumpSpaces = 100-position }
else if (jumpSpaces >  3) { jumpSpaces *= .09 } else { jumpSpaces-- } if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")"; window.setTimeout(cmd,10); } return true }
//-->

<!-- Hide
function moveover(txt) {
   window.status = txt;
   setTimeout("erase()",10000);
}
function erase() {
   window.status="";
}
// -->

<!-- Begin
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert("Site protected. Copyright Home4you.eu. All rights reserved!");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
//  End -->
function ustaw_styl(elemName,className){
    document.getElementById(elemName).className = className;
}
function select_inputstyle(elemName,className) //zaznacza inputa
{
    document.getElementById(elemName).className = className;
}


function contactform(frm)
{
 if(frm.support_to)
 {
     if(frm.support_to.value == '')
     {
         alert('Proszę wybierz odbiorcę...');
         select_inputstyle('support_to','acts');
         return false;
     }
 }
 if(frm.cfcd_name)
 {
     if(frm.cfcd_name.value == '')
     {
         alert('Proszę podaj swoje imię i nazwisko...');
         select_inputstyle('cfcd_name','acts');
         return false;
     }
 }
 if(frm.cfcd_phone)
 {
     if(frm.cfcd_phone.value == '')
     {
         alert('Proszę podaj swój numer telefonu...');
         select_inputstyle('cfcd_phone','acts');
         return false;
     }
 }
 if(frm.cfcd_questions)
 {
     if(frm.cfcd_questions.value == '')
     {
         alert('Wprowadź treść wiadomości...');
         select_inputstyle('cfcd_questions','acts');
         return false;
     }
 }
 frm.submit();
}

function sprawdz_search(formularz)
{
  for (i = 0; i < formularz.length; i++)
  {
    var pole = formularz.elements[i];
    if (pole.name == "fraza")
    {
		if (pole.value == "Szukane wyrażenie...") {
		  alert("Wpisz szukane wyrażenie !");
		  return;
		}
		if (pole.value == "") {
		  alert("Wpisz szukane wyrażenie !");
		  return;
		}
    }
  }
  formularz.submit();
}



//contactform in your search details
function contactform_searchdetails(frm)
{

 if(frm.cfcd_name)
 {
     if(frm.cfcd_name.value == '')
     {
         alert('Uzupełnij pole NAZWISKO...');
         select_inputstyle('cfcd_name','acts');
         return false;
     }
 }
 if(frm.cfcd_phone)
 {
     if(frm.cfcd_phone.value == '')
     {
         alert('Podaj swój numer telefonu...');
         select_inputstyle('cfcd_phone','acts');
         return false;
     }
 }
 if(frm.cfcd_questions)
 {
     if(frm.cfcd_questions.value == '')
     {
         alert('Wprowadź swoje pytania...');
         select_inputstyle('cfcd_questions','acts');
         return false;
     }
 }
 frm.submit();
}



/* ZMIENNA DO WYSWIETLANIA DUZYCH OBRAZKOW */
  function showImgBig(autoId,nrImg)
  {
  var opcje="status=1,statusbar=1,toolbar=no,menubar=no,scrollbar=no,resizable=1";
  var link = "bigimg.php?id=" + autoId + "&nr=" + nrImg;
  myWin = window.open(link,"windowDisplay",opcje);
  }	
  var nrImg=1;
  function ShowImage(index)
  {
  document.images.zdjecie.src=Slides[index];
  nrImg=index;
  }

  
  
/* DOPISYWANIE NOWEGO OGŁOSZENIA PRZEZ AGENTA */
         function vehicle_category()
         {
           if (document.getElementById('vehicle_category_domy').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_hidden';
           document.getElementById('scrap4').className = 'mk_tab_content_hidden';
           document.getElementById('scrap5').className = 'mk_tab_content_hidden';
           document.getElementById('scrap6').className = 'mk_tab_content_hidden';
           document.getElementById('scrap8').className = 'mk_tab_content_hidden';
           document.getElementById('scrap7').className = 'mk_tab_content_visible';
           }
           if (document.getElementById('vehicle_category_mieszkania').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_hidden';
           document.getElementById('scrap4').className = 'mk_tab_content_hidden';
           document.getElementById('scrap5').className = 'mk_tab_content_hidden';
           document.getElementById('scrap6').className = 'mk_tab_content_hidden';
           document.getElementById('scrap8').className = 'mk_tab_content_visible';
           document.getElementById('scrap7').className = 'mk_tab_content_hidden';
           }
           if (document.getElementById('vehicle_category_dzialki').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_hidden';
           document.getElementById('scrap4').className = 'mk_tab_content_hidden';
           document.getElementById('scrap5').className = 'mk_tab_content_hidden';
           document.getElementById('scrap6').className = 'mk_tab_content_visible';
           document.getElementById('scrap8').className = 'mk_tab_content_hidden';
           document.getElementById('scrap7').className = 'mk_tab_content_hidden';
           }
           if (document.getElementById('vehicle_category_lokale').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_hidden';
           document.getElementById('scrap4').className = 'mk_tab_content_hidden';
           document.getElementById('scrap5').className = 'mk_tab_content_visible';
           document.getElementById('scrap6').className = 'mk_tab_content_hidden';
           document.getElementById('scrap8').className = 'mk_tab_content_hidden';
           document.getElementById('scrap7').className = 'mk_tab_content_hidden';
           }
           if (document.getElementById('vehicle_category_obiekty').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_hidden';
           document.getElementById('scrap4').className = 'mk_tab_content_visible';
           document.getElementById('scrap5').className = 'mk_tab_content_hidden';
           document.getElementById('scrap6').className = 'mk_tab_content_hidden';
           document.getElementById('scrap8').className = 'mk_tab_content_hidden';
           document.getElementById('scrap7').className = 'mk_tab_content_hidden';
           }
           if (document.getElementById('vehicle_category_inwestycje').checked)
           {
           document.getElementById('scrap3').className = 'mk_tab_content_visible';
           document.getElementById('scrap4').className = 'mk_tab_content_hidden';
           document.getElementById('scrap5').className = 'mk_tab_content_hidden';
           document.getElementById('scrap6').className = 'mk_tab_content_hidden';
           document.getElementById('scrap8').className = 'mk_tab_content_hidden';
           document.getElementById('scrap7').className = 'mk_tab_content_hidden';
           }
         }

         function agent_newAd(frm)
         {
           if(frm.agn_county_id)
           {
            if(frm.agn_county_id.value == '')
            {
             alert('Wybierz województwo...');
             select_inputstyle('agn_county_id','dc');
             return false;
            }
           }
           if(frm.agn_gmina)
           {
            if(frm.agn_gmina.value == '' && frm.agn_gmina1.value == '')
            {
             alert('Gmina - uzupełnij pole wymagane...');
             select_inputstyle('agn_gmina','dc');
             return false;
            }
           }
           if(frm.agn_city)
           {
            if(frm.agn_city.value == '' && frm.agn_city1.value == '')
            {
             alert('Miejscowość - uzupełnij pole wymagane...');
             select_inputstyle('agn_city','dc');
             return false;
            }
           }
         frm.submit();
         }
/* DOPISYWANIE NOWEGO OGŁOSZENIA PRZEZ AGENTA - KONIEC */























/* ZAZNACZANIE I ZMIANA KOLORU TR PO NAJECHANIU */
var marked_row = new Array;
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;
    if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined')
    {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined')
    {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined')
    {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined')
    {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    }

//Opera
    if (currentColor.indexOf("rgb") >= 0)
    {
        var rgbStr = currentColor.slice(currentColor.indexOf('(') + 1,
                                     currentColor.indexOf(')'));
        var rgbValues = rgbStr.split(",");
        currentColor = "#";
        var hexChars = "0123456789ABCDEF";
        for (var i = 0; i < 3; i++)
        {
            var v = rgbValues[i].valueOf();
            currentColor += hexChars.charAt(v/16) + hexChars.charAt(v%16);
        }
    }

// Definiowanie nowego koloru
    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }

//Domyślny zaznaczony kolor
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase() && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    }

//Ustawienie nowego koloru

    if (newColor) {
        var c = null;
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
        }
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    }
    return true;
}
/* KONIEC - ZAZNACZANIE I ZMIANA KOLORU TR PO NAJECHANIU */



















//NOTATNIK
/*Obsluga Cookies*/

function cookie_ustaw (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
  ((expires) ? "; expires=" + expires.toGMTString() : "") +
  ((path) ? "; path=" + path : "") +
  ((domain) ? "; domain=" + domain : "") +
  ((secure) ? "; secure" : "");
}

function cookie_pobierz_wartosc(offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1){
      endstr = document.cookie.length;
  }
  return unescape(document.cookie.substring(offset, endstr));
}

function cookie_pobierz (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg){
          return cookie_pobierz_wartosc(j);
      }
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
  }
  return null;
}

function div_rozpoznaj(warstwa){
 if(document.all){
     warstwa = document.all(warstwa)
 }else
     if(document.getElementById){
         warstwa = document.getElementById(warstwa)
     }else
         if(document.layers){
             warstwa = document.layers[warstwa]
         }
 return warstwa;
}

function div_wpisz(text,warstwa){
  obiekt = div_rozpoznaj(warstwa);
  obiekt.innerHTML = text;
}

function schowek_rysuj(){
  var ciastko = cookie_pobierz('schowek');
  var schowek_zawartosc = '';

  if( (ciastko != null ) && (ciastko != '') ){
      schowek_elementy = ciastko.split(':');
      for(i=0; i < schowek_elementy.length; i++){
          schowek_element = schowek_elementy[i].split(',');
          schowek_zawartosc ='';
          /*
          schowek_zawartosc += schowek_element[2] +
          ' [<a href="#" onclick="schowek_usun(' + "'" + schowek_element[0] + "'," +
          "'" + schowek_element[1] + "'" + '); schowek_rysuj();">usuń</a>] <br /><br />';
          */
      }
      //schowek_zawartosc += '<a href="index.php?statesSearchNotes" target="_self">przejdź do notatnika &raquo;</a><br /><br />';
      div_wpisz(schowek_zawartosc,'schowek');
      //div_wpisz('<a href="index.php?statesSearchNotes" target="_self"> porównanie ofert &raquo;</a><br /><br />','schowek_link');

  }else{
      //div_wpisz('Twój notatnik jest pusty, aby dodać ogłoszenie do notatnika kliknij w polu z opisem - dodaj do notatnika.','schowek');
      div_wpisz('&nbsp;','schowek_link');
  }

  return '';
}


function schowek_dodaj(value){

  var expdate = new Date ();
  expdate.setTime (expdate.getTime() + (30*24 * 60 * 60 * 1000));

  var ciastko = cookie_pobierz('schowek');
  var value_tablica = value.split(',');
  var brak_w_schowku = true;

  if( (ciastko != null ) && (ciastko != '') ){
      schowek_elementy = ciastko.split(':');
      for(i=0; i < schowek_elementy.length; i++){
          schowek_element = schowek_elementy[i].split(',');
          if( ( value_tablica[0] == schowek_element[0] )
            &&( value_tablica[1] == schowek_element[1] ) ){
            brak_w_schowku = false;
          }
      }

      if(brak_w_schowku){
          ciastko += ':' + value;
      }
      cookie_ustaw('schowek',ciastko,expdate,"/","","");
  }else{
      cookie_ustaw('schowek',value,expdate,"/","","");
  }
}


function schowek_usun(rodzaj,value){

  var expdate = new Date ();
  expdate.setTime (expdate.getTime() + (2*24 * 60 * 60 * 1000));

  var ciastko = cookie_pobierz('schowek');
  var ciastko_nowe = '';

  if( ciastko != '' ){
      schowek_elementy = ciastko.split(':');
      for(i=0; i < schowek_elementy.length; i++){
          schowek_element = schowek_elementy[i].split(',');
          if( ( schowek_element[0] == rodzaj )
            &&( schowek_element[1] == value ) ){
          }else{
              ciastko_nowe += schowek_elementy[i] + ':';
          }
      }

      ciastko_nowe = ciastko_nowe.substring(0,ciastko_nowe.length - 1);
      cookie_ustaw('schowek',ciastko_nowe,expdate,"/","","");
  }
}

function wyczysc_schowek(){
    cookie_ustaw('schowek','',0,"/","","");
}
//KONIEC NOTATNIKA


