<!--
if (!window.opera) {
	try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
}

tbox=null;

$(document).ready(
	function() {
		if ($('#side_menu').length>0) {
			$('li.side_menu3 a').add('#side_menu_more_close').click(function(){
				$('#side_menu_more').slideToggle('fast');
			});
		}
		
		if ($('#side_features a').length>0) {
			featLink = $('#side_features a');
			$.fn.reverse = [].reverse;
			featPix = $('div.centrum_block');
			featPrev = -1;
			$(featLink).click(function(){
				featCur = $(featLink).index(this);
				if (featPrev!=featCur) {
					$('#side_features div:visible').slideUp('fast');
					$(this).next().slideDown('fast');
					$(featPix).eq(featCur).appendTo('#centrum').fadeIn('fast', function(){
						$(featPix).eq(featPrev).hide();
						featPrev = featCur;
					});
				}
				return false;
			});
			$(featLink).eq(0).click();
		}
		
		if ($('#menu').length>0) {
			$('#menu li.menu_special1:first').css('margin-top','16px');
		}
		
		if ($('#rates').length>0) {
			$('#rates table').each(function(){
				$(this).find('tr:last td').css('border-bottom','none');
			});
		}

		if ($('.slide_block').length>0) {
			slideTrigger = $('a.slide_trigger');
			slideBlock = $('div.slide_block')
			$(slideTrigger).click(function(){
				$(this).toggleClass('open');
				$(slideBlock).eq($(slideTrigger).index(this)).slideToggle('fast');
				return false;
			});
			$('h4').css('margin-top','22px');
		}
		
		/*if ($('div.calc').length>0) {
			$('#month_track').trackbar({
				onMove : function() {
					$('#month_value').val(this.leftValue)
				},
				dual : false, // two intervals
				width : 140, // px
				leftLimit : 4, // unit of value
				rightLimit : 60, // unit of value
				showSmallTicks : true,
				showBigTicks : false
			});
		}*/

		$('.img_right').each(function(n,el) {			
			var o=$('.img_right_text')[n];
			o.innerHTML='<a class="thickbox" rel="gallery1" href="'+$(el).children(':first-child').children(':first-child').children(':first-child').children(':first-child')[0].href+'">'+o.innerHTML+'</a>';
		});

		setTimeout(function() {
			$('a.thickbox').thickbox();
			$('a.lightbox').thickbox();		
		},500);
		
		if ($('#calendar').length>0) {
			if ((!-[1,])&&(jQuery.browser.version == 6)) {
				$('td.new_moon').add('td.full_moon').each(function(){
					if (!$(this).find(':first-child').hasClass('duty_day')) {
						clName = /[a-z]+_moon/.exec($(this).attr('class'));
						$(this).wrapInner('<div class="'+clName+'"></div>').removeClass(clName);
					}
				})
				DD_belatedPNG.fix('div.new_moon, div.full_moon, div.duty_day');
			}
			$('div.duty_day').each(function(){
				tinyColor = $(this).find('div.color_duty');
				$(tinyColor).css('height',parseInt(24/$(tinyColor).length)+'px');
			})
			$('a.duty_day_act').click(function(){
				$('#current_note').hide().remove();
				$(this).parents('div.quarter').after('<div id="current_note"></div>');
				$(this).next().clone().prependTo('#current_note').slideDown(300);
				$('#current_note a').click(function(){
					$('#current_note').hide().remove();
					return false;
				})
				return false;
			})
		}
        $('div.step1 a,div.step2_link:not("#top_text_btn") a').click(function(){
    		$(this).parent().next('div.step2,div.step3').slideToggle(300);
			$(this).not('.thickbox1').parent('div.step2_link').toggleClass('act');
			$(this).next().toggle();
			return false;
		})
		tbox=$('div.step2_link a.thickbox1').thickbox({
			width: 700,
			height: 600
		});

	}
);


// -->

