(function (jQuery) {
  jQuery.fn.superfish = function (op) {
    var sf = jQuery.fn.superfish,
      c = sf.c,
      $arrow = jQuery(['<span class="', c.arrowClass, '"> &#187;</span>'].join('')),
      over = function () {
      var $$ = jQuery(this),
        menu = getMenu($$);
      clearTimeout(menu.sfTimer);
      $$.showSuperfishUl().siblings().hideSuperfishUl();
    },
      out = function () {
      var $$ = jQuery(this),
        menu = getMenu($$),
        o = sf.op;
      clearTimeout(menu.sfTimer);
      menu.sfTimer = setTimeout(function () {
        o.retainPath = (jQuery.inArray($$[0], o.$path) > -1);
        $$.hideSuperfishUl();
        if (o.$path.length && $$.parents(['li.', o.hoverClass].join('')).length < 1) {
          over.call(o.$path);
        }
      },
      o.delay);
    },
      getMenu = function ($menu) {
      var menu = $menu.parents(['ul.', c.menuClass, ':first'].join(''))[0];
      sf.op = sf.o[menu.serial];
      return menu;
    },
      addArrow = function ($a) {
      $a.addClass(c.anchorClass).append($arrow.clone());
    };
    return this.each(function () {
      var s = this.serial = sf.o.length;
      var o = jQuery.extend({},
      sf.defaults, op);
      o.$path = jQuery('li.' + o.pathClass, this).slice(0, o.pathLevels).each(function () {
        jQuery(this).addClass([o.hoverClass, c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);
      });
      sf.o[s] = sf.op = o;
      jQuery('li:has(ul)', this)[(jQuery.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over, out).each(function () {
        if (o.autoArrows) addArrow(jQuery('>a:first-child', this));
      }).not('.' + c.bcClass).hideSuperfishUl();
      var $a = jQuery('a', this);
      $a.each(function (i) {
        var $li = $a.eq(i).parents('li');
        $a.eq(i).focus(function () {
          over.call($li);
        }).blur(function () {
          out.call($li);
        });
      });
      o.onInit.call(this);
    }).each(function () {
      var menuClasses = [c.menuClass];
      jQuery(this).addClass(menuClasses.join(' '));
    });
  };
  var sf = jQuery.fn.superfish;
  sf.o = [];
  sf.op = {};
  sf.c = {
    bcClass: 'sf-breadcrumb',
    menuClass: 'sf-js-enabled',
    anchorClass: 'sf-with-ul',
    arrowClass: 'arrow'
  };
  sf.defaults = {
    hoverClass: 'sfHover',
    pathClass: 'overideThisToUse',
    pathLevels: 1,
    delay: 500,
    speed: 'normal',
    autoArrows: true,
    disableHI: false,
    // true disables hoverIntent detection
    onInit: function () {},
    // callback functions
    onBeforeShow: function () {},
    onShow: function () {},
    onHide: function () {}
  };
  jQuery.fn.extend({
    hideSuperfishUl: function () {
      var o = sf.op,
        not = (o.retainPath === true) ? o.$path : '';
      o.retainPath = false;
      if (isIE) {
        css1 = {
          marginLeft: 20
        };
      } else {
        css1 = {
          opacity: 0,
          marginLeft: 20
        };
      }
      var $ul = jQuery(['li.', o.hoverClass].join(''), this).add(this).not(not).removeClass(o.hoverClass).find('>ul').animate(css1, 150, 'swing', function () {
        jQuery(this).css({
          display: "none"
        })
      });
      o.onHide.call($ul);
      return this;
    },
    showSuperfishUl: function () {
      var o = sf.op,
        $ul = this.addClass(o.hoverClass).find('>ul:hidden').css('visibility', 'visible');
      o.onBeforeShow.call($ul);
      if (isIE) {
        css1 = {
          display: "block",
          marginLeft: 20
        };
        css2 = {
          marginLeft: 0
        };
      } else {
        css1 = {
          display: "block",
          opacity: 0,
          marginLeft: 20
        };
        css2 = {
          opacity: 1,
          marginLeft: 0
        };
      }
      $ul.css(css1).animate(css2, 150, 'swing', function () {
        o.onShow.call($ul);
      });
      return this;
    }
  });
})(jQuery);


// JavaScript Document
jQuery(function($){
				jQuery("#top-menu ul,#nav ul").superfish({autoArrows:false});
				jQuery("img[src$='png'],.box,.line").pngfix();
				jQuery("#top-menu ul li,#top-menu ul li ul.sub li").hover(function(){ jQuery(this).addClass('hover')},
												function(){jQuery(this).removeClass('hover')}
														 
														 );
				
				
				jQuery("ul.large li.item0").fadeIn('slow');
				jQuery("ul.thum li").hover(function(){jQuery(this).children('img').css("border-color","#a38555")},function(){jQuery(this).children('img').css("border-color","#cccccc")});
				jQuery("ul.thum li").click(function(){
													  var items = jQuery(this).attr("class");
													  jQuery("ul.large li." + items).siblings().hide();
													  jQuery("ul.large li." + items).fadeIn('slow');
													  });
				jQuery("input#email").focus(
										function(){
											if(jQuery(this).val()=="ENTER EMAIL"){jQuery(this).val("");}
										}
										);
				jQuery("input#email").blur(
										function(){
											if(jQuery(this).val()==""){jQuery(this).val("ENTER EMAIL");}
										}
										);
				jQuery("#submit").hover(
										function(){jQuery(this).css("background-position","left bottom")},
										function(){jQuery(this).css("background-position","left top")}
										);
				
				jQuery("#nav ul.menu li").hover(
										function(){jQuery(this).addClass("hover")},
										function(){jQuery(this).removeClass("hover")}			
												);

				
				});