
// FUNCTIONS

	// 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 = "Transportation"; // default section
	var aug_subsection = "AugustaAutos"; // default sub-section
//	var aug_channel = "Marketplace";	// default channel
//	var aug_section = "Transportation"; // default section
//	var aug_subsection = "AugustaAutos"; // default sub-section
	var aug_subsubsection = ""; // default sub-sub-section

// SET CHANNEL AND SECTION ACCORDING TO URL


//	if (aug_path.match(/research/i))
//	{
//		aug_section = "News";
//	}
//
//	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(/results.asp/i)) && (! location.search.match(/did\=/i)) )
	{
		aug_subsubsection = "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 = 'AugustaAutos.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.augustaautos.com'+'/'+t_URL.substring(0, t_URL.indexOf('_/'))+'/index.shtml';
	var t_Positions = 'Top,Bottom,Middle1,Middle2,Frame1,Frame2,x01,x02,x03,x04,x05,x08,BottomRight,x31,Right2,Right';
