/**
 * This class handles all the third party tracking tags.
 *
 * @author Kem Apak
 */
function ThirdParty(){}

/**
 * This class property represents the third party image container id.
 * 
 * @author Kem Apak
 */
ThirdParty.IMAGE_CONTAINER = 'thirdPartyImageContainer';

/**
 * This class property represents the third party image CSS class name.
 */
ThirdParty.CLASS_NAME = 'ttag';

/**
 * This class property represents the third party script container id.
 * 
 * @author Kem Apak
 */ 
ThirdParty.SCRIPT_CONTAINER = 'thirdPartyScriptContainer';

/**
 * This class property represents the third party iframe container id.
 * 
 * @author Kem Apak
 */ 
ThirdParty.IFRAME_CONTAINER = 'thirdPartyIframeContainer';

/**
 * This class property represents Tradedoubler tags base URI.
 * 
 * @author Kem Apak
 */ 
ThirdParty.Tradedoubler = 'tbs.tradedoubler.com/report?'; 

/**
 * This class property represents Reddion tags base URI.
 * 
 * @author Kem Apak
 */
ThirdParty.Reddion = 'noah.reddion.com/clients/redc212/adanalyse.asp?'; 

/**
 * This class property represents DoubleClick tags base URI.
 * 
 * @author Kem Apak
 */
ThirdParty.DoubleClick = 'ad.doubleclick.net/activity;'; 

/**
 * This class property represents Neo/DoubleClick floodlight tags base URI.
 * 
 * @author Kem Apak
 */
ThirdParty.NEO = 'fls.doubleclick.net';

/**
 * This class property represents Canada/DoubleClick floodlight tags base URI.
 * 
 */
ThirdParty.Canada = 'fls.doubleclick.net';

/**
 * This class property represents Advertisement tag base URI.
 * 
 * @author Kem Apak
 */
ThirdParty.Advertisement = 'secure.leadback.advertising.com/adcedge/lb?';

/**
 * This class property represents Atlas tags base URI.
 * 
 * @author Kem Apak
 */
 ThirdParty.Atlas = 'switch.atdmt.com';
 
/**
 * This class property represents Yesmail tags base URI.
 * 
 * @author Kem Apak
 */ 
 ThirdParty.Yesmail = 'link.p0.com/1x1c.dyn?p=';

 /**
 * This class property represents Zanox tags base URI.
 * 
 */ 
ThirdParty.Zanox = 'ad.zanox.com'; 


/**
 * This method is used to add a third party image tag.
 *
 * @author Kem Apak
 * @param baseUri The base URI of the third party.
 * @param queryString The HTTP query string that has to be added.
 */
ThirdParty.addImage = function(baseUri, queryString) {
	
	// Contruct the URI with protocol.
	var uri = document.location.protocol + '//' + baseUri + queryString;
	
	// Call the utility to create and add the image to the page.
	Util.addImage(uri, ThirdParty.IMAGE_CONTAINER, ThirdParty.CLASS_NAME, null);
} 

/**
 * This method is used to add a third party script tag that resides on our servers.
 *
 * @author Kem Apak
 * @param source The location of the script file.
 */
ThirdParty.addLocalScript = function(source) {

	// Call the utility to create and add the script to the page.
	Util.addScript(source, ThirdParty.SCRIPT_CONTAINER, null);
} 

/**
 * This method is used to add a third party script tag that resides on external servers.
 *
 * @author Kem Apak
 * @param baseUri The base URI of the third party.
 * @param fileName The the name of the script file that has to be added.
 */
ThirdParty.addExternalScript = function(baseUri, fileName) {

	// Contruct the URI with protocol.
	var uri = document.location.protocol + '//' + baseUri + fileName;
	
	// Call the utility to create and add the script to the page.
	Util.addScript(uri, ThirdParty.SCRIPT_CONTAINER, null);
}

/**
 * This method is used to add a third party script tag that resides on external servers.
 *
 * @param baseUri The base URI of the third party.
 * @param fileName The the name of the script file that has to be added.
 */
ThirdParty.addExternalIframe = function(baseUri, fileName) {

	// Contruct the URI with protocol.
	var uri = document.location.protocol + '//' + baseUri + fileName;

    //alert("URI is " + uri);
	
	// Call the utility to create and add the script to the page.
	Util.addIframe(uri, ThirdParty.IFRAME_CONTAINER, null);
}
