$(function () {

  //$('.my-dropdown-category').sSelect();
  //$('.my-dropdown-product').sSelect();

/**********************
OL Styling             */  

  $('.post ol li').css('font-weight', 'bold').wrapInner('<span></span>').children('span').css('font-weight', 'normal');
  $('#ftr .ewm .hover').css('display', 'none');
  $('#ftr .ewm').hover(
    function() {
      $(this).children('span.hover').css('display', 'inline');
    },
    function() {
      $(this).children('span.hover').css('display', 'none');
    });
    
/**********************
Drop down menu for IE6 */

  $('ul#nav li').hover(
  		function() { $('ul', this).addClass('hover'); },
  		function() { $('ul', this).removeClass('hover'); }
  );
  
  $('#photo').cycle({delay: 1000, speed: 650});
  $('.box2 .img').cycle({
    prev:   '#photoBack', 
    next:   '#photoForward', 
    timeout: 0  
  });

/**********************
Jump for Dropdown in Product Search */

  $('.my-dropdown-category').change(
    function(){
      var str = "";
      str = $(".my-dropdown-category option:selected").attr('value');
      //alert('/products-labels/' + str + '/');
      window.location = '/products-labels/' + str + '/';
    }
  );

/**********************
The Ajax Connection to get Product Info */

	$('.my-dropdown-product').change(function(){
		$("#productSearch .textArea p").empty();
		$("#productSearch .textArea p").append("<span class=\"imgcenter\"><img src=\"/wp-content/plugins/ewm-product-manager/includes/images/loading.gif\" style=\"padding-top:7px;\" alt=\"Loading\" /></span>");
		
    elementid = $(".my-dropdown-product option:selected").attr('value');
    $.get("/",
		{ewm_pm_action: "ajaxgrab", ewm_pm_ajaxid: elementid},
		function(data) {
			$("#productSearch .textArea").empty();
			$("#productSearch .textArea").html(data);
		});
	});


});