﻿  // copyright 2008 Steve Messenger Digital Commerce SLW Inc.

  // jQuery onload
  $(document).ready(function(){
    // add image grid fade effect .myGrid
//    var jQueryContext = $(".myGrid")
//    if(jQueryContext){
//       jQueryContext.hover(
//        function(){$("img", jQueryContext).fadeTo(500,0.6); } ,
//        function(){$("img", jQueryContext).fadeTo(500,1); }
//      );
//      //$("img", jQueryContext).addClass("notSelected")
//      $("img", jQueryContext).hover(imageGridOver, imageGridOut)  
//    }
//    
    // dropList drop menu 
    var ml = $(".dropList")
    if(ml) {
      $(".dropListGroups", ml).hide();
      ml.hover(showdropList, hidedropList)
      $(".dropListButtonInner a").click(hidedropList)
      //$(".dropListButtonInner", ml).css("background-image","url(../images/graphicsTheme/arrowRight.gif)")
      //$(".dropListItem", ml).mouseover(showPreviewImage)
    }
  })
  function imageGridOver() {
    $(this).fadeTo(0, 1);
  }
  function imageGridOut() {
    $(this).fadeTo(0, 0.6);
  }


  function showPreviewImage() {
    var ml = $(".dropList");
    var previewer = $(".dropListPreview img", ml)[0];
    // previewer may not be supported
    if (previewer) {
      var thisImage = $("img", this)[0];
      previewer.src = thisImage.src;
    }
    //alert(previewer.alt);
  }

  function resetPreviewImage(thisList) {
    //var ml = $(".dropList");
    var previewer = $(".dropListPreview img", thisList)[0];
    if (previewer) {
      var defaultVal = $("#dropListPreviewDefault", thisList).val();
      previewer.src = defaultVal;
    }
  }

  function showdropList(){
    $(".dropListGroups", this).show(0); //was 300
    $(".dropListButtonInner", this).css("background-image","url(../images/graphicsTheme/arrowDown.gif)")
  }
  var thisList
  var allLists
  function hidedropList(){
    resetPreviewImage(this)
    // changed so that all drop lists are colapsed on page
    $(".dropListButtonInner", this).css("background-image","url(../images/graphicsTheme/arrowRight.gif)")
    allLists = $(".dropListGroups")
    thisList = $(".dropListGroups", this)
    allLists.hide(0);
    // make sure the list that triggered this stays hidden even if show was triggered at same time
    setTimeout("thisList.hide(0);",200)
  }

