( function($) {
$(document).ready(function() {
  $("ul li:first-child").addClass("firstchild");
  $("ul li:last-child").addClass("lastchild");
  
  $("#widgetshoppingcart").hide(); 

	  $("a.showcart").click(function()
	  {
		$(this).next("#widgetshoppingcart ").slideToggle(500);
		$(this).toggleClass('hide');
	  });
	  
	  // Gold gallery
	  $(".gallery #zoom > img").bind('click', function(){
     var thumbname = $(this).attr('alt');
      //$(".MagicZoom img.product_image").css('display','block');
      $(".MagicZoom img.product_image").attr('src','/wp-content/uploads/'+ thumbname +'-400x400.jpg');
      $(".MagicZoom .MagicZoomBigImageCont img").attr ('src','/wp-content/uploads/'+ thumbname +'.jpg');
	  
    });
	  
	    // shipping method click
     if($(".table-4 input:radio").is(":checked"))
      {$("tr.ses_weightcountryregion_shipping_0").removeClass('shippingclick');}
      $(".table-4 input:radio").click(function()
      {$("tr.ses_weightcountryregion_shipping_0").css('background','#fff');}
     );
    
    // shopping cart csv - credit card pmt
    var whatisthis = '<span class="ccwhatisthis">What is this</span>'; 
    var csvonthecard = '<div class="csvonthecard"></div>';
    $(".wpsc_checkout_form_22").append(whatisthis);
    $("body").append(csvonthecard); 
    $(".ccwhatisthis").hover(function(){
    var position =$(this).position();
    var toppos = position.top;
    var leftpos = position.left;
    $(".csvonthecard").css({'top': toppos , 'left':leftpos, 'position':'absolute', 'margin-top':'14px','margin-left':'10px', 'display':'block' });
    },
    function(){
    $(".csvonthecard").css({'display':'none'});
    });
    
    // Products landing page grid Show All, Hide part
    //var blocklimit = 4;
    //var gridsize = $(".product_grid_display").parent().children('ul').size();
    //for (i=blocklimit;i<=gridsize;i++) {
    // $(".product_grid_display").parent().children('ul:eq('+i+')').css({'display':'none'});
    //}
     // var $elem = $('#content');
    // $(".narrowcolumn .products_viewall span").toggle(function(e){
    
    // $(".product_grid_display").css({'display':'block'});
     // $('html, body').animate({scrollTop: $elem.height()}, 1200);
    // },
    // function(){
     // for (i=blocklimit;i<=gridsize;i++) {
     //  $(".product_grid_display").parent().children('ul:eq('+i+')').css({'display':'none'});
     // }   
     // });

     
    
});

} ) ( jQuery );
