/*document.write('<script src="/js/prototype.js" type="text/javascript"></script>');*/
document.write('<script type="text/javascript" src="/js/datepickercontrol.js"></script>');
document.write('<script type="text/javascript" src="/js/swfobject.js"></script>');
if (navigator.platform.toString().toLowerCase().indexOf("linux") != -1){
	document.write('<link type="text/css" rel="stylesheet" href="/js/datepickercontrol_lnx.css">');
}else{
	document.write('<link type="text/css" rel="stylesheet" href="/js/datepickercontrol.css">');
}
document.write('<script type="text/javascript" src="/js/jq.js"></script>');
document.write('<script type="text/javascript" src="/js/ui.core.js"></script>');
document.write('<script type="text/javascript" src="/js/jq-ui.js"></script>');


function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


function getElementsByClassName(classname,tag) {
	 if(!tag) tag = "*";
	 var anchs =  document.getElementsByTagName(tag);
	 var total_anchs = anchs.length;
	 var regexp = new RegExp('\\b' + classname + '\\b');
	 var class_items = new Array()
	 
	 for(var i=0;i<total_anchs;i++) {
	  var this_item = anchs[i];
	  if(regexp.test(this_item.className)) {
	   class_items.push(this_item);
	  }
	 }
	 return class_items;
	}
	function toggleEl(elem, anc) {
		var t_el = document.getElementById(elem);
		if (t_el.style.display == 'none') {
		for (var i = 0, j = getElementsByClassName('inner_ul').length; i < j; i++) {
		   getElementsByClassName('inner_ul')[i].style.display = 'none';
		}
		for (var i = 0, j = getElementsByClassName('active').length; i < j; i++) {
		   getElementsByClassName('active')[i].className = '';
		}	
		t_el.style.display = 'block';
		}
		else t_el.style.display = 'none';
		anc.className = anc.className == '' ? 'active' : '';
	}
	function getBrowserWidth(){
		if (window.innerWidth){
			return window.innerWidth;}  
		else if (document.documentElement && document.documentElement.clientWidth != 0){
			return document.documentElement.clientWidth;    }
		else if (document.body){return document.body.clientWidth;}      
			return 0;
	}
	function getBrowserHeight(){
		if (window.innerHeight){
			return window.innerHeight;}  
		else if (document.documentElement && document.documentElement.clientHeight != 0){
			return document.documentElement.clientHeight;    }
		else if (document.body){return document.body.clientHeight;}      
			return 0;
	}
	function hideBigLayer(divId){
		var div=document.getElementById(divId);
		var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='hidden';
		div.style.display='none';
	}
	function animWidth(divId, start, finish){
		var div=document.getElementById(divId);
		var currWidth=start+10;
		div.style.width=currWidth+'px';
		if(currWidth<finish){
			setTimeout(function(){animWidth(divId, currWidth, finish);}, 0.5);
		}else{
			return currWidth;
		}
	}
	function animHeight(divId, start, finish){
		var div=document.getElementById(divId);
		var currHeight=start+10;
		div.style.height=currHeight+'px';
		if(currHeight<finish){
			setTimeout(function(){animHeight(divId, currHeight, finish);}, 0.5);
		}else{
			return currHeight;
		}
	}
	function showBigLayer(divId, w, h, bigimg){
		var l=(getBrowserWidth()/2)-(w/2);
		var t=(getBrowserHeight()/2)-(h/2);
		var div=document.getElementById(divId);
		var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='visible';
		div.style.left=l.toFixed(0)+'px';
		div.style.top=t.toFixed(0)+'px';
		div.style.display='block';
		animWidth(divId, 10, w);
		animHeight(divId, 10, h);
		div.innerHTML='<img class="galleryBigImg" src="'+bigimg+'" onclick="hideBigLayer(\'bigImg\')">';
	}
	

document.write('<script src="/js/JsHttpRequest/lib/JsHttpRequest/JsHttpRequest.js"></script>');

