function show_photo(url)
{
/*
  newwindow = window.open(url,'name','height=600,width=800,top=0,left=0');
  if (window.focus) {
    newwindow.focus()
  }
*/
  window.location.href=url;
}

function popup(url)
{

  newwindow = window.open(url,'name','scrollbars=yes','height=420,width=760,top=0,left=0');
  if (window.focus) {
    newwindow.focus()
  }

}

// ------------------------------------------------ AJAX spotlight search ------------------------------------------------
var old = '';

dolivesearch = function () {
  res = $('spotlightresults');
  qry = $('spotlightquery').value;
  if (qry != old) {
    if (qry == '' || qry == 'Livesearch website . . .') {
      res.innerHTML = '';
      res.style.display = 'none';
    } else
      intraxxion.submitform('DesignerTemplates/spotlightresults.html', $('livesearch'), displayresults);
  }
  old = qry;
  setTimeout('dolivesearch()', 700) ;
};
initsearch =function () {
  dolivesearch();
};

displayresults = function (data) {
  $('spotlightresults').style.display = 'block';
  $('spotlightresults').innerHTML = data.responseText;
};

// ------------------------------------------------ Page initialization --------------------------------------------------
connect(window, 'onload',
  function(evt) {
    initial_height();
    try {
      initsearch();
    } catch(e) {log(e);}
  }
);

/*
connect(window, 'onresize', 
  function(evt) {
    log('resize');
    initial_height();
  }
);
*/
function initial_height() {
  vp = getViewportDimensions();
  cd = getElementDimensions($('container'));
  fd = getElementDimensions($('footer'));
  if (document.all) {
    // Fix IE bugs
    if (document.documentElement && document.documentElement.clientHeight) {
      vp.h = document.documentElement.clientHeight;
    } else if (document.body) {
      vp.h = document.body.clientHeight;
    }
  }
  if ((cd.h+fd.h) <= vp.h) {
    cd.h = vp.h - fd.h;
    $('container').style.height = cd.h+'px';
  }
}


