// SITELIB.JS
// (C) 2006 Yaroslav Chupikov
// www.design.fanspace.com
// freeworld@mail.ru


//---[ showDetails ]----------------------------------------------------------

function showDetails(idx) {
  if (idx != null) {
     if (idx.length > 0) {
        var URL = "details.php?index=" + idx;
        win     = window.open(URL, "win", "toolbar=no,scrollbars=yes,resizable=yes,width=500,height=600");
//        win     = window.open(URL, "win", "");
        } else {
        alert("Индекс товара не указан!\nОбратитесь к разработчику.");
        }
     } else {
     alert("Пустой индекс товара (null)!\nОбратитесь к разработчику.");
     }
  }

//---[ showDetails2 ]---------------------------------------------------------

function showDetails2(idx) {
  if (idx != null) {
     if (idx.length > 0) {
        var URL = "details.php?index=" + idx + "#recomend";
        win     = window.open(URL, "win", "toolbar=no,scrollbars=yes,resizable=yes,width=500,height=600");
//        win     = window.open(URL, "win", "");
        } else {
        alert("Индекс товара не указан!\nОбратитесь к разработчику.");
        }
     } else {
     alert("Пустой индекс товара (null)!\nОбратитесь к разработчику.");
     }
  }

//---[ show ]-----------------------------------------------------------------
// Open new window and show image "img".

function show(img) {
  if (img != null) {
     var win = window.open("about:blank", "win", "width=900,height=700,scrollbars=yes");

     with (win.document) {
       writeln('<html><head><title>Фото</title>');
//       writeln('<link rel="stylesheet" type="text/css" href="main.css">');
//       writeln('<Script language="JavaScript" src="content.js"></scr' + 'ipt>');
       writeln('</head>');
       writeln('<body bgcolor="black" style="background: #000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
       writeln('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="middle">');
//       writeln('<center><font style="color:silver">' + img + '</font></center>\n');
       writeln('<p>');
       writeln('<a href="javascript:window.close();" style="color:gray; font-weight:bold; text-decoration: none">');
       writeln('<center><img src="' + img + '" border="0"></center>');
       writeln('<br>\n<center>закрыть...</center>');
       writeln('</a>');
       writeln('</td></tr></table>');
       writeln('</body>\n</html>');
       }

     }
  }

