function global()
{
	var searchBox = document.getElementById("searchBox");
	var searching;
	var runs = 0;
	
	var field;
	var currentValue;
	var currentTab;
	
	var ctb;
	var ctc;
	var otb;
	var otc;
	
	this.getElement = function(id)
	{
		return document.getElementById(id);
	}
	
	this.clearField = function(id, onBlur)
	{
		field = this.getElement(id);
	
		if(field.value == fieldDefaultValues[id])
		{
			field.value = "";
			
			field.onblur = function() {
				global.clearField(id, 1);
			}
		}
		else if(field.value == "" && onBlur)
		{
			field.value = fieldDefaultValues[id];
		}
	}
	
	this.goLink = function(url)
	{
		window.location = url;
	}
	
	this.goLinkVerify = function(msg, url)
	{
		var confirmation = confirm(msg);
		
		if(confirmation)
		{
			window.location = url;
		}
	}
	
	/*
	  Tabs
	*/
	this.setTabsDefault = function(key)
	{
		currentTab = key;
	}
	
	this.tabOpen = function(key)
	{
		ctb = this.getElement("tab_btn_" + currentTab).className = "";
		ctc = this.getElement("tab_content_" + currentTab).style.display = "none";
		otb = this.getElement("tab_btn_" + key).className = "active";
		otc = this.getElement("tab_content_" + key).style.display = "block";
		
		currentTab = key;
	}
	
	/*
	  Various Functions
	*/
	this.showPOV = function(pov)
	{
		popup.Load('Ride POV', 660, 450, 'pov', {'pov_key':pov});
	}
	
	/*
	  Keeps the search box open
	*/
	this.initiateSearch = function(which)
	{
		if(which)
		{
			/*
			  Hmmmmmmm...
			*/
			
			searching = true;
		}
		else
		{
			searching = false;
			
			document.getElementById("searchBox").className = "searchHover";
			
			setTimeout("global.endSearch();", 3000);
		}
	}
	
	this.endSearch = function()
	{
		if(searching != true)
		{
			document.getElementById("searchBox").className = "";
		}
	}
	
	this.redirectHide = function()
	{
		if(document.getElementById("redirect_msg"))
		{
			setTimeout('document.getElementById("redirect_msg").style.display = "none";', 3000);
		}
	}
}

var global = new global();

/*
  Global Image Variables
*/
var images = [];

images['loading'] = "<img src='" + home_url + "styles/icons/loading.gif' border='0'/>";

