
var map_win = null, cat_querystring = "";


function catOpenMapWin(qs) {
	var w = 700;
	var h = 500;
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	url = "http://odintsovo.biz/map/?act=viewmap" + qs;

	map_win = window.open ('', 'mapwnd',  "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left);

	if (map_win.location.href == 'about:blank' || map_win.location.href.search(/\/map\//) == -1) map_win.location.href = url;

	if (!map_win.opener) map_win.opener = self;

	map_win.focus();
}



function catOpenMapDiv(div_id) {
	catOpenMapWin('&div_id='+div_id);
	var div_id = parseInt(div_id);
	if (div_id > 1)
	{
		if (typeof(map_win.getXMLMarkers) != 'undefined')
			map_win.getXMLMarkers("div_id=" + div_id);
		else
			cat_querystring = "div_id=" + div_id;
	}
}



function catOpenMapEl(id) {
	catOpenMapWin('&id='+id);
	var id = parseInt(id);
	if (id > 1)
	{
		if (typeof(map_win.getXMLMarkers) != 'undefined')
			map_win.getXMLMarkers("id=" + id);
		else
			cat_querystring = "id=" + id;
	}
}



function catalog_edit_item(id) {
	var w = 700;
	var h = 500;
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	if(top < 0) top = 0;
	if(left < 0) left = 0;
	(window.open("/adm/catalog/item_edit.asp?id=" + id + "&rnd=" + Math.round(Math.random()*10000), "catalogedit", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h + ",top=" + top + ",left=" + left)).focus();
}

function catalog_edit_div(div_id) {
	var w = 700;
	var h = 500;
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	if(top < 0) top = 0;
	if(left < 0) left = 0;
	(window.open("/adm/catalog/div_edit.asp?id=" + div_id + "&rnd=" + Math.round(Math.random()*10000), "catalogedit", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + h + ",top=" + top + ",left=" + left)).focus();
}


function news_video(id) {
	var w = 500;
	var h = 500;
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	if(top < 0) top = 0;
	if(left < 0) left = 0;
	(window.open("/news/video.asp?id=" + id + "&rnd=" + Math.round(Math.random()*10000), "news_video", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=" + w + ", height=" + h + ", top=" + top + ", left=" + left)).focus();
}






