function mail(name, domain, style) { //thanks to Andrey "Chips" Kuzmin
	document.write('<a h'+'ref="'+'mai'+ 'lto:'+name+'@'+domain+'" style="'+style+'">'+name+'@'+domain+'</a>');
}

$(document).ready(function(){
	/*
	$('div.slogan h2').hide();
	$('div.slogan h2#s1').show('slow');
	$('div.slogan h2#s1').hide('slow');
	*/
	$("#loading").bind("ajaxSend", function(){
		$(this).show(); // показываем элемент
	}).bind("ajaxComplete", function(){
		$(this).hide(); // скрываем элемент
	});
	
	$('div.carousel').jCarouselLite({
    btnNext: '.gal_down',
    btnPrev: '.gal_up',
    visible: 4,
    speed: 200,
    start: 0,
    vertical: true
	});
	
	$('div.gal a').lightBox({
		imageBtnClose: '/images/lightbox/lightbox-btn-close.gif',
		overlayBgColor: '#996633',
		imageLoading: '/images/lightbox/lightbox-ico-loading.gif',
		imageBtnPrev: '/images/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: '/images/lightbox/lightbox-btn-next.gif',
		txtImage: 'Изображение',
		txtOf: 'из'
	});

	function showRequestTen() {
		$('#sbm-send').attr('value','Подождите, пожалуйста...');
		$('#sbm-send').attr('disabled','disabled');
		$('#sbm-send').css('cursor','default');
	}	
	function showResponseTen() {
		$('#sbm-send').hide();
	}

var bookObj = document.getElementById('cntnr');
  var h = bookObj.clientHeight||bookObj.offsetHeight;
	var browser = navigator.appName;
  var b_version = navigator.appVersion;
  var version = parseFloat(b_version);
  if ((browser == "Microsoft Internet Explorer") && (version = 7)){
  h=h-120;
}
else {h=h-140;}
	h = h+'px';
  if ((browser == "Microsoft Internet Explorer") && (version = 6)){
    $('td.rightcol div.content').css('height',h);
  }else{
   $('td.rightcol div.content').css('min-height',h);
  }

	$("#q-ten").validate({
		submitHandler: function(form) {
			$(form).ajaxSubmit({
				target: "#res-ten",
				beforeSubmit: showRequestTen,
				success: showResponseTen
			});
		}
	});
	$('#searchform').submit( function() {
		$(this).ajaxSubmit({
			target: "#res"
		});
		return false
	});

});
