// All Common Javascripts used by all skins are placed in here
var toolSelected='zoomin';
var utilityLoaded=true;
var results=parent.results;
var onpoint=parent.onpoint;
var showBanner=true;
var showQuickSearch=true;
var shapeLinkName='';
var multiColJoins=new Array();
var selectionsExpanded=true;
var maptabContents;
var externalShapeLink=false;
var currentMapTabId;
var showmaptab=true;
var maptop,mapleft,mapheight;
var shapeLinkTarget;

function loadUI(uiname)
{
	parent.onpoint.hideLoading();
	try{
		parent.onpoint.getElement('errorMessagePanel').style.display='none';
	}catch(ex){}
	try{
		parent.onpoint.getElement(uiname).innerHTML=results.document.getElementById(uiname).innerHTML;
	}catch(ex){}
}
function showError(message)
{
	try{
		onpoint.getElement('errorMessageText').innerHTML=message+'<BR>';
		onpoint.getElement('errorMessagePanel').style.display='';
		onpoint.getElement('errorMessagePanel').style.zorder=-1;
	}catch(ex){
	alert("error showing error message"+ex);
	}
}

function refreshMap(url,scale,scaleLevel,totalLevels,hasCache,selectionlist)
{
	try
	{
		var themap=onpoint.getElement('themap');
		//parent.onpoint.dragPanEnd();
		parent.onpoint.hideLoading();
		parent.onpoint.closeDisplayManager();

		themap.onload=parent.onpoint.setMapRight;
		themap.src=url;

		onpoint.getElement('scale').value=scale;
		try{
			if(hasCache)
				onpoint.getElement('previousmap').onclick=parent.onpoint.previousMapButtonClick;
			else
				onpoint.getElement('previousmap').onclick='';
		}catch(ex){}

		try{
			for(i=0;i<totalLevels;i++)
				onpoint.getElement('zd' + i).src='images/maptools/zd.gif';
			onpoint.getElement('zd' + scaleLevel).src='images/maptools/zdg.gif';
		}catch(ex){}
		
		try{
			if(selectionlist!='')
			{
				onpoint.getElement('selectionOptions').innerHTML=selectionlist;	
				if(selectionsExpanded)
				{
					onpoint.getElement('selectionsPanel').style.display='';
					onpoint.getElement('selectionsClose').style.display='none';
				}
			}
			else
				onpoint.getElement('selectionOptions').innerHTML="<select name='selected' id='SelectionResults' size='7' multiple style='width:220px;'></select>";
		}catch(ex){}
		
//		themap.style.top=parent.jsp.maptop;
//		themap.style.left=parent.jsp.mapleft;			
//		themap.style.left="";
//		themap.style.top="";
//		themap.style.clientTop=parent.jsp.maptop;
//		themap.style.clientLeft=parent.jsp.mapleft;			
//		themap.style.clip = 'rect(auto)';	
//		themap.style.height=parent.jsp.mapheight;
	}
	catch(ex){}
}
function refreshOnlyMap(url)
{
	try
	{
		var themap=onpoint.getElement('themap');
		parent.onpoint.hideLoading();
		parent.onpoint.closeDisplayManager();
		themap.src=url;
		
//		themap.style.top=parent.jsp.maptop;
//		themap.style.left=parent.jsp.mapleft;			
		themap.style.clientTop=parent.jsp.maptop;
		themap.style.clientLeft=parent.jsp.mapleft;			

		themap.style.clip = 'rect(auto)';	
		themap.style.height=parent.jsp.mapheight;		
	}
	catch(ex){}
}
function refreshMeasure(message,url)
{
	var themap=onpoint.getElement('themap');
	parent.onpoint.hideLoading();
	themap.src=url;
	onpoint.getElement('measureMessage').innerHTML=message;
	
//	themap.style.top=parent.jsp.maptop;
//	themap.style.left=parent.jsp.mapleft;			
	themap.style.clientTop=parent.jsp.maptop;
	themap.style.clientLeft=parent.jsp.mapleft;			

	themap.style.clip = 'rect(auto)';	
	themap.style.height=parent.jsp.mapheight;
}
function changeMapSize(url,scale,scaleLevel,totalLevels,height,width)
{
	var themap=onpoint.getElement('themap');
	parent.onpoint.hideLoading();
	themap.height=height;
	themap.width=width;
	onpoint.statusbar.width=width+57;
	refreshMap(url,scale,scaleLevel,totalLevels);
}
onpoint.location.href=document.location.href + '?LINK=onpointframe';
