 /*function Messs(id){
		alert(id);
		//$('.myinputs').load('persons.php',{'id':id});
	$("#adrr").hide(200);
}*/

$(document).ready(function(){
     
     $('a.ltllink').click(function(){

          url = $(this).attr('href');

          $.ajax({
              url: url,
              dataType: "html",
              type: 'POST',
              success: function (data) 
              {
				$('#addr').html(data);
				document.body.scrollTop = '1500';
               }
          });          
          
          return false;
     });
});

function opwin(picname,pictext,thishref,winup,winleft)

	{

	if (!winup)	winup=0;

	if (!winleft) winleft=0;

	

	win= window.open(thishref,'page_id','width=800,height=600,resizable=yes,scrollbars=no,location=no,status=no')

	o = win.document

	o.writeln('<html>')

	o.writeln('<head>')

	o.writeln('<title>::: '+pictext+' :::</title>')



	o.writeln('<script language=\'javascript\' type=\'text/javascript\'>') 

	o.writeln('var arrTemp=self.location.href.split(\'?\');') 

	o.writeln('var picUrl = (arrTemp.length>0)?arrTemp[1]:\'\';') 

	o.writeln('var NS = (navigator.appName==\'Netscape\')?true:false;') 

	o.writeln('function FitPic(winup,winleft) {')

		

	o.writeln('if (winleft<1) winleft = (screen.width - document.images[0].width) / 2 ;')

	o.writeln('if (winup<1) winup = (screen.height - document.images[0].height) / 2 ;')

	

	o.writeln('if(winleft<0) winleft=0;')

	o.writeln('if(winup<0) winup=0;')	

	o.writeln('iWidth = document.images[0].width;')

	o.writeln('iHeight = document.images[0].height;')

	

	o.writeln('window.moveTo(winleft,winup);')

	o.writeln('self.resizeTo(iWidth + 17, iHeight + 57);')



	o.writeln('};')

	o.writeln('</script>')



	o.writeln('</head>')

	o.writeln('<body onload=\'FitPic('+winup+','+winleft+');\' style=\'padding:0;margin:0;\'>')



	o.writeln('<table width="100%" border="0" cellspacing="0" cellpadding="0" style="height:100%;">')

	o.writeln('<tr>')

	o.writeln('<td align="center" valign="middle">')

	o.writeln('<img src="'+picname+'" alt="'+pictext+'" >')

	o.writeln('</td>')

	o.writeln('</tr>')

	o.writeln('</table>')



	o.writeln('</body>')

	o.writeln('</html>')



	o.close()

	win.focus()

	

	}

	

	/*

	o.writeln('var winleft = (screen.width - document.images[0].width) / 2 ;')

	o.writeln('var winup = (screen.height - document.images[0].height) / 2;')

	o.writeln('var winup=0;')	

	

	*/

	

	// Открытие версии для печати

function print_vers(text,title,pathcss,footinfo)

{

	win= window.open('','','width=800,height=1200,resizable=yes,scrollbars=yes,toolbar=no,menubar=yes')
	o = win.document
	o.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">')
	o.writeln('<html>')
	o.writeln('<head>')
	o.writeln('<title>::'+title+'::</title>')
	o.writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">')
	o.writeln('<link rel="stylesheet" type="text/css" href="'+pathcss+'">')
	o.writeln('</head>')
	o.writeln('<body>')
	o.writeln('<table width=100% border=0 cellspacing=0 cellpadding=0 style=height:90%>')
	o.writeln('<tr><td align="left" valign="top" style="padding:10px 10px 10px 20px;">')
	o.writeln(text)
	o.writeln(footinfo)
	o.writeln('</td></tr>')
	o.writeln('</table>')
	o.writeln('</body>')
	o.writeln('</html>')
	o.close()
	win.focus()
}

function printMapRus(img) {
	text='<div><h1>Карта проезда</h1><div style="padding: 10px 0 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="cellpunktir2"><td style="height:10px;"></td></tr></table></div><div class="content"><img alt="Карта проезда к отелю" src="'+img+'"></div><div style="padding: 10px 0 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="cellpunktir2"><td style="height:10px;"></td></tr></table></div>';
	print_vers(text,"Проезд - версия для печати","/DESIGN/MG/main.css","Московская горка :: Как нас найти :: Версия для печати");
}

