// JavaScript Document

//Celebrity Cruises Pixel Matrix Functions

function addDrivePMPixel(cat) {
	var szProtocol = window.location.protocol;
	var host = "//view.atdmt.com/action/";
	var url =  szProtocol + host + cat;
	document.write('<img src="' + url + '" width="1" height="1" border="0">');
}


function addDoubleClickPixel(cat, qty, cost) {
	var szProtocol = window.location.protocol;
	var szRandom = Math.random() * 1000000;
	var host = "//ad.doubleclick.net/activity";
	var src  = "2010860";
	var type = "celeb150";
	
	var url = szProtocol + host + ';src=' + src + ';type=' + type + ';cat=' + cat + ';qty=' + qty + ';cost=' + cost +';ord=' + szRandom +'?';
	document.write('<img src="' + url + '" width="1" height="1" border="0">');
}



function btref() { 
	var d = document; 
	var e = escape; 
	var r = d.referrer; 
	var szRandom = Math.random() * 1000000;
	return '&ref='+e(r)+'&r='+szRandom;
}

function getHostSpotLight(){
var szProtocol = window.location.protocol;
var id = 2010860; 
var host = '//fls.doubleclick.net/activityi;src=' + id; 
var url = szProtocol + host; 
return url;
}

// Pixel Floodlight Tag Functions
function addSpotLightPixel(type, cat) {

	var axel = Math.random() + "";
	var a = axel * 10000000000000;
	var url = '<iframe src="'+ getHostSpotLight() +';type=' + type + ';cat='+ cat + ';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>';
	
	document.write(url);
}

//Pixel Floodlight Tag Functions
function addSpotLightPixelForNoPixelSection(page) {	
	var axel = Math.random() + "";
	var a = axel * 10000000000000;
	var type;
	var cat;
	type='2010c219';
	if(page == 'savor') {		
		cat='fl_ce663';
	} else if (page == 'discover') {		
		cat='fl_ce788';
	} else if(page == 'renew') {		
		cat='fl_ce214';
	} else if(page == 'EUROP') {		
		cat='fl_de258';
	} else if(page == 'EuropePromotions') {		
		type = '2011t872';
		cat='europ762'; 
	}
	if (cat != null) {		
		var url = '<iframe src="'+ getHostSpotLight() +';type=' + type + ';cat='+ cat + ';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>';	
		document.write(url);
	}
}
function addSpotLightPixelForNoPixelSectionNoScript(page) {	
	var axel = Math.random() + "";
	var a = axel * 10000000000000;
	var type;
	var cat;
	type='2010c219';
	if(page == 'savor') {		
		cat='fl_ce663';
	} else if (page == 'discover') {		
		cat='fl_ce788';
	} else if(page == 'renew') {		
		cat='fl_ce214';
	} else if(page == 'EUROP') {		
		cat='fl_de258';
	} else if(page == 'EuropePromotions') {		
		type = '2011t872';
		cat='europ762'; 
	}
	if (cat != null) {
		var url = '<iframe src="http://fls.doubleclick.net/activityi;src=2010860;type=' + type + ';cat='+ cat + ';ord=' + a + '?" width="1" height="1" frameborder="0"></iframe>';	
		document.write(url);
	}
}

function addSpotLightBookingPixel(type, cat, qty, cost, ord) { 
var url = '<iframe src="' + getHostSpotLight() + ';type=' + type + ';cat=' + cat + ';qty=' + qty + ';cost=' + cost +';ord=' + ord + '?" width="1" height="1" frameborder="0"></iframe>'; 
document.write(url); 
}


