
function OpenModalIframe() // {{{
{
	var body = $('body').eq(0);

	var window_height = parseInt(window.innerHeight || document.body.clientHeight || 0);
	var window_width = parseInt(window.innerWidth || document.body.clientWidth || 0);
	//alert(window_height);
	var total_height = parseInt(body.attr('offsetHeight'));
	//alert(total_height);
	if(total_height < window_height) total_height = window_height;

	var total_height = parseInt(window.innerHeight || document.body.clientHeight || 600);

	var ua = navigator.userAgent.toLowerCase();
	var isOpera = (ua.indexOf('opera')  > -1);
	var isIE = (!isOpera && ua.indexOf('msie') > -1);
	 
 
	function getDocumentHeight() {
	  return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
	}
	 
	function getViewportHeight() {
	  return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
	}
	 

	var total_height = getDocumentHeight();

	var bg = $('<div>').appendTo(body).attr('name', 'modal_background').css({
				position: 'absolute',
				left: '0px',
				top: '0px',
				width: body.attr('offsetWidth'),
				height: total_height,
				backgroundColor:'#6e6e6e',
				opacity: 0.5,
				zIndex:100
			})
			.bind('click', function(){
				$('div[@name="modal_testdiv"]').remove();
				$('iframe[@name="modal_iframe_new"]').remove();
				$('div[@name="lefttop_new"]').remove();
				$('div[@name="leftbottom_new"]').remove();
				$('div[@name="righttop_new"]').remove();
				$('div[@name="rightbottom_new"]').remove();
				$('div[@name="top_new"]').remove();
				$('div[@name="bottom_new"]').remove();
				$('div[@name="crush"]').remove();
				$('div[@name="image"]').remove();
				$('div[@name="menu"]').remove();
				$(this).remove();
			});


	//var w = parseInt(width) || 300;
	//var w = window_width - (25 * 2);
	var w=740;
	//var h = parseInt(height) || 300;
	//var h = total_height - (100 * 2);
	var h=430-(38*2);
	var t = 108;

	if (navigator.appName == 'Microsoft Internet Explorer') {var sdvig=-8}
	else
	{var sdvig=3;w=w-1;}


	var l = Math.ceil(parseInt(bg.attr('offsetWidth')) / 2 - (w / 2)+sdvig);
	
	var t_new= t-38;
	var l_new= l+38;
	var l_end= l+w-38;
	var t_end= t+h;
	var w_new= w-(38*2);
	h_freim = h-20;
	w_freim = w-100;

	var test_div = $('<div>').attr('name', 'modal_testdiv').css({
		backgroundColor: '#ffffff',
		position: 'absolute',
		left: l,
		top: t,
		height: h,
		width: w,
		opacity: 1,
		zIndex: 110
		}).appendTo(body);
	
	var zagolovok = $('<p align="center" style="font-size:16px;"><strong>Выберите Ваш регион</strong></p>').attr('name', 'p_title').appendTo('div[@name="modal_testdiv"]');
	
	var div_image = $('<div>').appendTo('div[@name="modal_testdiv"]').attr('name', 'image').css({
				position: 'absolute',
				left: 50,
				top: 50,
				width: '255px',
				height: '182px' ,
				background:'url(http://www.leaderteam.biz/images/pm/000000158.jpg) no-repeat top left',
				zIndex:115
			});
	
	var menu = $('<div>').appendTo('div[@name="modal_testdiv"]').attr('name', 'menu').css({
				position: 'absolute',
				left: 345,
				top: 50,
				width: '150px',
				height: '100px' ,
				zIndex:115
			});
	
	var zagolovok = $('<p align="left" style="font-size:14px; color:#4071e2"><strong>"Leader Team"</strong><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Moscow(); return false;">Москва</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Peterburg(); return false;">Санкт-Петербург</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Ekaterinbyrg(); return false;">Екатеринбург</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Novgorod(); return false;">Нижний Новгород</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Samara(); return false;">Самара</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Rostov(); return false;">Ростов-на-Дону</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Novosibirsk(); return false;">Новосибирск</a><br><br><a href="#" style="text-decoration:underline; color:#4071e2"  onClick="Kiev(); return false;">Киев</a></p>').appendTo('div[@name="menu"]');
	
	var lefttop_new = $('<div>').appendTo(body).attr('name', 'lefttop_new').css({
				position: 'absolute',
				left: l,
				top: t_new,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/top_left.png) no-repeat top left',
				zIndex:115
			});
	var leftbottom_new = $('<div>').appendTo(body).attr('name', 'leftbottom_new').css({
				position: 'absolute',
				left: l,
				top: t_end,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/bottom_left.png) no-repeat top left',
				zIndex:115
			});
	var top_new = $('<div>').appendTo(body).attr('name', 'top_new').css({
				position: 'absolute',
				left: l_new,
				top: t_new,
				width: w_new,
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/whitepoloska.gif) repeat-x top left',
				zIndex:115
			});
	var bottom_new = $('<div>').appendTo(body).attr('name', 'bottom_new').css({
				position: 'absolute',
				left: l_new,
				top: t_end,
				width: w_new,
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/whitepoloska.gif) repeat-x top left',
				zIndex:115
			});
	var righttop_new = $('<div>').appendTo(body).attr('name', 'righttop_new').css({
				position: 'absolute',
				left: l_end,
				top: t_new,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/top_right.png) no-repeat top left',
				zIndex:115
			});
			
	var rightbottom_new = $('<div>').appendTo(body).attr('name', 'rightbottom_new').css({
				position: 'absolute',
				left: l_end,
				top: t_end,
				width: '38px',
				height: '38px' ,
				background:'url(http://www.leaderteam.biz/images/pm/bottom_right.png) no-repeat top left',
				zIndex:115
			});
	var crush = $('<div>').appendTo($('div[@name="righttop_new"]')).attr('name', 'crush').css({
				position: 'absolute',
				left: -90,
				top: 20,
				cursor: 'pointer',
				width: '91px',
				height: '10px' ,
				background:'url(http://www.leaderteam.biz/images/pm/close_window.gif) no-repeat top left',
				zIndex:115
			})
			.bind('click', function(){
				$('div[@name="modal_background"]').remove();
				$('div[@name="modal_testdiv"]').remove();
				$('iframe[@name="modal_iframe_new"]').remove();
				$('div[@name="lefttop_new"]').remove();
				$('div[@name="leftbottom_new"]').remove();
				$('div[@name="righttop_new"]').remove();
				$('div[@name="rightbottom_new"]').remove();
				$('div[@name="top_new"]').remove();
				$('div[@name="bottom_new"]').remove();
				$(this).remove();
			});
	scrollIt(top);			
} // }}}


function Moscow(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.leaderteam-msk.ru/","img_popup");
}

function Peterburg(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.leaderteam.biz/","img_popup");
}

function Ekaterinbyrg(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
}

function Novgorod(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.nnovgorod.leaderteam.biz/","img_popup");
}

function Samara(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.samara.leaderteam.biz/","img_popup");
}

function Rostov(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
}

function Novosibirsk(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.novosib.leaderteam.biz/","img_popup");
}


function Kiev(){
	$('div[@name="modal_testdiv"]').remove();
	$('iframe[@name="modal_iframe_new"]').remove();
	$('div[@name="lefttop_new"]').remove();
	$('div[@name="leftbottom_new"]').remove();
	$('div[@name="righttop_new"]').remove();
	$('div[@name="rightbottom_new"]').remove();
	$('div[@name="top_new"]').remove();
	$('div[@name="bottom_new"]').remove();
	$('div[@name="crush"]').remove();
	$('div[@name="image"]').remove();
	$('div[@name="menu"]').remove();
	$('div[@name="modal_background"]').remove();
	window.open("http://www.kiev.leaderteam.biz/","img_popup");
}


// vim: set ts=4 sw=4 foldmethod=marker foldlevel=0:

