function zmien(obiekt)
{
 obiekt.style.backgroundColor='#CECABB';
}

function odmien(obiekt)
{
 obiekt.style.backgroundColor='#DDD8C6';
}


noweOkienko = null;
function obraz(src, w, h, tyt){
if(window.screen){
 aw=screen.availWidth;
 ah=screen.availHeight;
}else{
 aw=640;
 ah=450;
}
if(noweOkienko==null || noweOkienko.closed){
 ustawienia=
 "left=" + (aw-w)/2 + ","
 +"top=" + (ah-h)/2 + ","
 +"screenX=" + (aw-w)/2 + ","
 +"screenY=" + (ah-h)/2 + ","
 +"width=" + w + ","
 +"height=" + h + ","
 +"innerWidth=" + w + ","
 +"innerHeight=" + h + ","
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=no,"
 +"resizable=no"
 noweOkienko = window.open("",'obrazek',ustawienia);
}
noweOkienko.document.open();
noweOkienko.document.clear();
noweOkienko.document.write(
"<html><head>\n"
+"<title>" + tyt + "</title>\n"
+"<style><!--\n"
+"body{background-repeat:no-repeat}\n"
+"--></style>\n"
+"</head>\n"
+"<body background=" + src + "></body>\n"
+"</html>"
);
noweOkienko.document.close();
noweOkienko.focus();
}

$(document).ready(function(){

  $('.popup-dialog').click(function(){
    
    w = screen.width;
    h = screen.height;

    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;

    if (wleft < 0) { w = screen.width; wleft = 0; }
    if (wtop < 0) { h = screen.height; wtop = 0; }

    var win = window.open($(this).attr('href'), $(this).attr('name'), "width="+w+",height="+h+",menubar=no,location=no,resizable=no,scrollbars=yes,status=no");
    win.resizeTo(w, h);
    //win.moveTo(wleft, wtop);
    win.focus();
    
    return false;
  });
});

