///////////////////////////////////////////////////////////////////////////////////
// How to Implement the Spotlight Tag				
// 1. Insert the Spotlight tags between the <body> and </body> tags, as close to the opening tag as possible, to ensure that the Spotlight request is sent to DART even if the user presses Stop or navigates away from the page.
// 2. To defeat caching and ensure accurate counts, you need to insert a numeric value for the ord= parameter. The value cannot contain semicolons or special characters.
// For standard Spotlight tags, use a random number. For unique user tags, use a constant value. For sales tags, use an order confirmation number.
// Unique user tags also require a random number as the value of the num= parameter.
// 3. Choose the Secure Server option if the Spotlight tag will be placed on a webpage hosted on a secure server. This option changes http:// to https:// in the Spotlight tag. If this change isn't made,   Spotlight data will not be captured, and certain browsers will display a security warning.
// 4. Custom Spotlight variables are limited to 128 characters.
//		
//				
// 600209	Landingpage	Performance	http://generiek	"<!--
// Start of DoubleClick Floodlight Tag: Please do not remove
// Activity name of this tag: Landingpage
// URL of the webpage where the tag is expected to be placed: http://generiek
// This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
// Creation Date: 10/16/2009
// -->
// <iframe src=""http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=gener903;qty=1;cost=[Revenue];ord=[OrderID]?"" width=""1"" height=""1"" frameborder=""0""></iframe>
//
// <!-- End of DoubleClick Floodlight Tag: Please do not remove -->
//
// 600211	Bedankt	Performance	http://www.nefit.nl//consument/documentatie/bestellen/bedankt/Pages/Default.aspx	"<!--
// Start of DoubleClick Floodlight Tag: Please do not remove
// Activity name of this tag: Bedankt
// URL of the webpage where the tag is expected to be placed: http://www.nefit.nl//consument/documentatie/bestellen/bedankt/Pages/Default.aspx
// This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
// Creation Date: 10/16/2009
// -->
// <iframe src=""http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=docum664;qty=1;cost=[Revenue];ord=[OrderID]?"" width=""1"" height=""1"" frameborder=""0""></iframe>
//
// <!-- End of DoubleClick Floodlight Tag: Please do not remove -->
//
// 600212	Generiek	Performance	http://www.nefit.nl/consument/service/Pages/Zoekuwdealer_results.aspx?	"<!--
// Start of DoubleClick Floodlight Tag: Please do not remove
// Activity name of this tag: Generiek
// URL of the webpage where the tag is expected to be placed: http://www.nefit.nl/consument/service/Pages/Zoekuwdealer_results.aspx?
// This tag must be placed between the <body> and </body> tags, as close as possible to the opening tag.
// Creation Date: 10/16/2009
// -->
// <iframe src=""http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=deale362;qty=1;cost=[Revenue];ord=[OrderID]?"" width=""1"" height=""1"" frameborder=""0""></iframe>
//
// <!-- End of DoubleClick Floodlight Tag: Please do not remove -->
///////////////////////////////////////////////////////////////////////////////////

function insertSpotlightTag(placeHolderId)
{
	var placeHolder = document.getElementById(placeHolderId);
	if (placeHolder)
	{
		//Tags only on Consument pages except Consument Home Page
		if (isSubSite('Consument') && !isSpecificPage('/consument/pages/default.aspx'))
		{
			//Special Tag for Documentatie Bestellen Bedankt page
			if (isSpecificPage('/consument/documentatie/bestellen/bedankt/Pages/Default.aspx'))
			{
				placeHolder.innerHTML = '<iframe src="http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=docum664;qty=1;cost=0;ord=0?" width="1" height="1" frameborder="0"></iframe>';
			}
			//Special Tag for Zoek Dealer Results page
			else if (isSpecificPage('/consument/service/Pages/Zoekuwdealer_results.aspx'))
			{
				placeHolder.innerHTML = '<iframe src="http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=deale362;qty=1;cost=0;ord=0?" width="1" height="1" frameborder="0"></iframe>';
			}
			//Generic Tag fo all other Consument pages
			else
			{
				placeHolder.innerHTML = '<iframe src="http://fls.doubleclick.net/activityi;src=2501957;type=perfo723;cat=gener903;qty=1;cost=0;ord=0?" width="1" height="1" frameborder="0"></iframe>';
			}
		}
	}
}

function isSubSite(subSite)
{
	return getSubSite().toLowerCase() == subSite.toLowerCase();
}

function isSpecificPage(relativePagePath)
{
	return getUrl().toLowerCase().indexOf(relativePagePath.toLowerCase()) > -1;
}

function getSubSite()
{
	var url = location.href;
	return url.substr(url.indexOf("://")+3).split("/")[1];   
}

function getUrl()
{
	return location.href;
}
