$(document).ready(function(){
	$('#menu').pngFix( );
	$('#karta').pngFix( );

	var size_width = $(".width").length;
	for (var i = 0; i <= size_width; i++) {
		var el_width = $('.width').eq(i).width();
		$('.inline').eq(i).css("width",el_width + "px");
	}
	
	$("#country_select").change( function () {
		var selected = $("#country_select option:selected");
		window.location = selected.val();
	});
	$("#hotels_select").change( function () {
		var selected = $("#hotels_select option:selected");
		window.location = selected.val();
	});
	
	$('#menu ul li, #karta').hide();
	$('#menu ul li, #karta').show();	
	$('#menu ul li, #karta').show();
	var cont_width = $('.content').width();
	var cont_width1 = cont_width - 50;
	if ($('.need2small').width() > 510){
		$('.need2small').css("width", 500 + "px");
	}

	if($('.carousel').length) {	
		$('.carousel').show();
		if ($('#wrapper').width() > '1260') {$('.jCarouselLite ul li').addClass("smoke_ul"); $('.left_slide').css("left","14px"); $('.right_slide').css("right","13px");}
		else {$('.slide_li').addClass("smoke_ulli1"); $('.left_slide').css("left","5px");$('.right_slide').css("right","5px");}
		
		$(".nonCircular .jCarouselLite").jCarouselLite({
			btnNext: ".right_slide",
			btnPrev: ".left_slide",
			mouseWheel: false,
			circular: true,
			visible: 4
		});
		
		if ($('#container').width() > '1260') {$('.jCarouselLite').css("width","760px").css("margin","0 auto");}
		else {$('.jCarouselLite').css("width","509px").css("margin","0 auto");}
		
		$('.r').hide();
		$('.r').show();
	}
	

	$.post("/protect/index.php", {
	}, function(xml){
		$("message",xml).each(function(id){
			message = $("message",xml).get(id);
			$("#TI_index").html( $("msg",message).text() );
		});
	});
	$.post("/protect/tourHot.php", {
	}, function(xml){
		$("message",xml).each(function(id){
			message = $("message",xml).get(id);
			$("#TI_tourHot").html( $("msg",message).text() );
		});
	});

});


function optionString0 (w,h) {
	nwL = (screen.width - w) / 2;
	nwT = (screen.height - h) / 2;
	opt = 'toolbar=yes,titlebar=yes,resizable=yes,menubar=yes,scrollbars=yes,status=yes,location=yes,left=' + nwL + ',top=' + nwT + ',width=' + w + ',height=' + h;
	return opt;
}
function openURL0(href,w,h,wn) {
	if((w==undefined)||(h==undefined))
	{
		w=screen.width/1.5;
		h=screen.height/1.5;
	}
	newWin = window.open (href,wn, optionString0 (w,h));
	newWin.focus ();
}
