function reg (regid, kurid)
	{							
//	alert(regid+" "+kurid);
							var ref='ref=';
							ref=ref+$("#cntry").val()+"&action=region"+"&reg="+regid;

							 $.ajax({			   
							    type: "GET",
							    url: "/selector.php",            
								data: ref,
							    success: function (data, textStatus) { 
							          $("#region").html(data);
							    } 	

							});	  
							sub($("#cntry").val(), kurid);
							
		
	}
	
function sub(all, kurort_id)
	{
							
							 
							var ref='ref=';
							ref=ref+$("#reg_select").val()+"&action=kurort"+"&all="+all+"&kurid="+kurort_id;
							 $.ajax({			   
							    type: "GET",
							    url: "/selector.php",            
								data: ref,
							    success: function (data, textStatus) { 
  					            $("#kurort").html(data);
							    } 	

							});
							
		
	}
	
 	$(document).ready(function(){	 							
		
		if ($(window).width()>1280) $("#ghost1").css('visibility', 'visible');
		if ($(window).width()>1280) $("#ghost2").css('visibility', 'visible');

	    $(function() {
			$("#galery_box a[href*=empty.gif]").addClass('free');
			$("#galery_box a[href*=empty.gif]").attr('href','#_');
	        $('#galery_box a').not('.left').not('.free').lightBox();
			
	    });		
		/*
		$('i').each(function(index) {
			$(this).not('.top_link').replaceWith("<a href='" + $(this).attr("title") + "'>" +$(this).html() + "</a>");
		});		
		*/
		
		
		//Заполняем меню из текстовых файлов ... мне тоже не нравиться, но так надо
		
	
		/*
		$.get("/parts/menu/1.txt", function(data){												
		
			$("#img_add").html("<a href='/operator_list.php'><img src='/img/3.jpg' border='0px'  alt=''></a>");					
			
			$("#dv1").html(data);
				$.get("/parts/menu/2.txt", function(data2){																		
				$("#dv2").html(data2);										
		
					$.get("/parts/menu/3.txt", function(data3){																			
					$("#dv3").html(data3);	
														
							$.get("/parts/menu/4.txt", function(data4){																		
							$("#dv4").html(data4);										
									
											});		
							
										});		
											
									});										
								
								
							});			

		*/
		$(function(){
			$("#stars-wrapper1").children().not(":radio").hide();
			$("#stars-wrapper1").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper2").children().not(":radio").hide();
			$("#stars-wrapper2").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper3").children().not(":radio").hide();
			$("#stars-wrapper3").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper4").children().not(":radio").hide();
			$("#stars-wrapper4").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper5").children().not(":radio").hide();
			$("#stars-wrapper5").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper6").children().not(":radio").hide();
			$("#stars-wrapper6").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		$(function(){
			$("#stars-wrapper7").children().not(":radio").hide();
			$("#stars-wrapper7").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
			$(function(){
			$("#stars-wrapper0").children().not(":radio").hide();
			$("#stars-wrapper0").stars({										
																			
				 split: 2, cancelShow: false,   oneVoteOnly: true
			});
		});
		
		
		$(".estimate").click(function(){				
				$("#c1").text($("[name=rate_pos]").val()/2);
				$("#c2").text($("[name=rate_serv]").val()/2);				
				$("#c3").text($("[name=rate_food]").val()/2);								
				$("#c4").text($("[name=rate_beatch]").val()/2);
				$("#c5").text($("[name=rate_fun]").val()/2);
				$("#c6").text($("[name=rate_room]").val()/2);
				$("#c7").text($("[name=rate_koef]").val()/2);				
				var avg=$("[name=rate_pos]").val()/2+$("[name=rate_serv]").val()/2+$("[name=rate_food]").val()/2+$("[name=rate_beatch]").val()/2+$("[name=rate_fun]").val()/2+$("[name=rate_room]").val()/2+$("[name=rate_koef]").val()/2;
				avg=avg/7;
								
					var n = avg;
					n = Number(n.toFixed(1));
					
				$("#c0").text(n);				
				$("#stars-wrapper0").stars("selectID", n*2);
						
		});		
		
		$(".estimate").show();
		$(".estimate2").show();
		$(".estimate_2").show();
		
	});