function printMapEng(img) {
	text='<div><h1>How Get</h1><div style="padding: 10px 0 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="cellpunktir2"><td style="height:10px;"></td></tr></table></div><div class="content"><img alt="Map" src="'+img+'"></div><div style="padding: 10px 0 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr class="cellpunktir2"><td style="height:10px;"></td></tr></table></div>';
	print_vers(text,"How Get - The Print Version","/DESIGN/MG/main.css","Moskovskaya Gorka Hotel :: How Get :: The Print Version");
}


/*$(document).ready(function(){

function tes(v){
//$(".ltllink").click(function() {
	//v = $(".ltllink").val();
		alert(v);
		$("#addr").hide(200);
//});
}

	 var PicCounter = 0;
     var gPicture = $("#gallery div div img");
     var PicAmount = gPicture.length;
     $("body").css({ overflowX: 'auto' });


     if (PicAmount){
          $(".photo div img").attr("id", function (arr) { return "inn"+arr; });
          $(".photo div img").click(function() {
               $("#gallery").css({ width: document.body.offsetWidth + 'px', height: $("table").height() + 'px', display: 'block' });
               $("body").css({ overflowX: 'hidden' });
               $("#gallery .alls").css({ top: ((document.body.offsetHeight - $("#gallery .alls").height() - 500)/2 + document.body.scrollTop) + 'px', left: ((document.body.offsetWidth - 800)/2) + 'px' });
               PicCounter = parseInt(this.id.replace('inn',''));
               
               $("#gallery .alls .txt").html(gPicture[PicCounter].alt)
               $("#gallery .alls div div").css({left: -(gPicture[PicCounter].offsetWidth*PicCounter)+"px"});
     
               $("#gallery .prev").css({ visibility: 'visible' });     
               $("#gallery .next").css({ visibility: 'visible' });     
               if (PicCounter<=0)
                    $("#gallery .prev").css({ visibility: 'hidden' });     
               if ((PicCounter+1)>=PicAmount)
                    $("#gallery .next").css({ visibility: 'hidden' });     
          });
          
          if (PicAmount>1) {
               
               $("#gallery .next").click(function(){
			   
                    PicCounter++;
                    $("#gallery .alls div div").animate({
                         left: -(gPicture[PicCounter].offsetWidth*PicCounter)+"px"
                    }, 700 );
                    $("#gallery .alls .txt").html(gPicture[PicCounter].alt)
                    if((PicCounter+1)>=PicAmount) 
                         $(this).css({ visibility: 'hidden' });
                    $(".prev").css({ visibility: 'visible' });
                    return false;
               });
     
               $("#gallery .prev").click(function() {
                    PicCounter--;
                    $("#gallery .alls div div").animate({
                         left: -(gPicture[PicCounter].offsetWidth*PicCounter)+"px"
                    }, 700 );
                    $("#gallery .alls .txt").html(gPicture[PicCounter].alt)
                    if((PicCounter-1)<0) 
                         $("#gallery .prev").css({ visibility: 'hidden' });
                    $("#gallery .next").css({ visibility: 'visible' });
                    return false;
               });
          }else
               $("#gallery .next").css({ visibility: 'hidden' });
			   
     }
});*/

$(function() {
	// Use this example, or...
	$('a[@rel*=lightbox]').lightBox(); // Select all links that contains lightbox in the attribute rel
	// This, or...
	$('#gallery a').lightBox(); // Select all links in object with gallery ID
	// This, or...
	$('a.lightbox').lightBox(); // Select all links with lightbox class
	// This, or...
	//$('a').lightBox(); // Select all links in the page
	// ... The possibility are many. Use your creative or choose one in the examples above
});


function closeWindow(block,num){
	var oursblock = document.getElementById(block);
	if (oursblock){
		if (num){
			num.parentNode.className = num.parentNode.className.replace('select','');
			num.setAttribute('onclick','showWindow(\''+block+'\',this);');
		}
		oursblock.style.display = 'none';
		if (oursblock.style.visibility)
			oursblock.style.visibility = 'hidden';
	}
}

