$(document).ready(function(){
	
	$(".bronhotel").click(function(){
		return hs.htmlExpand(this, {objectType: 'ajax', preserveContent: false});
	});
	
	$(".highslide-maincontent .toggle_panel").hide();
	
	$(".highslide-maincontent a.toggle").click(function(){
		$(this).parent().next(".toggle_panel").slideToggle("fast");
	});
	
// Added by m157y	
	hs.Expander.prototype.onAfterExpand = function (sender) {
		$('#Hotel-DateStart').datepick();
		$('#Hotel-DateEnd').datepick();
	}
// End of add
	
	$('#faq')
		.mouseover(function(){
			$(this).stop().animate({backgroundPosition:"(-10px -10px)"}, {duration:300})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(-30px -10px)"}, {duration:300})
		})
	//snow_start();
})



hs.graphicsDir = '/js/hs/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
hs.dimmingOpacity = 0.75;
hs.creditsHref='';
hs.lang = {
	cssDirection: 'ltr',
	loadingText: 'Загружается...',
	loadingTitle: 'Нажмите для отмены',
	focusTitle: 'Нажмите чтобы поместить на передний план',
	fullExpandTitle: 'Развернуть до оригинального размера',
	creditsText: '',
	creditsTitle: 'Перейти на главную страницу Инфофлот',
	previousText: 'Предыдущее',
	nextText: 'Следующее',
	moveText: 'Переместить',
	closeText: 'Закрыть',
	closeTitle: 'Закрыть (esc)',
	resizeTitle: 'Изменить размер',
	playText: 'Слайдшоу',
	playTitle: 'Начать слайдшоу (пробел)',
	pauseText: 'Пауза',
	pauseTitle: 'Приостановить слайдшоу (пробел)',
	previousTitle: 'Предыдущее (стрелка влево)',
	nextTitle: 'Следующее (стрелка вправо)',
	moveTitle: 'Переместить',
	fullExpandText: 'Оригинальный размер',
	number: 'Изображение %1 из %2',
	restoreTitle: 'Нажмите чтобы закрыть изображение, нажмите и перетащите для изменения местоположения. Для просмотра изображений используйте стрелки.'
};

	var galleryOptions = {
		slideshowGroup: 1,
		align: 'center',
		transitions: ['expand', 'crossfade'],
		fadeInOut: true
	};

	if (hs.addSlideshow) hs.addSlideshow({
				slideshowGroup: 1,
				interval: 5000,
				repeat: true,
				useControls: true,
				align: 'center',
				fixedControls: 'fit',
					overlayOptions: {
						opacity: .75,
						position: 'bottom center',
						hideOnMouseOut: true
				}
	});
			

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

numImages = 10    //How many images you have in your page
loaderWidth = 300 //The width of the loadbar

var px = bw.ns4||window.opera?"":"px";

currentImg = 0

function lib_doc_size(){ 
  this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
  this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
  if(!this.x2||!this.y2) return message('Document has no width or height') 
  this.x50=this.x2/2;this.y50=this.y2/2;
  return this;
}

//Lib objects  ********************
function lib_obj(obj,nest){ 
  nest=(!nest) ? "":'document.'+nest+'.'
  this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj):0;	
  this.css=bw.dom||bw.ie4?this.evnt.style:this.evnt; 
  this.ref=this.css
  this.w=this.evnt.offsetWidth||this.css.clip.width||
    this.ref.width||this.css.pixelWidth||0; 
  return this
}
//Moving object to **************
lib_obj.prototype.moveIt = function(x,y){
  this.x=x; this.y=y; this.css.left=x+px; this.css.top=y+px;
}
//Clipping object to ******
lib_obj.prototype.clipTo = function(t,r,b,l,setwidth){ 
  this.ct=t; this.cr=r; this.cb=b; this.cl=l
  if(bw.ns4){
    this.css.clip.top=t;this.css.clip.right=r
    this.css.clip.bottom=b;this.css.clip.left=l
  }else{
    if(t<0)t=0;if(r<0)r=0;if(b<0)b=0;if(b<0)b=0
    this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";
    if (setwidth){
		this.css.pixelWidth = r;
		this.css.pixelHeight = b;
		this.css.width = r+px; 
		this.css.height = b+px;
	}
  }
}
		// снег
		container='container';
		snow_intensive=400; 
		snow_speed=5000; 
		snow_src=new Array('/i/snow/sneg1.gif','/i/snow/sneg2.gif','/i/snow/sneg3.gif','/i/snow/sneg4.png'); 

	

		function snow_start() { 
			snow_id=1; 
			snow_y=$("#" + container).height()-30; 
			setInterval(function() { 
				snow_x=Math.random()*document.body.offsetWidth-100; 
				snow_img=(snow_src instanceof Array ? snow_src[Math.floor(Math.random()*snow_src.length)] : snow_src); 
				snow_elem='<img class="png" id="snow'+snow_id+'" style="position:absolute; left:'+snow_x+'px; top:0;z-index:10000" src="'+snow_img+'">'; 
				$("#" + container).append(snow_elem); 
				snow_move(snow_id); 
				snow_id++; 
			},snow_intensive);
		} 
		
		function snow_move(id) { 
			$('#snow'+id).animate({top:snow_y,left:"+="+Math.random()*100},snow_speed,function() { 
			$(this).empty().remove(); 
		});}
		// конец снегу
