	function mail(name, domain, style, text) {
		if (text == "undefined" || text == null)
			document.write("<a h"+"ref='"+"mai"+ "lto:"+name+"@"+domain+"' style='"+style+"'>"+name+"@"+domain+"</a>");
		else
			document.write("<a h"+"ref='"+"mai"+ "lto:"+name+"@"+domain+"' style='"+style+"'>"+text+"</a>");
	      };
		  
		function check(myname,text) {
			if($(myname).attr('value')==text)
			{
				$(myname).val('');
			}else{
				if($(myname).attr('value')==''){
				$(myname).val(text);
				}
			}
		}
function anchorScroller(el, duration) {
   if (this.criticalSection) {
       return false;
   }
   
   if ((typeof el != 'object') || (typeof el.href != 'string'))
       return true;
   
   var address = el.href.split('#');
   if (address.length < 2)
       return true;
   
   address = address[address.length-1];
   el = 0;
   
   for (var i=0; i<document.anchors.length; i++) {
       if (document.anchors[i].name == address) {
           el = document.anchors[i];
           break;
       }
   }
   if (el === 0)
       return true;
       
   this.stopX = 0;
   this.stopY = 0;
   do {
       this.stopX += el.offsetLeft;
       this.stopY += el.offsetTop;
   } while (el = el.offsetParent);
   
   this.startX = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft;
   this.startY = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
   
   this.stopX = this.stopX - this.startX;
   this.stopY = this.stopY - this.startY;
   
   if ( (this.stopX == 0) && (this.stopY == 0) )
       return false;
   
   this.criticalSection = true;
   if (typeof duration == 'undefined')
       this.duration = 500;
   else
       this.duration = duration;
           
   var date = new Date();
   this.start = date.getTime();
   this.timer = setInterval(function () {    
       var date = new Date();
       var X = (date.getTime() - this.start) / this.duration;
       if (X > 1)
           X = 1;
       var Y = ((-Math.cos(X*Math.PI)/2) + 0.5);
       
       cX = Math.round(this.startX + this.stopX*Y);
       cY = Math.round(this.startY + this.stopY*Y);
       
       document.documentElement.scrollLeft = cX;
       document.documentElement.scrollTop = cY;
       document.body.scrollLeft = cX;
       document.body.scrollTop = cY;
       
       if (X == 1) {
           clearInterval(this.timer);
           this.criticalSection = false;
       }
   }, 10);
   return false;
}

$(function(){
		$('.hidden_div').hide();
		$('.hidden_div').next().css('clear','both');
		$('.master_div').click(function () { $(this).parent().next('.hidden_div').slideToggle('1500');
							 $(this).next('.hidden_div').slideToggle('1500');
				       
				       });
					   
		$('.hidden_m10').hide();
		$('.hidden_m100').hide();
		
		$('#master_div_m10').click(function () { 
		if ($(".hidden_m10").is(":hidden")) {
		$('.hidden_m10').fadeIn('slow');
		$('#master_div_m10').html ('Скрыть участки');
		} else {
		$('.hidden_m10').fadeOut('slow');
		$('#master_div_m10').html ('Показать все участки');
		}
							 		       
				       });
					   
		$('#master_div_m100').click(function () { 
		if ($(".hidden_m100").is(":hidden")) {
		$('.hidden_m100').fadeIn('slow');
		$('#master_div_m100').html ('Скрыть участки');
		} else {
		$('.hidden_m100').fadeOut('slow');
		$('#master_div_m100').html ('Показать все участки');
		}
							 		       
				       });			   
});


	$(document).ready(function(){
		
$(".bluediv a").corner("round");
$("#info_company div div div div div").corner("round");

//$height_max=0;
//$(".one_new").each(function(){ if($(this).css('height') >= $height_max) { $height_max = $(this).css('height'); } });
//$(".one_new").each(function(){ $(this).css('height', $height_max+'px'); });
		
				$(".view table tr").each(function () {
					myhtml_f=$(this).children("td:first").text();
				$(this).children("td:first").html("").append('<div class="lt"><div class="lb">' + myhtml_f + '</div></div>');
					myhtml_l=$(this).children("td:last").text();
				$(this).children("td:last").html("").append('<div class="rt"><div class="rb">' + myhtml_l + '</div></div>');
				
					tdh_f=$(this).children("td:first").height();
					//alert(tdh_f);
					tdh_l=$(this).children("td:last").height();
					if (tdh_f>tdh_l) {
							tdh = tdh_f;
						}else{
							tdh = tdh_l;
							};
					$(this).children("td:first").children(".lt").children(".lb").css("height",tdh);
					$(this).children("td:last").children(".rt").children(".rb").css("height",tdh);
				});

        $('div.view').hide();
		$('a.dashed').click(function () {
		    $(this).parent('h2').next('div.view').slideToggle();
		    return false;
		    });

				$(".view table tr td").hover (function() {
						$(this).parent("tr").addClass("select");
					},function() {
						$(this).parent("tr").removeClass("select");
						});
		/*$(".view table tr td").hover (function() {
				if ($(this).parent("tr").children("td:first").children("span").height()>$(this).parent("tr").children("td:last").children("span").height()) {
					tdHeitht = $(this).parent("tr").children("td:first").children("span").height();
				}else{
					tdHeitht = $(this).parent("tr").children("td:last").children("span").height();
				};
				$(this).parent("tr").children("td").children("span").height(tdHeitht);
				$(this).parent("tr").children("td:first").children("span").wrap('<div class="lt"><div class="lb"></div></div>');
				$(this).parent("tr").children("td:last").children("span").wrap('<div class="rt"><div class="rb"></div></div>');
			},function(){
				//alert(tdHeitht);
				$(this).parent("tr").children("td:first").html('<span>' + $(this).parent("tr").children("td:first").text() + '</span>');
				$(this).parent("tr").children("td:last").html('<span>' + $(this).parent("tr").children("td:last").text() + '</span>');
				if ($(this).parent("tr").children("td:first").children("span").height()>$(this).parent("tr").children("td:last").children("span").height()) {
					tdHeitht = $(this).parent("tr").children("td:first").children("span").height();
				}else{
					tdHeitht = $(this).parent("tr").children("td:last").children("span").height();
				};
				$(this).parent("tr").children("td").children("span").height(tdHeitht);
				});*/
	
		
	
	});