jQuery.noConflict();
(function($) {
	$(function() {


		jQuery('.logo a').clone().addClass('sublogo').appendTo('.header');
		jQuery('.product-view .product-img-box .zoom').corners({tl:0, tr: 0, sufix: 5});
		jQuery('.product-view .product-img-box .product-image').corners({sufix: 5});
		jQuery('.col1-layout .col-main .std').corners({tl:0, tr: 0, sufix: 5});
		jQuery('.col1-layout .col-main .page-title').corners({bl:0, br: 0, sufix: 5});
		jQuery('.page-bottom').corners({tl: 0, tr: 0, sufix: 5});
		jQuery('.designer-img').corners({sufix: 5});
		jQuery('#color-swatches ul li').corners({sufix: 7});

		jQuery('#nav li').each(function(n){
			jQuery(this).addClass('item-'+n);
		});
		jQuery('#nav-wholesale li').each(function(n){
			jQuery(this).addClass('item-'+n);
		});

		/* go on for IE in generall */
		if(jQuery.browser.msie){


			/* take care IE 6 only */
			if(jQuery.browser.version <= 7) {

			}
			else{

				jQuery('.block-narrow-by').corners({bl: 0, br: 0, sufix: 1});

			}

			jQuery('.block:first-child').addClass('first-child');
			jQuery('li:last-child').addClass('last-child');
			jQuery('.block-tags').corners({tl: 0, tr: 0, sufix: 1});
			jQuery('.main').not('.blog').corners({sufix: 2});
			jQuery('.blog .col-wide').corners({sufix: 2});
			jQuery('.blog .col-narrow').corners({sufix: 9});
			jQuery('.home-main-info').corners({sufix: 3});
			jQuery('.product-view, .col1-layout .col-main').corners({sufix: 4});
			jQuery('.landing-page .col-main').corners({sufix: 4});
			jQuery('.landing-page .col-main .col-2, .landing-page .col-main .col-1').corners({sufix: 5});
			jQuery('.designer-list>li, .product-collateral, .designer-card').corners({sufix: 5});
			jQuery('.product-view .product-img-box .more-views li a, .mini-products-list .product-image').corners({sufix: 7});
			jQuery('.block .actions button').not('.block-subscribe .actions button').corners({sufix: 8});
			jQuery('.toolbar').corners({sufix: 10});
			jQuery('.designer-img').corners({sufix: 1});

			$('.designer-list li').each(function(c){
				if(c%2==1)
					$(this).addClass('even');
				else
					$(this).addClass('odd');
			});
		}// ie

		jQuery('.blog .col-narrow .mod-cats ul li').each(function(c){
			jQuery(this).addClass('cat-'+c);
		});

	});
})(jQuery)

window.onload=function() {
	var shout_box_height = jQuery(".blog .col-narrow").height();
	var left_col_height = jQuery(".blog .col-wide").height();	
	if (shout_box_height < left_col_height) {
		jQuery(".blog .col-narrow").css("height", left_col_height);
	}
}

jQuery.fn.corners = function(option) {
	option = jQuery.extend({
		tl: 1,
		tr: 1,
		bl: 1,
		br: 1,
		sufix: 1
	}, option);

	return this.each(function(i){
		path = '/skin/frontend/default/default/images/';


		if(option.tl)
			jQuery(this).append('<img src="'+path+'img-cor-'+option.sufix+'-NW.png" class="corner corner-nw" />');
		if(option.tr)
			jQuery(this).append('<img src="'+path+'img-cor-'+option.sufix+'-NE.png" class="corner corner-ne" />');
		if(option.bl)
			jQuery(this).append('<img src="'+path+'img-cor-'+option.sufix+'-SW.png" class="corner corner-sw" />');
		if(option.br)
			jQuery(this).append('<img src="'+path+'img-cor-'+option.sufix+'-SE.png" class="corner corner-se" />');

		cornerBorder = parseInt(jQuery(this).css('border-width'));
		cornerBorder = cornerBorder > 0 ? '-'+cornerBorder+'px' : '0';


		jQuery(this).css('position','relative').children('.corner').css({
			'position'	: 'absolute'
		});

		jQuery(this).children('.corner-nw').css({
			'top'	: cornerBorder,
			'left'	: cornerBorder
		}).next('.corner-ne').css({
			'top'	: cornerBorder,
			'right'	: cornerBorder
		}).next('.corner-sw').css({
			'bottom': cornerBorder,
			'left'	: cornerBorder
		}).next('.corner-se').css({
			'bottom': cornerBorder,
			'right'	: cornerBorder
		});



	}); // each
}

