//  direct pixel removed 22-09-2010
function gup( name ){  
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
var regexS = "[\\?&]"+name+"=([^&#]*)";  
var regex = new RegExp( regexS );  
var results = regex.exec( window.location.href );  
if( results == null )    return "";  
else    return results[1];
}
var marketing_identifier =  new Array()
marketing_identifier[0] = 'campid'; // set this to the value passed through on all marketing urls
marketing_identifier[1] = 'mpch='; // set this to the value passed through on all marketing urls

var referringurl = document.referrer.toLowerCase();
var	landingpage = document.URL.toLowerCase();
var conn = document.location.protocol; // establish is user is on a secure / non-secure connection
var pixel = '';
var rnd = Math.floor(Math.random()*1000000000000000000);

if(referringurl != '') {
	// exclude traffic referred from following urls	
	if(referringurl.indexOf('http://book.flythomascook.com/') >= 0 || referringurl.indexOf('http://www1.flythomascook.com/') >= 0 || referringurl.indexOf('https://book.flythomascook.com/skylights') >= 0  || referringurl.indexOf('http://my.flythomascook.com') >= 0 || referringurl.indexOf('http://accept.flythomascook.com') >= 0  || referringurl.indexOf('https://www1.flythomascook.com/') >= 0 || referringurl.indexOf('http://www.flythomascook.com/') >= 0) {// if an ftc page do nothing
		}
		else 	{// if there is a referring url and it is not an ftc page
				if(landingpage.indexOf(marketing_identifier[0]) <= 0 && landingpage.indexOf(marketing_identifier[1]) <= 0) {
				document.write('<iframe frameborder="0" width="1" height="1" src="' + conn +'//ns.arena-quantum.co.uk/ftc/?ref=' + escape(referringurl) +'&page=' + escape(landingpage) + '&rnd=' + rnd + '"/></iframe>');
				}
				else {
				// if marketing identifier is present we do nothing
				}
		}
}	
else {// NO REFERRING URL ==> DIRECT TRAFFIC
// pixel = "<img width='1' height='1' src='https://my.flythomascook.com/cm/tr/11501-90694-29592-0?mpt=" + rnd + "'/>"; 
// document.writeln(pixel); 
}
