function regions_show_hide(reg_id)
{
	if (document.getElementById('regions_header'+reg_id).className=='regions_common')
	{
		document.getElementById('regions_header'+reg_id).className='regions_active';
		document.getElementById('regions_container'+reg_id).style.display='block';
	}
	
	else if (document.getElementById('regions_header'+reg_id).className=='regions_active')
	{
		document.getElementById('regions_header'+reg_id).className='regions_common';
		document.getElementById('regions_container'+reg_id).style.display='none';
	}	
}

function regions_passage(link, title)
{
	var win = window.open('','preview', 'width=50, height=50, left=0, top=0, resizable=1, scrollbar=1, status=0, menubar=0, toolbar=0, titlebar=0, addressbar=0');
	var winDoc = win.document;
	var content = "<html>" +
				"<head><title>"+title+"</title><style>body{overflow: hidden; margin: 0px; padding: 0px;} img{border: 0px; display: block;}</style></head>" +
				"<body><img id=\"image\" src=\"" + link.href + "\" /></body>"+
				"</html>";
	win.document.write(content);
	
	winDoc.body.onload = function() 
	{
    	var obj = winDoc.getElementById('image');
		var w = obj.width;
		var h = obj.height;
    	var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
    	var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
    	var top =  (self.opera ? iHeight : screen.availHeight)/2 - h/2;
    	win.resizeTo(w+12,h+85);
    	win.moveTo(left, top);		
	}
	win.onload = winDoc.body.onload;
	win.document.close();
	win.focus();	
}