function getNextPrev(id, cat){
 var req = new JsHttpRequest();
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            document.getElementById('arrows').innerHTML = req.responseText;
        }
    }
    req.open(null, '/js/nextprev.php', true);
    req.send( { currid: id, currcat: cat } );
}

function reportError(request){
	alert('Ошибка соединения с сервером!\nПроверьте соединение с интернетом или обновите страницу.');
}

// This Script was written by Benjamin Meier, b2m@gmx.de
// The DHTML-function for creating a overlaying div-layer uses parts of the Dynamic Image Mambot, written by Manuel Hirsch
// and Lightbox => core code quirksmode.org
var pg_ffwrong = "red";
var pg_padding = "5";
var pg_filenamewithjs = "1";
var pg_dhtml_border = "gray";
var pg_openjs_background = "white";
var pg_disableclick = "1";
var pg_use_code = "1";
var pg_show_title_in_dhtml = "1";
var pg_show_description_in_dhtml = "1";
var ponygallery_image = "Фото";
var ponygallery_of = "из";
var ponygallery_close = "Закрыть";
var ponygallery_prev = " Назад";
var ponygallery_next = "Дальше";
var ponygallery_press_esc = "(Esc)";
var resizeJsImage = "1";
function opendhtml(id, cat, imgsource, imgtitle, imgtext, imgwidth, imgheight) {
  imgwidth = parseInt(imgwidth);
  imgheight = parseInt(imgheight);
	//var dwrap=document.getElementById('bigImgWrap');
		//dwrap.style.visibility='visible';
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	//dwrap.style.height=(document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight+'px';
	var yScroll, xScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
	var fullHeight=(document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
	//Create wrap layer
	var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("bigImgWrap")) {
    divObjWrapper = document.createElement("div");
    divObjWrapper.setAttribute("id", "bigImgWrap");
    bodyObj.appendChild(divObjWrapper);
  } else {
    divObjWrapper = document.getElementById("bigImgWrap");
  }
  with(divObjWrapper.style){
	position='absolute'; 
	backgroundColor='#000000'; 
	top='0px'; 
	left='0px'; 
	zIndex='90'; 
	width='100%';
	height=fullHeight+'px'; 
	filter='alpha(opacity=60)'; 
	mozOpacity='0.6';	
	opacity='0.6';
	visibility='visible';
  }

  if(resizeJsImage==1) {
   if((imgwidth+3*pg_padding)>windowWidth) {
     imgheight = (imgheight * (windowWidth-2*pg_padding))/imgwidth;
     imgwidth = windowWidth-2*pg_padding;
   }
   if((imgheight+2*pg_padding+80)>windowHeight) {
     imgwidth = (imgwidth * (windowHeight-2*pg_padding-80))/imgheight;
     imgheight = windowHeight-2*pg_padding-80;
   }
  }
  var postop =(windowHeight/2)-(imgheight/2)+yScroll+document.body.style.padding-10;
  var posleft =(windowWidth/2)-(imgwidth/2)+xScroll+document.body.style.padding;
  if(postop >= 30) { 
   postop = postop-30;
  }
 // var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("pg_photocontainer")) {
    divObjContainer = document.createElement("div");
    divObjContainer.setAttribute("id", "pg_photocontainer");
    bodyObj.appendChild(divObjContainer);
  } else {
    divObjContainer = document.getElementById("pg_photocontainer");
  }

  var closeimg = new Image();
  closeimg.src = "/images/close.gif";

  var dhtmltext, dhtmltext2="";

  divObjContainer.style.display = "block";
  dhtmltext  = "<div class=\"pg_photocontainer\" style=\"top:"+postop+"px; left:"+posleft+"px; position: absolute; display:block;z-index:99999;\">";
  dhtmltext += "<div class=\"photoborder\" style=\"background-color: "+pg_openjs_background+"; padding: "+pg_padding+"px; border: solid 1px "+pg_dhtml_border+";\">";
  dhtmltext += "<img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;border: solid 1px #000;width:"+imgwidth+"px;height:"+imgheight+"px;\" src=\""+imgsource+"\" alt=\""+imgtitle+"\" width=\""+imgwidth+"px\" height=\""+imgheight+"px\" class=\"pngfile\" \/>";
  dhtmltext += "<div id='arrows' style='text-align:center'></div><img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;position:absolute;bottom:"+pg_padding+"px;right:"+pg_padding+"px;width:"+closeimg.width+"px;height:"+closeimg.height+"px;\" src=\""+closeimg.src+"\" title=\"Закрыть\" id=\"dhtml_close\" class=\"pngfile\" />";  
  dhtmltext += "<br /><div id=\"pony_dhtml_imgtext\" style=\"color:#000000; margin-top:"+pg_padding+"px;text-align: justify; width:"+imgwidth+"px;\">&nbsp;<br />&nbsp;</div>";
  //dhtmltext += "<\/div></div>";
  divObjContainer.innerHTML = dhtmltext;
     document.getElementById("pony_dhtml_imgtext").style.width2 = document.getElementById("pony_dhtml_imgtext").style.width-document.getElementById("dhtml_close").style.width;
  if (pg_show_title_in_dhtml==1) {
   dhtmltext2 += "<strong>"+imgtitle+"</strong><br />";
  }
  if (pg_show_description_in_dhtml==1) {
   dhtmltext2 += imgtext;
  }
  dhtmltext2 += "<\/div></div>";
  if (dhtmltext2!="") {
   document.getElementById("pony_dhtml_imgtext").innerHTML = dhtmltext2;
  }

  if (pg_disableclick==1) { 
    divObjContainer.oncontextmenu = function(){return false;}
  }
  getNextPrev(id, cat);
}

