jQuery(document).ready(function() {
  jQuery('.getcat').live('click', function(){
    var catId = jQuery(this).attr('catid');
    jQuery('.subcat').removeClass('active');
    jQuery('#wpc-'+catId).addClass('active');   
    jQuery('#catalogocontent').html('<div style="display:block; text-align:center; padding:50px 0px 0px 0px; width:660px; font:normal 0.8em Arial; color:red;" id="loader"><img src="http://www.samboro.com/wp-content/themes/samboro/images/ajax-loader.gif" width="35" height="35" alt="cargando...." /><br />Cargando.....</div>');
    jQuery.ajax({
      url:"/wp-admin/admin-ajax.php",
      type:'POST',
      data:'action=getcat&catid=' + catId,
      //data:'action=getcats&catid=' + catId,
      success:function(results) {
      		jQuery("#catalogocontent").html(results);
      }
    });     
    
    //load_wpcategory_content(catId);
    return false;
  });
  
  /* 
  ** Get a product list
  */
  jQuery('.getprds').live('click', function(){
    var catId = jQuery(this).attr('catid');
    
    jQuery('#catalogocontent').html('<div style="display:block; text-align:center; padding:50px 0px 0px 0px; width:660px; font:normal 0.8em Arial; color:red;" id="loader"><img src="http://www.samboro.com/wp-content/themes/samboro/images/ajax-loader.gif" width="35" height="35" alt="cargando...." /><br />Cargando.....</div>');
    jQuery.ajax({
      url:"/wp-admin/admin-ajax.php",
      type:'POST',
      data:'action=getprds&catid=' + catId,
      success:function(results) {
        jQuery("#catalogocontent").html(results);
      }
    }); 
    return false;
  });
  
  if(jQuery('.scrollable').length>0){
    // initialize scrollable
    jQuery(".scrollable").scrollable();  
  }


  if(jQuery('.overlay').length>0){
    // initialize scrollable
    jQuery(".overlay").overlay();  
  }
  
  jQuery('.set-image').click(function(){
    href = jQuery(this).attr('href');
    jQuery('.imgprg a img').attr('src', href);
    
    return false;
  });
  
  jQuery('.set-color').click(function(){
    href = jQuery(this).attr('imgset');
    jQuery('.imgprg a img').attr('src', href);
    
    return false;
  });

});


