// FUNCTIONS

	function browserIs() {												// Detect browser.
		var agent	= navigator.userAgent.toLowerCase();
		this.major	= parseInt(navigator.appVersion);
		this.minor	= parseFloat(navigator.appVersion);
		this.ns		= ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
		this.ns4	= (!!document.layers);
		this.ns6	= (this.ns && (this.major >= 5));
		this.ie		= (agent.indexOf("msie") != -1);
		this.ie3	= (this.ie && (this.major  < 4));
		this.ie4	= (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
		this.ie5	= (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
		this.ie55	= (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
		this.ie6	= (this.ie && (agent.indexOf("msie 6.0")!=-1) );
		this.ff		= (agent.indexOf("firefox") != -1);
		return this;
	}
	var browser = browserIs();

	// return object from query string
	function parseQueryString(queryString) {
		 var queryObject = new Object();
		queryString = queryString.replace(/^.*\?(.+)$/,'$1');
		while ((pair = queryString.match(/([^=]+)=\'?([^\&\']*)\'?\&?/)) && pair[0].length) {
			queryString = queryString.substring( pair[0].length );
			if (/^\-?\d+$/.test(pair[2])) pair[2] = parseInt(pair[2]);
			queryObject[pair[1]] = pair[2];
		}
		return queryObject;
	}


// INIT VARIABLES

	var aug_path = location.pathname;
	var aug_query = parseQueryString(location.search);
	var aug_channel = "Marketplace";	// default channel
	var aug_section = "Homes"; // default section
	var aug_subsection = "AugustaRealEstate"; // default sub-section
	var aug_subsubsection = ""; // default sub-sub-section

// SET CHANNEL AND SECTION ACCORDING TO URL


//	if (aug_path.match(/todayshome/i))
//	{
//		aug_subsubsection = "TodaysHome";
//	}
//
//	if (aug_path.match(/results.asp/i))
//	{
//		aug_subsection = "Results";
//	}
//	if (aug_path.match(/details.asp/i))
//	{
//		aug_subsection = "Details";
//	}
//
	// Directory

//	if (aug_path.match(/dealersalpha.asp/i))
//	{
//		aug_channel = "Directory";
//		aug_section = "Alpha";
//	}
//	if (aug_path.match(/dealerRegions.asp/i))
//	{
//		aug_channel = "Directory";
//		aug_section = "ByRegion";
//	}
//	if (aug_path.match(/DealersDetail.asp/i))
//	{
//		aug_channel = "Directory";
//		aug_section = "Detail";
//	}
//
//	// Search
//
//	if (aug_path.match(/index.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Basic";
//	}
//	if (aug_path.match(/sfrmain.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Advanced";
//	}
//	if (aug_path.match(/searchresults.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Results";
//	}
//	if (aug_path.match(/Idfrmain.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Detail";
//	}
//	if (aug_path.match(/carquote.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Quote";
//	}
//	if (aug_path.match(/makequote.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "QuoteBroadcast";
//	}
//	if (aug_path.match(/AgentSetup.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Persistent";
//		aug_subsection = "Setup";
//	}
//
//	if (aug_path.match(/agenthelp.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Persistent";
//		aug_subsection = "Help";
//	}
//
//	if (aug_path.match(/favorites.asp/i))
//	{
//		aug_channel = "Search";
//		aug_section = "Favorites";
//	}
//
//
//	// Tools
//
//	if (aug_path.match(/ffrmain.asp/i))
//	{
//		aug_channel = "Tools";
//		aug_section = "Calculator";
//	}


// TEST

// var aug_test = "Channel = " + aug_channel + "<br>" + "Section = " + aug_section + "<br>" + "SubSection = " + aug_subsection + "<br>" + "SubSubSection = " + aug_subsubsection + "<br>";
// document.write(aug_test);


// SET OAS TAGS

	var t_Server = 'AugustaRealEstate.com';
	var t_Channel = aug_channel;
	var t_Section = aug_section;		
	var t_SubSection = aug_subsection;
	var t_SubSubSection = aug_subsubsection;
	var t_URL = t_Server.replace(/[^A-Z]/g, '')+((t_Channel != '')?'_'+t_Channel.substring(0, 5)+((t_Section != '')?'_'+t_Section.substring(0, 5)+((t_SubSection != '')?'_'+t_SubSection.substring(0, 5)+((t_SubSubSection != '')?'_'+t_SubSubSection.substring(0, 5):''):''):'') :'')+'_'+window.location.pathname+location.search;
	var t_OAS = 'www.augustarealestate.com'+'/'+t_URL.substring(0, t_URL.indexOf('_/'))+'/index.shtml';
	var t_Positions = 'Top,x01,Position1,Right,Right1,Right2,Right3,x32,x05,x06,x07,x08,x09,x11,x12,x13,x31,Middle2,Position2';

	var showPowerAd = true;