function pg_photocontainershut() {
  document.getElementById("pg_photocontainer").style.display = "none";
  var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='hidden';
}

function showdiv(obj, parent){  
	var div=document.getElementById('divmenu'+obj);
	if(div.style.display=="none"){
	   document.cookie = "divmenu="+obj+"; expires=Thu, 31 Dec 2100 23:59:59 GMT; path=/;";
	  div.style.display="block";
	}else{
	   if(parent==0){
		  document.cookie = "divmenu=N; expires=Thu, 31 Dec 2100 23:59:59 GMT; path=/;";
		  div.style.display="none";
	   }
	}return true;
}

function setID(id){
	$('#currid').val(id);
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': id, 'mode':'title' }, function (data){ document.title=data; });
	$('#block_comment').html('<img src="/images/loading.gif" align=left>&nbsp; Идет загрузка...');
	$.get('/modules/comments.php', { 'id': id }, function (data){ $('#block_comment').html(data); });
	$.get('/linkcode.php', { 'id': id, 'mode':'comments' }, function (data){ $('#a_comments').text(data); });
	if($('#showlink').css('display')=='block'){
		$('#showlink').slideUp('normal');
		$('#videocode').text('Получить код');
		$('#videolink').text('Прямая ссылка');
	}
}

function getLink(){
	var videoID=$('#currid').val();
	$('#videolink').blur();
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': videoID, 'mode':'link' }, function (data){ $('#showlink').html(data); });
	$('#showlink').slideToggle('fast', function(){
		var txt=($('#showlink').css('display')=='none')?'Прямая ссылка':'Скрыть';
		$('#videolink').text(txt);
		$('#videocode').text('Получить код');	
	});
}

function getCode(){
	var videoID=$('#currid').val(); 
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': videoID, 'mode':'code' }, function (data){ $('#showlink').html(data); });
	$('#videocode').blur();
	$('#showlink').slideToggle('fast', function(){
		var txt=($('#showlink').css('display')=='none')?'Получить код':'Скрыть';
		$('#videocode').text(txt);
		$('#videolink').text('Прямая ссылка');
	});
}

