$(function(){

	CSSfix();
	productImages();
	
	if (typeof $.ifixpng != 'undefined') $('*').ifixpng('/themes/images/blank.gif');
	
	
	$('.finish .print').bind('click', function(){
		window.print();
		return false;
	});
	
	$('#header').unbind().bind('click', function(){
		window.location.replace('/');
	});
	
	$('#team_items ul li').unbind().bind('click', function(){
		$('#team_items ul li').removeClass('active');
		_id = $(this).attr('class')
		$('div.team.first').html($('div.' + _id).html());
		$(this).addClass('active');
	});
	
});


var CSSfix = function() {
	$('#menu ul li a, .shop .add, .basket .submit, .basket .reset input, .finish .print input, .basket .recount, .checkout .login fieldset, .checkout .login legend, .checkout .address fieldset, .checkout .address legend, .checkout .login .fill').css({//, a.back
		'-moz-border-radius': '5px',
		'-webkit-border-radius': '5px',
		'border-radius': '5px',
		'-khtml-border-radius': '5px'/*,
		'behavior': 'url(/js/border-radius.htc)'*/
	});
	$('.news_box, .news_box h2, .basket_box, .basket_box h2, .shop_box, .shop_box h2, .basket_box .foot').css({
		'-moz-border-radius': '15px',
		'-webkit-border-radius': '15px',
		'border-radius': '15px',
		'-khtml-border-radius': '15px'/*,
		'behavior': 'url(/js/border-radius.htc)'*/
	});
	$('.gallery .item img, .shop img, .shop_box img, div.team img, #team_items ul li img, #body.cms .edit .submit input').css({
		'-moz-border-radius': '3px',
		'-webkit-border-radius': '3px',
		'border-radius': '3px',
		'-khtml-border-radius': '3px'/*, 
		'behavior': 'url(/js/border-radius.htc)'*/
	});
	
};

var productImages = function(){
	$('.shop .images img[class!="first"]').css({
		'cursor': 'pointer'
	}).unbind('click').bind('click', function(){
		tmp = $('.shop .images img[class="first"]').attr('src');
		$('.shop .images img[class="first"]').attr('src', $(this).attr('src'));
		$(this).attr('src', tmp);
	});
};
