function getClientSTop(){
return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop)
}

function getClientSLeft(){
return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}

// JavaScript Document
	var region_in_select = "";
	var region_in_select_alt = "";
	
	
	function showinfreg(elem, e)
	{
		if (region_in_select == "")
			return;

		if (document.all['info_'+region_in_select] == undefined)
			return;

		//var str_head = elem.alt;
		var str_head = elem.getAttribute('name_alt');

		str = '<table><tr><td class="smallFont"><b>'+str_head+'</b></td></tr><tr><td align="top" class="smallFont">'+document.all['info_'+region_in_select].innerHTML;+'</td></tr></table>';
		document.all['content_inform'].innerHTML = str;		
		document.all['information'].style.visibility = "visible";
		
		
        if (window.screenTop == undefined )
        {
            document.all['information'].style.left = e.screenX - self.pageXOffset + 30;
            document.all['information'].style.top = e.clientY-270 + getClientSTop();
        }
        else
        {
            var top;
            if (window.screenTop == '-8') {top = 89 + 250;} else {top = window.screenTop+250;}
            document.all['information'].style.left = event.screenX - window.screenLeft + 30;
            document.all['information'].style.top = event.screenY - top + getClientSTop();
        }

	}

	function showinfpoint(id_point,elem)
	{
		if (region_in_select == "")
			return;

		if (document.all['info_'+region_in_select] == undefined)
			return;

		//var str_head = elem.alt;
		var str_head = elem.getAttribute('name_alt');

		str = '<table><tr><td class="smallFont"><b>'+str_head+'</b></td></tr><tr><td align="top" class="smallFont">'+document.all['info_'+region_in_select].innerHTML;+'</td></tr></table>';
		document.all['content_inform'].innerHTML = str;
		document.all['information'].style.visibility = "visible";


        if (window.screenTop == undefined )
        {
            document.all['information'].style.left = e.screenX - self.pageXOffset + 30;
            document.all['information'].style.top = e.clientY-270 + getClientSTop();
        }
        else
        {
            var top;
            if (window.screenTop == '-8') {top = 89 + 250;} else {top = window.screenTop+250;}
            document.all['information'].style.left = event.screenX - window.screenLeft + 30;
            document.all['information'].style.top = event.screenY - top + getClientSTop();
        }     

        /*
		if (document.all['info_'+id_point] == undefined)
			return;
		str = '<table><tr><td class="smallFont"><b>'+region_in_select_alt+'</b></td></tr><tr><td class="smallFont"><b>'+elem.alt+'</b></td></tr><tr><td align="top" class="smallFont">'+document.all['info_'+id_point].innerHTML;+'</td></tr></table>';
		//str = '<table><tr><td class="smallFont"><b>'+region_in_select_alt+'</b></td></tr><tr><td class="smallFont"><b>'+elem.getAttribute('name_alt')+'</b></td></tr><tr><td align="top" class="smallFont">'+document.all['info_'+id_point].innerHTML;+'</td></tr></table>';
		document.all['content_inform'].innerHTML = str;
		document.all['information'].style.visibility = "visible";
		
		if (window.screenTop == undefined )
        {
            document.all['information'].style.left = event.screenX - self.pageXOffset + 10;
            document.all['information'].style.top = event.clientY + getClientSTop();
	    }
        else
        {
            var top;
            if (window.screenTop == '-8') {top = 89;} else {top = window.screenTop;}
            document.all['information'].style.left = event.screenX - window.screenLeft + 10;
            document.all['information'].style.top = event.screenY - top + getClientSTop();
		}
		*/
	}

	
	function change_image(elem)
	{
		//var elem = event.srcElement;
//		var id = elem.id_img;
		var id = elem.getAttribute('id_img');
		document.all['table_ower'].style.backgroundColor = elem.getAttribute('name_select');
		document.all[id].style.display = "none";
		region_in_select = elem.getAttribute('regid');

		//escho nugno sformirovat` sloy s informachiey o regeone
		if (elem.getAttribute('pointid') == undefined)
			region_in_select_alt = elem.alt;
		else
			showinfpoint(elem.getAttribute('pointid'),elem);
	}
	
	function restore_image(elem)
	{
		//var elem = event.srcElement;
		var id = elem.getAttribute('id_img');
		//document.all[id].src = "modules/module_geomap/maps/russia/"+elem.name_norm;
		document.all[id].style.display = "block";
		document.all['information'].style.visibility = "hidden";
		region_in_select = '';
		region_in_select_alt = '';
	}
	//document.onLoad = MM_preloadImages('reg1_s.gif','reg2_s.gif','reg3_s.gif','reg4_s.gif','reg5_s.gif')