function sendComment(){ 
	var rnd_no = Math.floor(Math.random());
	var bodyObj = document.getElementById('comments_list');
    divObjContainer = document.createElement("div");
    divObjContainer.setAttribute("id", "last_comment"+rnd_no);
    bodyObj.appendChild(divObjContainer);
	$.ajaxSetup({cache: false});
	$('#alert_area').hide('fast');
	$('#alert_area').html('');
	$.post('/modules/comments.php', {'show_comments':1, 'show_comments_list':1, 'id':document.addcomm.id.value, 'MM_insert':'addcomm', 'text':document.addcomm.text.value, 'autor':document.addcomm.autor.value, 'rating':$('#rating').val(), 'ip':document.addcomm.ip.value, 'pagepath':document.addcomm.pagepath.value, 'securityCode':document.addcomm.securityCode.value }, function (data){ $('#last_comment'+rnd_no).append(data); $('#last_comment'+rnd_no).effect("pulsate", { times:2 }, 500);});

	document.addcomm.reset();
}

function show_alert(txt){
	$('#alert_area').html(txt);
	$('#alert_area').slideUp('fast');
	$('#alert_area').effect("pulsate", { times:5 }, 200);
	setTimeout("$('#alert_area').fadeOut('slow')", 5000);
}

function editComment(id){
	$.post('/modules/comments.php', {'edit_comment':1, 'show_comments_list':1, 'id':id}, function(data){ $('#commenttext'+id).html(data)});
}

function saveComment(id){
	$('#commenttext'+id).prepend('<img src="/images/loading.gif" align=left>&nbsp; Пожалуйста, подождите...<br>');
	$.post('/modules/comments.php', {'update_comment':1, 'show_comments_list':1, 'id':id, 'text':$('#textcomment'+id).val()}, function(data){ $('#commenttext'+id).html(data)});
}

function unsaveComment(id){
	$.post('/modules/comments.php', {'get_comment':1, 'show_comments_list':1, 'id':id}, function(data){ $('#commenttext'+id).html(data)});
}

function delComment(id){
	$('#alert'+id).html('Уверены, что хотите удалить именно этот комментарий? <input class="button" type=button onclick="deleteComment('+id+')" value="Да"> &nbsp;&nbsp;<input class="button" type=button onclick="undeleteComment('+id+')" value="Нет">');
	$('#alert'+id).slideDown('fast');
}

function deleteComment(id){
	$.post('/modules/comments.php', {'del_comment':1, 'id':id}, function(data){$('#commenttext'+id).html(data)});
	$('#comment'+id).slideUp('fast');
}

