﻿/// <reference path="~/Scripts/External/jquery-1.4.2.js"/>

// first, declare the two namespaces if they do not already exist
if (Adlib == null || typeof (Adlib) != "object") { var Adlib = new Object(); }
if (Adlib.View == null || typeof (Adlib.View) != "object") { Adlib.View = new Object(); }


Adlib.View.Master = function () {

  return {


    Init: function () {
      $j(document).ready(function () {
        //set up the lightbox galeries
        $j('#gallery a').lightBox();

        //search box watermark
        $j("#searchBox input:text").watermark($j("#hdSearchWatermark").val(), { className: 'watermarkInput' });

        //event handlers
        $j("#ButtonPrint").live("click", function () {
          //window.print();
          $j("#MainContainer").jqprint();
        });

        //next and previous keys events
        $j(document).keyup(function (e) {
          if (e.which == '39') {
            if ($j("a.keypressednext").length > 0) {
              window.location = $j("a.keypressednext").attr("href");
            }
          }
          if (e.which == '37') {
            if ($j("a.keypressedprev").length > 0) {
              window.location = $j("a.keypressedprev").attr("href");
            }
          }
        });

      });

    }
  };
} ();


