﻿
  // jQuery onload
  $(document).ready(function(){
    // add image grid fade effect .myGrid
    var jQueryContext = $(".myGrid")
    if (jQueryContext) {
      $("img.icon", jQueryContext).hover(imageGridOver, imageGridOut)
    }
    // hover fade-in-out effect
    //if (jQueryContext) {
       //jQueryContext.hover(
       // function(){$("img.icon", jQueryContext).fadeTo(0,0.5); } ,
       // function(){$("img.icon", jQueryContext).fadeTo(0,1); }
      //);
      // //$("img", jQueryContext).addClass("notSelected")
     //}
   
    // moreList drop menu 
    var ml = $(".moreList")
    if(ml) {
      $(".moreListItems", ml).hide();
      ml.hover(showMoreList, hideMoreList) 
      $(".moreListButtonInner", ml).css("background-image","url(../imageDb/theme/arrowRight.gif)")
    }
  })

  function imageGridOver(){
    //$(this).fadeTo(0, 1); // <-- hover fade-in-out effect
    $("#" + this.id + "caption").addClass("hoverColor")
  }
  function imageGridOut(){
    //$(this).fadeTo(0, 0.5); // <-- hover fade-in-out effect
    $("#" + this.id + "caption").removeClass("hoverColor")
  }

  function showMoreList(){
    $(".moreListItems", this).show(200);
    $(".moreListButtonInner", this).css("background-image","url(../imageDb/theme/arrowUp.gif)")
  }
  var objectToHide
  function hideMoreList(){
    $(".moreListButtonInner", this).css("background-image","url(../imageDb/theme/arrowRight.gif)")
    objectToHide = $(".moreListItems", this)
    objectToHide.hide(0);
    // make sure it stays hidden even if show was triggered at same time
    setTimeout("objectToHide.hide(0);",300)
  }

  function showHide(elId){
//      var el = document.getElementById(elId);
//      if (el.style.display=="block")el.style.display="none";
//      else el.style.display="block"
//      return false;
  }
