/**
 * @author Dreamscape Microsystems Ltd
 */

function ShowSearch()
{
	searchB = Ext.getCmp('search-field');
	
	var searchForm = Ext.get('searchForm');

	searchForm.load({
			url: 'search.php', // <-- change if necessary
			params: 'election=' + election + '&search=' + searchB.getValue(),
			text: 'Updating...',
			scripts:true		
	});
	
	searchForm.show();		
}
   	
var searchBox = new Ext.form.TextField({
	hideLabel : true,
	id : 'search-field',
	width:150
});
	
var detailsPanel = {
		id:'details-panel',
		region:'center',
		//layout:'',
		title : 'Search...',
		minHeight : 80,
		height : 80,
		contentEl : 'searchForm', 		
		tbar : [
			searchBox,
		{
			xtype : 'tbbutton',
			text : 'Search',
			handler: ShowSearch.createDelegate(this,[])
		}]		
};

function EnlargeTable(page)
{
	var urli = page + "?maptype=" + maptype + "&election=" + election + "&level=" + level + "&region=" + region + "&cid=" + constituency; 
	window.open(urli, '', 'fullscreen=yes, scrollbars=auto');
}
	
function GoToConstituency(cid)
{
	region = (cid/100)|0;
	constituency = cid;
	UpdateMapWLevel(-1,-1,2);
}
 