/**
 * @author Ellis Antaya <ellis.antaya@canoe.ca>
 */

/**
 * avoir l'URL du bigbox
 * 
 * add defined sectionlevel3 to 5 to the bigboxURL. this URL is used for refreshing bigbox every 30 seconds
 * add defined each itemKey and values in the dfpSpeKey array to bigboxURL. This URL is used for refreshing bigbox every 30 seconds
 */
function getBigboxURL() {

	var bigboxURL = 'http://ad.doubleclick.net/adi/' + MyGenericTagVar.networkid + '.' + MyGenericTagVar.language + '.' + MyGenericTagVar.division + '.' + MyGenericTagVar.mainsection + '/bcplayer-' + MyGenericTagVar.sectionLevel2 + ';'
	
	// add defined sectionlevel3 to 5 to the bigboxURL. this URL is used for refreshing bigbox every 30 seconds
	if (MyGenericTagVar.sectionLevel3) {
		bigboxURL = bigboxURL + 'subz1=' + MyGenericTagVar.sectionLevel3 + ';'
	}
	
	if (MyGenericTagVar.sectionLevel4) {
		bigboxURL = bigboxURL + 'subz2=' + MyGenericTagVar.sectionLevel4 + ';'
	}
	
	if (MyGenericTagVar.sectionLevel5) {
		bigboxURL = bigboxURL + 'subz3=' + MyGenericTagVar.sectionLevel5 + ';'
	}
	


	// add defined each itemKey and values in the dfpSpeKey array to bigboxURL. This URL is used for refreshing bigbox every 30 seconds
	if (MyGenericTagVar.dfpSpeKey != null) {
		for (var itemKey in MyGenericTagVar.dfpSpeKey) {
			bigboxURL = bigboxURL + itemKey + '=' + MyGenericTagVar.dfpSpeKey[itemKey] + ';';
		}
	}
	
	return bigboxURL;
}

/**
 * avoir l'URL du AdServer2000x2000
 * 
 * add defined sectionlevel3 to 5 to the bigboxURL. this URL is used for refreshing bigbox every 30 seconds
 * add defined each itemKey and values in the dfpSpeKey array to bigboxURL. This URL is used for refreshing bigbox every 30 seconds
 */
function getAdServer2000x2000URL() {

	var AdServer2000x2000URL = 'http://ad.doubleclick.net/pfadx/' + MyGenericTagVar.networkid + '.' + MyGenericTagVar.language + '.' + MyGenericTagVar.division + '.' + MyGenericTagVar.mainsection + '/bcplayer-' + MyGenericTagVar.sectionLevel2 + ';';

	// add defined sectionlevel3 to 5 to the bigboxURL. this URL is used for refreshing bigbox every 30 seconds
	if (MyGenericTagVar.sectionLevel3) {
		AdServer2000x2000URL += 'subz1=' + MyGenericTagVar.sectionLevel3 + ';';
	}
	
	if (MyGenericTagVar.sectionLevel4) {
		AdServer2000x2000URL += 'subz2=' + MyGenericTagVar.sectionLevel4 + ';';
	}
	
	if (MyGenericTagVar.sectionLevel5) {
		AdServer2000x2000URL += 'subz3=' + MyGenericTagVar.sectionLevel5 + ';';
	}
	
	AdServer2000x2000URL += 'sz=2000x2000;';
	
	// add defined each itemKey and values in the dfpSpeKey array to bigboxURL. This URL is used for refreshing bigbox every 30 seconds
	if (MyGenericTagVar.dfpSpeKey != null) {
		for (var itemKey in MyGenericTagVar.dfpSpeKey) {
			AdServer2000x2000URL += itemKey + '=' + MyGenericTagVar.dfpSpeKey[itemKey] + ';';
		}
	}
	
	return AdServer2000x2000URL;
}

