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(){
	
	var soo = new SWFObject("/images/kosmo/right.swf", "rightswf", "100%", "100%", "8", "#00264B");
	soo.write("info");

	var so = new SWFObject("/images/kosmo/head.swf", "indexswf", "100%", "300", "8", "#00264B");
	so.addParam("wmode","opaque");
	so.write("container");	

	
	$("#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: '#175491',
		imageLoading: '/images/lightbox/lightbox-ico-loading.gif',
		imageBtnPrev: '/images/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: '/images/lightbox/lightbox-btn-next.gif',
		txtImage: 'Изображение',
		txtOf: 'из'
	});


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);
  }
  
	

	function showRequestTen() {
		$('#sbm-send').attr('value','Подождите, пожалуйста...');
		$('#sbm-send').attr('disabled','disabled');
		$('#sbm-send').css('cursor','default');
	}	
	function showResponseTen() {
		$('#sbm-send').hide();
	}

	$("#q-ten").validate({
		submitHandler: function(form) {
			$(form).ajaxSubmit({
				target: "#res-ten",
				beforeSubmit: showRequestTen,
				success: showResponseTen
			});
		}
	});
	$('#searchform').submit( function() {
		$(this).ajaxSubmit({
			target: "#res"
		});
		return false
	});


});
