$(function(){	
	$('.topmenu a').eq(0).corner('tl 15px').end().last().corner('tr 15px');
	$('.contacts, .spec, .mid-box li').corner('bottom 15px');
	$('.contacts h2').corner('top 15px');
	$('#photo').corner('15px');
	$('li', $('#photo')).corner('3px').children('a').addClass('thickbox').attr('rel','gallery-plants');
	$("a#asd").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over'
			});
	
	$('#carousel').jcarousel({
		buttonNextHTML: '<div class="prev"></div>',
		buttonPrevHTML: '<div class="next"></div>',
		scroll: 3,
		wrap: 'circular'
	});
	$('#carousel2').jcarousel({
		buttonPrevHTML: '<div class="next"></div>',
		buttonNextHTML: '<div class="prev"></div>',
		scroll: 1
	});
	
	$twb = $('.twrap').find('.twb');
	$twb.hide().first().show();
	$twl = $('.twlinks').find('a');
	$twl.bind('click', function(){
		$twl.removeClass('select').eq($(this).index()).addClass('select');
		$twb.hide().parent().find(this.hash).show();
		return false;
	});
	
	$li = $('.topmenu').find('li');
	s = 0; $li.each(function(i){ if(i==$li.size()-1) return false;s = s + $(this).width(); });
	$li.last().children('a').width($('.topmenu').width() -s -1).css({padding:'1px 0 0 0', border:0, textAlign:'center'});
	
	if(!$.browser.msie){
		$('.title')
			.first().corner('tl 10px').end().last().corner('tr 10px')
			.parent().parent().find('tr')
				.each(function(){
					$(this).find('td').last().children('div').css('border-right', '0');
				})
			.last().find('td').children('div').css('border-bottom', '0').parent()
			.first().corner('bl 10px').end().last().corner('br 10px');
	} else {
		$('.title')
			.parent().parent().find('tr')
			.each(function(){ $(this).find('td').last().children('div').css('border-right', '0'); })
			.last().find('td').children('div').css('border-bottom', '0');
	}
});
