var isNav, isIE;
//Browser checking
if(parseInt(navigator.appVersion)>=4)
{
	if(navigator.appName=="Netscape") {
      isNav=true;
   	}
   else {
      isIE=true;
	}
}


function fadeTabsAjaxstatic(auctiontype)
{ 
	if(auctiontype=="")
	{
		//show_hideUKMAP('hide');	
		showSearch('default');
		auctioncalenderId('totAucts','totProps');
		//auctioncalenderId('totAuctR','totPropR');
	}
	else 
	{ 
	   //--------- on page refresh ------------//
	   if(auctiontype=='residential')
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
			auctioncalenderId('totAuctR','totPropR');
			showSearch('residential');
			//show_hideUKMAP('hide');	
		}
		else if(auctiontype=='commercial')
		{
			showDiv('residential','land','notes');
			hideDiv('commercial');
			//auctioncalenderId('totAuctC','totPropC');
			//showSearch('commercial');
			//show_hideUKMAP('hide');	
		}
		else if(auctiontype=='land')
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');
			//auctioncalenderId('totAuctL','totPropL');
			//showSearch('land');
			//show_hideUKMAP('hide');	
		}
		else if(auctiontype=='notes')
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');
			//auctioncalenderId('totAuctN','totPropN');
			//showSearch('notes');
			//show_hideUKMAP('hide');	
		}

	   //--------- on mouseover ------------//
	   $("#residential").mouseout(function()
	   {
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
		});

	 	$("#R").mouseout(function()
	   {
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
		});

		$("#commercial").mouseout(function()
		{	
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','land','notes');
			hideDiv('commercial');			
		});

		$("#C").mouseout(function()
		{	
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','land','notes');
			hideDiv('commercial');			
		});

		$("#land").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');			
		});

		$("#L").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');			
		});

		$("#notes").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);	
		}).mouseover(function()
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');			
		});

		$("#N").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);	
		}).mouseover(function()
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');			
		});
	}
}

function fadeTabsAjax(auctiontype)
{
	if(auctiontype=="")
	{
		//show_hideUKMAP('show');		
		showSearch('default');	
		auctioncalenderId('totAucts','totProps');
	}
	else 
	{	
	   //--------- on page refresh ------------//
	   if(auctiontype=='residential')
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
			auctioncalenderId('totAuctR','totPropR');
			showSearch('residential');
			//show_hideUKMAP('show');		
		}
		else if(auctiontype=='commercial')
		{ 
			showDiv('residential','land','notes');
			hideDiv('commercial');
			auctioncalenderId('totAuctC','totPropC');
			showSearch('commercial');
			//show_hideUKMAP('hide');
		}
		else if(auctiontype=='land')
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');
			//auctioncalenderId('totAuctL','totPropL');
			//showSearch('land');
			//show_hideUKMAP('hide');	
		}
		else if(auctiontype=='notes')
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');
			auctioncalenderId('totAuctN','totPropN');
			showSearch('notes');
			//show_hideUKMAP('hide');	
		}

	   //--------- on mouseover ------------//
	   $("#residential").mouseout(function()
	   {
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
		});

	 	$("#R").mouseout(function()
	   {
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('commercial','land','notes');
			hideDiv('residential');
		});

		$("#commercial").mouseout(function()
		{	
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','land','notes');
			hideDiv('commercial');
		});

		$("#C").mouseout(function()
		{	
		   showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','land','notes');
			hideDiv('commercial');
		});

		$("#land").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');
		});

		$("#L").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);
		}).mouseover(function()
		{
			showDiv('residential','commercial','notes');
			hideDiv('land');
		});

		$("#notes").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);	
		}).mouseover(function()
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');
		});

		$("#N").mouseout(function()
		{	
			showdivOnmouseout(auctiontype);	
		}).mouseover(function()
		{
			showDiv('residential','commercial','land');
			hideDiv('notes');
		});
	}
}


function showDiv(div1,div2,div3)
{
	document.getElementById(div1).style.display='';
	document.getElementById(div2).style.display='';
	document.getElementById(div3).style.display='';
}

function hideDiv(div)
{
  document.getElementById(div).style.display='none';  
}

function showdivOnmouseout(AuctType)
{
	if(AuctType=='residential')
	{
	  showDiv('commercial','land','notes');
	  hideDiv('residential');	  
	}
	else if(AuctType=='commercial')
	{	
	  showDiv('residential','land','notes');
	  hideDiv('commercial');	  
	}
	else if(AuctType=='land')
	{
	  showDiv('residential','commercial','notes');
	  hideDiv('land');	  
	}
	else if(AuctType=='notes')
	{
	  showDiv('residential','commercial','land');
	  hideDiv('notes');	  
	}
}

function auctioncalenderId(auctionId, propId)
{
  $('#UpAuctions').html(document.getElementById(auctionId).value);
  $('#UpProp').html(document.getElementById(propId).value);
}

function show_hideUKMAP(action)
{
	if(action=='show')
	{
		document.getElementById('ukmap1').style.display='';
		document.getElementById('ukmap2').style.display='';
		document.getElementById('ukmap3').style.display='';
		document.getElementById('ukmap4').style.display='none';
	}
	else if(action=='hide')
	{
		document.getElementById('ukmap1').style.display='none';
		document.getElementById('ukmap2').style.display='none';
		document.getElementById('ukmap3').style.display='none';
		document.getElementById('ukmap4').style.display='';
	}
}

function showSearch(searchType)
{
	var sendStr = "SEACRHTYPE="+searchType;
	var strURL = "SearchCommon.inc.php";
	var strResultFunc = "searchListFunction";
	xmlhttpPost(strURL, sendStr, strResultFunc); //----ajax.js	
}

function searchListFunction(result)
{	
	$('#searchList').html(result);	
}