function initialize() {

	var latlng = new google.maps.LatLng(50.44106, 30.505198);
	
	var myOptions = {
		zoom: 15,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	
	var image = '/files/images/common/pushpin.png';
	var Marker = new google.maps.Marker({
		position: latlng,
		map: map,
		title:"IQ Bar. Smart cuisine*",
		icon: image
	});
}

$(document).ready(function(){

$("a[rel^='prettyPhoto']").prettyPhoto({
	animationSpeed: 'slow',
	theme: 'light_rounded',
	opacity: 0.6, 
	counter_separator_label: ' / '
});

$("a[rel^='prettyMap_ru']").prettyPhoto({
	opacity: 0.6,
	custom_markup: '<div id="google_box"><div style="position: relative; display: block; left: 100%; margin-left: -75px; top: 9px; width: 67px; height: 12px; border: 0; cursor: pointer;" onclick="$.prettyPhoto.close();"><img src="/files/images/common/ru/close.png"></div><div id="popup_header">г.Киев, ул.Льва Толстого, 25 &nbsp;<a target="_blank" href="http://maps.google.com.ua/maps?hl=ru&q=%D0%BA%D0%B8%D0%B5%D0%B2+%D0%BB%D1%8C%D0%B2%D0%B0+%D1%82%D0%BE%D0%BB%D1%81%D1%82%D0%BE%D0%B3%D0%BE+25&ie=UTF8&hq=&hnear=%D0%9B%D1%8C%D0%B2%D0%B0+%D0%A2%D0%BE%D0%BB%D1%81%D1%82%D0%BE%D0%B3%D0%BE+%D0%B2%D1%83%D0%BB.,+25,+%D0%9A%D0%B8%D1%97%D0%B2&gl=ua&ei=xUazTPTlLsvAswbGsY3EDQ&ved=0CBYQ8gEwAA&z=16">Перейти к увеличенной карте</a><img alt="" src="/files/images/common/new.png" style="padding-left: 5px; vertical-align: -2px;"></div><div id="map_canvas" style="width:700px; height:388px"></div></div>',
	changepicturecallback: function(){ initialize(); }
});

$("a[rel^='prettyMap_en']").prettyPhoto({
	opacity: 0.6,
	custom_markup: '<div id="google_box"><div style="position: relative; display: block; left: 100%; margin-left: -75px; top: 9px; width: 67px; height: 12px; border: 0; cursor: pointer;" onclick="$.prettyPhoto.close();"><img src="/files/images/common/en/close.png"></div><div id="popup_header">Kyiv, L\'va Tolstogo str., 25 &nbsp;<a target="_blank" href="http://maps.google.com.ua/maps?hl=en&q=%D0%BA%D0%B8%D0%B5%D0%B2+%D0%BB%D1%8C%D0%B2%D0%B0+%D1%82%D0%BE%D0%BB%D1%81%D1%82%D0%BE%D0%B3%D0%BE+25&ie=UTF8&hq=&hnear=%D0%9B%D1%8C%D0%B2%D0%B0+%D0%A2%D0%BE%D0%BB%D1%81%D1%82%D0%BE%D0%B3%D0%BE+%D0%B2%D1%83%D0%BB.,+25,+%D0%9A%D0%B8%D1%97%D0%B2&gl=ua&ei=xUazTPTlLsvAswbGsY3EDQ&ved=0CBYQ8gEwAA&z=16">View extended map</a><img alt="" src="/files/images/common/new.png" style="padding-left: 5px; vertical-align: -2px;"></div><div id="map_canvas" style="width:700px; height:388px"></div></div>',
	changepicturecallback: function(){ initialize(); }
});

var login = $('#login_box');
var remind = $('#remind_box');
var partners = $('#partners_box');
var comment = $('#comment_box');
var error = $('#error_box');
var mask = $('#mask');

mask.hide(); 

/////////////////////////////////////////////////////////

$('.enter').click(function(){

mask.show(50).fadeTo('fast',0.6, function () 
{
	remind.hide(10).fadeOut('fast');
	comment.hide(10).fadeOut('fast');
	error.hide(10).fadeOut('fast');
	partners.hide(10).fadeOut('fast');
		
	login.show(10).fadeIn('fast',1); 
}
);

});

/////////////////////////////////////////////////////////

$('.remind').click(function(){

mask.show(50).fadeTo('fast',0.6, function () 
{
	login.hide(10).fadeOut('fast');
	comment.hide(10).fadeOut('fast');
	error.hide(10).fadeOut('fast');
	partners.hide(10).fadeOut('fast');
		
	remind.show(10).fadeIn('fast',1); 
}
);

});

/////////////////////////////////////////////////////////

$('.partners').click(function(){

mask.show(50).fadeTo('fast',0.6, function () 
{
	login.hide(10).fadeOut('fast');
	remind.hide(10).fadeOut('fast');
	error.hide(10).fadeOut('fast');
	comment.hide(10).fadeOut('fast');
		
	partners.show(10).fadeIn('fast',1); 
}
);

});

/////////////////////////////////////////////////////////

$('.comment_this').click(function(){

mask.show(50).fadeTo('fast',0.6, function () 
{
	login.hide(10).fadeOut('fast');
	remind.hide(10).fadeOut('fast');
	error.hide(10).fadeOut('fast');
	partners.hide(10).fadeOut('fast');
		
	comment.show(10).fadeIn('fast',1); 
}
);

});

/////////////////////////////////////////////////////////

$('.error').click(function(){

mask.show(50).fadeTo('fast',0.6, function () 
{
	login.hide(10).fadeOut('fast');
	remind.hide(10).fadeOut('fast');
	comment.hide(10).fadeOut('fast');
	partners.hide(10).fadeOut('fast');
	
	error.show(10).fadeIn('fast',1); 
}
);
});

/////////////////////////////////////////////////////////

function closemy() {
	
	mask.fadeOut('fast', function () 
	{
		login.hide(10).fadeOut('fast');
		remind.hide(10).fadeOut('fast');
		comment.hide(10).fadeOut('fast');
		partners.hide(10).fadeOut('fast');
		error.hide(10).fadeOut('fast');
	}
	);
}

/////////////////////////////////////////////////////////

$(document).keydown(function(e){
if (e.keyCode == 27){
	
	closemy();
	
};
});

/////////////////////////////////////////////////////////

$('.close').click(function() {

	closemy();
	
}
);

/////////////////////////////////////////////////////////

mask.click(function(){

	closemy();

}
);

});

