$(document).ready(function(){

    $("#slider").show().easySlider({
                    continuous: true,
                    controlsBefore:	'<div class="MenuGrayTitle glossytitle" id="slidercontrolstop"><span>Featured Vendor</span><div>',
                    controlsAfter:		'</div></div>',
                    speed:500
    });

    $("a.letter").click(function(){
    
        var currentLetter = $(this).attr('title');
        var loadUrl = "/member_filter.php";
        var ajax_load = "<span style='width:100%;text-align:center;float:left;padding-top:6px;'><img style='margin:0 auto;' src='/skin1/images/custom/ajax-loader.gif' alt='loading...' /></span>";  
        //$("#load_basic").click(function(){
        $("#MemberList").html(ajax_load).load(loadUrl, "filter="+currentLetter);
       // $("#MemberList").html(ajax_load);
        //});
        return false;
    
    });

    
    $("select.qty").change(function()
	{
		// alert($(this).attr("name"));
		var $opt = $(this).attr("id");
		var $optid = $opt.replace("amt", "");
		// var $prodid = $("input[name=productid]").val();
        var $currentVal = parseInt($(this).val());
        var $currentOption = "select#"+$opt+" option[value="+$currentVal+"]";
       // alert($currentOption);
        var $amount = parseInt($($currentOption).text());
        var $price = $("span#product_price").html();
        var $price = parseFloat($price.replace("$", ""));
        var $newPrice = ($price*$currentVal).toFixed(2);
        $("#price"+$optid).html("$"+$newPrice);
        
        //alert();
        var $row = $("input.opt"+$optid).each(function(){
            var $pp = parseInt($(this).attr("title"));
            var $val = $pp*$amount;
            $(this).val($val);
            //alert($pp);
			//alert($amount);
        });
    });
    
    
    //$("img.rounded").corner();
    //$("div.rounded").corner("15px");
    $('img.rounded').one('load',function () {
	var img = $(this);
	var img_width = img.width();
	var img_height = img.height();
	
	// build wrapper
	var wrapper = $('<div class="rounded_wrapper"></div>');
	wrapper.width(img_width);
	wrapper.height(img_height);
	
	// move CSS properties from img to wrapper
	wrapper.css('float', img.css('float'));
	img.css('float', 'none')
	
	wrapper.css('margin-right', img.css('margin-right'));
	img.css('margin-right', '0')

	wrapper.css('margin-left', img.css('margin-left'));
	img.css('margin-left', '0')

	wrapper.css('margin-bottom', img.css('margin-bottom'));
	img.css('margin-bottom', '0')

	wrapper.css('margin-top', img.css('margin-top'));
	img.css('margin-top', '0')

	wrapper.css('display', 'block');
	img.css('display', 'block')

	// IE6 fix (when image height or width is odd)
	if ($.browser.msie && $.browser.version == '6.0')
	{
		if(img_width % 2 != 0)
		{
			wrapper.addClass('ie6_width')
		}
		if(img_height % 2 != 0)
		{
			wrapper.addClass('ie6_height')			
		}
	}

	// wrap image
	img.wrap(wrapper);
	
	// add rounded corners
	img.after('<div class="tl"></div>');
	img.after('<div class="tr"></div>');
	img.after('<div class="bl"></div>');
	img.after('<div class="br"></div>');
}).each(function(){
	if(this.complete) $(this).trigger("load");
});
	
    
    
    }
);