function undeleteComment(id){
	$('#alert'+id).slideUp('fast');
}
/*
function showbox(name){
	/*if($.browser.msie){
		$(name).show();
	}else{*//*
		$(name).show('fast');
	//}
}

function hidebox(name){
	/*if($.browser.msie){
		$(name).hide();
	}else{*//*
		$(name).hide('fast');
	//}
}

function show_gp1(txt){
	if(txt.length>5 || txt>0){
		showbox('#gpbox');
	}else{
		hidebox('#gpbox');
		hidebox('#infobox');
	}
}

function show_gp(){
	showbox('#gpbox');
}


function show_content(){
	$('#content').css('color', '#666666');
	$('#content').css('display', 'block');
	$('#content').css('visibility', 'visible');
	if($.browser.msie) $('.infobox p').css('height', 5);
}

var court_select;
function show_mg(){
	court_select=1;
	uncheck_gp();
	$('#mulist').val('');
	$('#rslist').val('');
	hidebox('#pricebox');
	hidebox('#mubox');
	hidebox('#rsbox');
	$.get('/modules/calc_gp.php', {'ajax':1, 'gplist':1, 'court':'mg'}, function(data){ $('#gpbox').html(data);});
	showbox('#gpbox');
	show_content();
}

function show_rs(){
	court_select=2;
	uncheck_gp();
	$('#mulist').val('');
	hidebox('#gpbox');
	hidebox('#pricebox');
	$.ajaxSetup({cache: false});
	$.get('/modules/calc_gp.php', {'ajax':1, 'court_list':1}, function(data){ $('#rslist').html(data);});
	hidebox('#mubox');
	$.get('/modules/calc_gp.php', {'ajax':1, 'gplist':1, 'court':'rs'}, function(data){ $('#gpbox').html(data);});
	showbox('#rsbox');
	show_content();
}

function show_mu(){
	court_select=3;
	uncheck_gp();
	$('#rslist').val('');
	hidebox('#gpbox');
	hidebox('#pricebox');
	$.ajaxSetup({cache: false});
	$.get('/modules/calc_gp.php', {'ajax':1, 'court_list':1}, function(data){ $('#rslist1').html(data);});
	hidebox('#rsbox');
	$.get('/modules/calc_gp.php', {'ajax':1, 'gplist':1, 'court':'mu'}, function(data){ $('#gpbox').html(data);});
	showbox('#mubox');
	show_content();
}

function select_mu(){
	hidebox('#gpbox');
	$.ajaxSetup({cache: false});
	$.get('/modules/calc_gp.php', {'ajax':1, 'mu_list':1, 'court':$('#rslist1').val()}, function(data){ alert(data); $('#muselect').html(data);});
}

function show_branch(num, pnum, court){
	$('#'+num).blur();
	if(num.length==1 || num==10)
	hidebox('.branchbox[id!='+num+']'); 
	if($('#'+num).attr('checked')==true){
		$.ajaxSetup({cache: false});
		$.get('/modules/calc_gp.php', {'ajax':1, 'branch':num, 'pnum':pnum, 'court':court_select }, 
			  function(data){ if(data.length>10){$('#tree'+num).html(data); showbox('#tree'+num);} });
	}else{
		hidebox('#tree'+num);
	} 
	$('#pricebox').html('');
	hidebox('#pricebox');
	$('#pricebox').html('');
	calculate_gp(num);
}
var out=0;
function calculate_gp(num){
	var gosf=100;
	var gosu=2000;
	
	switch (num){
		case '1_1_1': 
		case '6_1':   
		case '5':     
		case '7':     out=gosf; break;
		
		case '1_1_2': 
		case '6_2':   out=gosu; break;
		case '1_2':   var isk=$('#1_2_0_opt').val();
					  out=subcalc_gp(isk);
					  break;
		case '2_2':   var isk=$('#2_2_0_opt').val();
					  out=subcalc_gp(isk)/2; 
					  break;
		case '2_1_1':
		case '8_1':
		case '9_1':  out=gosf/2; break;
		
		case '2_1_2':
		case '8_2':
		case '9_2':  out=gosu/2; break;
		
		case '3':    out=gosf*2; break
		case '4':    out=gosf; if($('#4_0_opt').attr('checked')==true){ out=out*2} break;
		
		case '10': var str=$('#10_0_opt').val();
					 var kop=$('#10_1_opt').val();
					 if(str>0 && kop>0){out= str * kop * 2; if( out<20 ){out=20}}else{out=0;}
					 break;
		case '10_1': var str=$('#10_1_0_opt').val();
					 var kop=$('#10_1_1_opt').val();
					 if(str>0 && kop>0){out= str* kop; if( out<20 ){out=20}}else{out=0;}
					 break;
		case '10_2': var str=$('#10_2_0_opt').val();
					 var kop=$('#10_2_1_opt').val();
					 if(str>0 && kop>0){out= str* kop; if( out<20 ){out=20}}else{out=0;}
					 break;
		default:     out=0;
	}
	if(out>0){
		if((num=='8_1' || num=='8_2') && court_select==1){
			$('#pricebox').html('');
			hidebox('#pricebox');
			alert("Оплатить госпошлину на подачу апелляционной/ кассационной  жалобы можно только для районного суда/мирового участка, чьи решения оспариваются");
		}else if((num=='9_1' || num=='9_2') && court_select==3){
			$('#pricebox').html('');
			hidebox('#pricebox');
			alert("Оплатить госпошлину на подачу надзорной жалобы  можно только для Московского городского суда");
		}else if(num=='1_2' && court_select==3 && $('#1_2_0_opt').val()>100000){
			 $('#1_2_0_opt').val('100000');
			$('#pricebox').html('');
			hidebox('#pricebox');
			alert("В мировых участках рассматривают иски до 100 000 рублей, а свыше 100 000 рублей - в районных судах");
		}else{
			var summtext='<b>Сумма государственной пошлины:</b> <span style=" font-size:18px; color:#F00; font-weight:bold">'+out.toFixed(2)+' руб.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
			summtext+='<br><br><fieldset style="padding:20px"><legend>Печать квитанции:</legend> <br><br>Введите Ваше Ф.И.О. или название организации:<br> <input type=text id="name" size=40 onkeyup="checkName(this)"><br>';
			summtext+='Введите Ваш адрес:<br> <input type=text id="adress" size=40><br><br>';
			summtext+='<input class="calcbtn" id="calcbtn" type=button disabled value="Распечатать квитанцию" onclick="print_check()"><br><br>';
			summtext+='<input class="calcbtn" id="calcbtn1" type=button disabled value="Скачать в формате MS Word" onclick="download_word()"><br></fieldset>';
			$('#pricebox').html(summtext);
			showbox('#pricebox');
			window.scrollTo(0,10000);
			//$('#pricebox').effect("pulsate", { times:1 }, 500); 
		}
	}else{
		hidebox('#pricebox');
	}
}

function checkName(obj){
	var txt=obj.value;
	if(txt.length>2){
		$('#calcbtn').attr('disabled', false);
		$('#calcbtn1').attr('disabled', false);
	}else{
		$('#calcbtn').attr('disabled', true);
		$('#calcbtn1').attr('disabled', true);
	}
}

function subcalc_gp(isk){
	if ( isk < 10001 ){ 
	  out = isk /100*4;
	  if (out < 200) { out =200} 
	}
	if ( isk > 10000 && isk < 50001) { out =400+( isk -10000)/100*3}
	if ( isk > 50000 && isk < 100001) { out =1600+( isk -50000)/100*2 }
	if ( isk > 100000 && isk < 500001) { out =2600+( isk -100000)/100}
	if ( isk > 500000 ) { 
	  out =6600+( isk -500000)/1000*5;
	  if ( out > 20000) { out =20000} 
	}
	return out;
}

function download_word(){
	var gp;
	var court; 
	var mu=$('#mulist').val();
	var sid=$('#sid').val();
	var name=$('#name').val();
	var rs=$('#rslist').val();
	var adress=$('#adress').val();
	switch(court_select){
		case 1: court=1000; break
		case 2: court=rs; break;
		case 3: court=mu; break;
	}
	$.post('/modules/calc_gp.php', {'ajax':1, 'linkword':1, 'court':court, 'gp':get_gp(), 'summ':out.toFixed(2), 'name':name, 'adress':adress, 'sid=':sid }, 			  function(data){ $('#linkword').html(data);  });
}

function print_check(){
	var gp;
	var court; 
	var mu=$('#mulist').val();
	var sid=$('#sid').val();
	var name=$('#name').val();
	var rs=$('#rslist').val();
	var adress=$('#adress').val();
	switch(court_select){
		case 1: court=1000; break
		case 2: court=rs; break;
		case 3: court=mu; break;
	}
	//court=(mu!='')?mu:(rs!='')?rs:1000;
	MM_openBrWindow('/print_check.php?court='+court+'&gp='+get_gp()+'&summ='+out.toFixed(2)+'&name='+name+'&adress='+adress+'&sid='+sid,'print_check','scrollbars=no,resizable=yes','710','530','true');
}

function get_gp(){
	var gp=document.calcFrm.gp;
	for(var i=0; i<gp.length; i++){
		if(gp[i].checked==true)return gp[i].value;
	}
}

function uncheck_gp(){
	var gp=document.calcFrm.gp;
	if(gp){
	for(var i=0; i<gp.length; i++){
		gp[i].checked=false;
	}
	}
	hidebox('.branchbox');
}

function check_nasled(){
	if($('#1_2_0_opt').val()>0 && $('#1_2_0_opt').val()<100001 && $('#nasled').attr('checked')!=true){
		alert("Иски до 100 001 рубля расматриваются только, если объект спора - интеллектуальная собственность или наследство");
		$('#1_2_0_opt').val('100001');
		$('#pricebox').html('');
		hidebox('#pricebox');
		calculate_gp('1_2');
	}
}*/