// Legacy wrapped ads support
var wrap = null;

// Navigation code
var layerRef = (document.layers) ? "document" : "document.all";
var styleRef = (document.layers) ? "" : ".style";
var isSub = typeof isSub == 'undefined'?0:isSub;

// Prototypes
function pageOffset() { }
function checkVisible() { }
function init() { }

// Common Template functions
function initPage(Site,Section,Page){ }

// Browser sniffer
function Is () {
	var agt=navigator.userAgent.toLowerCase();

	// *** BROWSER VERSION ***
	// Note: On IE5, these return 4, so use is.ie5up to detect IE5.

	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	// Note: Opera and WebTV spoof Navigator.  We do strict client detection.
	// If you want to allow spoofing, take out the tests for opera and webtv.
	this.nav     = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
			 	   && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
				   && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	this.nav4    = (this.nav && (this.major == 4));
	this.nav4up  = (this.nav && (this.major >= 4));
	this.navonly = (this.nav && ((agt.indexOf(";nav") != -1)
				   || (agt.indexOf("; nav") != -1)) );
	this.nav6    = (this.nav && (this.major == 5));
	this.nav6up  = (this.nav && (this.major >= 5));
	this.gecko   = (agt.indexOf('gecko') != -1);
	this.ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	this.ie3     = (this.ie && (this.major < 4));
	this.ie4     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1)
				   && (agt.indexOf("msie 6")==-1));
	this.ie4up   = (this.ie  && (this.major >= 4));
	this.ie5     = (this.ie && (this.major == 4) && ((agt.indexOf("msie 5.0")!=-1) || (agt.indexOf("msie 5.1")!=-1) || (agt.indexOf("msie 5.2")!=-1)) );
	this.ie5_5   = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
	this.ie6     = (this.ie && (this.major == 6) && (agt.indexOf("msie 6.0") != -1));
	this.ie5up   = (this.ie  && !this.ie3 && !this.ie4 && !this.ie6);
	this.ie5_5up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5);
	this.ie6up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
	this.opera   = (agt.indexOf('opera') != -1);
	this.opera5  = (this.opera && (this.major == 5));
	this.opera6  = (this.opera && (this.major == 6));
	this.opera7  = (this.opera && (this.major == 7));

	// *** PLATFORM ***
	this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	// NOTE: On Opera 3.0, userAgent includes "Windows 95/NT4" on all
	//        Win32, so can't split Win95 and WinNT.
	this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
	// is this a 16 bit compiled version?
	this.win16 = ((agt.indexOf("win16")!=-1)
				 || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1)
				 || (agt.indexOf("windows 16-bit")!=-1) );
	this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1)
				 || (agt.indexOf("windows 16-bit")!=-1));
	// NOTE: Win98 detection is unreliable. It appears that:
	//       - On Nav 4.x and before you get "Windows" in userAgent.
	//       - On Mercury client, 32-bit version returns "Win98",
	//         16-bit version on Win98 returns "Win95".
	this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
	this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
	this.win32 = (this.win95 || this.winnt || this.win98
				 || ((this.major >= 4) && (navigator.platform == "Win32"))
				 || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
	this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
	this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
	this.mac    = (agt.indexOf("mac")!=-1);
	this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1)
				  || (agt.indexOf("68000")!=-1)));
	this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1)
				  || (agt.indexOf("powerpc")!=-1)));
}

var is;
is = new Is();

// Opera 5&6
var is_opera=(is.opera && is.major<7);

// Advert
function Advert(pos,ftsite,params,issec,wrap,asset,div,link,seq,next){
	// Prepare adHTML
	var adHTML = '';
	var style='';
		if ((pos == 'box') || (pos == 'boxindex') || (pos == 'boxbarrier')){ style = "artimg,arthtml"; }
		if (pos == 'leader'){ style = "leaderboard_img,leaderboard_html"; }
		if (pos == 'seaquo'){ style = "seaquo_img,seaquo_html"; }
		if (pos == 'rhnbut'){ style = "button_img,button_html"; }
	var adStyle=style ? "&params.styles="+style : '';
	var adWrap = wrap != ''?'&wrap='+wrap:'';
	var siteName='ftcom';
		if (ftsite == 'yahoo1'){ if (pos == 'ban' || pos =='box'){ siteName = ftsite; } }
		if (ftsite == 'ftchina'){siteName=ftsite;}
	var divId=div ? '&divId='+div : '';
	adLink='';
	if (link) {
		if (seq == 'before') adLink='&linkParam='+link;
		else {
			adLink='&'+link+'=';
			if (eval('typeof '+link+' == "undefined";')) adLink+='0'; else  adLink+=eval(link);
		}
	}
	var nextAd=next ? '&nextAd=AdsObject.fetch&nextAdPos='+next : '';
	var assRef = "&asset="+thisPage.asset+"&referrer="+document.referrer;
	var allParams = "site="+siteName+"&pos="+pos+params+adWrap+thisPage.revScience+adStyle+assRef+divId+adLink+nextAd;
	var adsDom = 'http://ads.ft.com';
	if (issec){
		adsDom = 'https://secureads.ft.com';
	}
	if (!is.nav4 && (!is.opera5 && !is.opera6)){
		adHTML += '<scr'+'ipt src="'+adsDom+'/js.ng/'+allParams+'"></scr'+'ipt>\n';
	} else {
		adHTML += '<a href="'+adsDom+'/click.ng/'+allParams+'" target="_blank">';
		adHTML += '<img src="'+adsDom+'/image.ng/'+allParams+'" border="0" alt="Advertisement" /></a>';
	}
	this.adHTML = adHTML;
}

// Page attributes
function PageAttributes(FTSite,FTSection,FTPage,FTFund){
	// Properties
	this.defsite = 'ftcom';
	this.wrap = '';
	
	// Init from variables
	this.ftsec = "&sec="+FTSection;
	this.ftpage = "&artid="+FTPage;
	this.ftindcs = "&sei="+FTIndices;
	this.ftsectr = "&sectr="+FTSectors;
	this.ftsbjcts = "&subj="+FTSubjects;
	this.ftfnd = "&ftfund="+FTFund;
	this.asset = typeof AssetType != 'undefined'?AssetType.toLowerCase():'';

	// Methods
	// Used to avoid ad call caching
	this.getTransId = function(){
		var cDate = new Date();
		var uSec = cDate.getTime();
		return(uSec);
	}

	// Get parent page location
	this.getRealLoc = function(){
		var realLoc = '';
		if (self == top){ realLoc = window.location.toString(); }
		else if (window.ourLoc){ realLoc = window.ourLoc; }
		else if (document.referrer){ realLoc = document.referrer; }
		else { realLoc = window.location.toString(); }
		return realLoc;
	}

	// Check if SSL
	this.isSecure = function(loc){
		var secure = 0;
		if (loc.indexOf('https') > -1){ secure = 1; }
		return secure;
	}

	// Gets the ad site code
	this.getFTSite = function(){
		var code = this.defsite;
		var ck = getCookieValue('FTAdSiteCode','');
		var client = getValueFromStr('ft_ref','',this.thisLoc,'&');
		var page = typeof FTSite != 'undefined'?FTSite.toLowerCase():'';
		if (client){ code = client; }
		else if (ck){ code = ck; }
		else if (page){ code = page; }
		return code;
	}

	// Get extra params for ad from AYSC user cookie
	this.getAdParams = function(){
		var sAYSC = getCookieValue('AYSC', '');
		var params = '';
		params += "&13=" + getValueFromStr('_13', '', sAYSC, '_', '');
		params += "&14=" + getValueFromStr('_14', '', sAYSC, '_', '');
		params += "&17=" + getValueFromStr('_17', '', sAYSC, '_', '');
		params += "&18=" + getValueFromStr('_18', '', sAYSC, '_', '');
		params += "&transId=" + this.getTransId();
		return params;
	}

	// Get search or quote terms for ads
	this.getKeyword = function(loc){
		var keyword = '';
		// Retrieve the value of "vsc_query" or "symb" from the URL or from a cookie
		if ((loc.indexOf("search.ft.com") != -1) && (loc.indexOf("&vsc_query=") != -1)){
			// The URL contains search.ft.com and there is a vsc_query parameter in the URL
			keyword = getValueFromStr('vsc_query','',loc,'&');
		} else if ((loc.indexOf("mwprices.ft.com") != -1) && (loc.indexOf("&symb=") != -1)){
			// The URL contains mwprices.ft.com and there is a symb parameter in the URL
			keyword = getValueFromStr('symb','',loc,'&');
		} else if (getCookieValue('keywordValue','').length > 0){
			// A cookie called keywordValue has previously been set for this domain
			keyword = getCookieValue('keywordValue','');
		}
		// The following requires JavaScript 1.2
		var whtSpc = new RegExp("\\+","g");
		var ampSym = new RegExp("%26","g");
		var apoSym = new RegExp("%27","g");
		var perSym = new RegExp("\\.","g");
		keyword = keyword.replace(whtSpc,"_");   //replace plus sign with underscore '_'
		keyword = keyword.replace(ampSym,"and"); //replace ampersands with 'and'
		keyword = keyword.replace(apoSym,"");    //replace apostrophe with nothing
		keyword = keyword.replace(perSym,"");    //replace periods with nothing
		var keyStr = (keyword.length > 0)?"&keyword="+keyword.toLowerCase():'';
		return keyStr;
	}

	// Revenue Science Implementation
	this.revScienceSegExtraction = function() {
		var segCookie, ampTokens, segs;
		var cookieName = "DMSEG";
		if ((segCookie = getCookieValue(cookieName,'')) != ''){
			segCookie = unescape(segCookie);
			ampTokens = segCookie.split("&");
			if (ampTokens.length >= 6)	{
				segs = ampTokens[5];
			}
		}
		var revSciParams = '&rsi=';
		revSciParams += segs;
		return revSciParams;
	}

	// Init from methods
	this.thisLoc = this.getRealLoc();
	this.ftsite = this.getFTSite();
	this.adparams = this.getAdParams();
	this.keyword = this.getKeyword(this.thisLoc);
	this.issec = this.isSecure(this.thisLoc);
	this.alladparams = this.ftsec+this.ftpage+this.ftindcs+this.ftsectr+this.ftsbjcts+this.ftfnd+this.adparams+this.keyword;
	this.revScience = this.revScienceSegExtraction();
}

// Sites running non ft.com domains
var extLoc = [['FTYM-21ymy-21cacrcl','credit.ftyourmoney.com'],['FTYM-21ymy-21perloa','loans.ftyourmoney.com'],['FTYM-21ymy-21motori','www.aaaffinities.co.uk/Insurance/FT/Carquote'],['FTYM-21ymy-21travel','products.xelector.com'],['FTYM-21ymy-21mortga','mortgages.charcolonline.co.uk'],['FTYM-21ymy-21gaselec','www.uswitch.com/energy'],['FTYM-21ymy-21lifein','193.130.154.202'],['FTYM-21ymy-21homins','www.aaaffinities.co.uk/Insurance/FT/Homequote'],['FTYM-21ymy-21medins','212.212.140.140'],['FTYM-21ymy-21telsup','www.uswitch.com/ht'],['FTYM-21ymy-21annfin','www.hargreaveslansdown.co.uk'],['FTYM-21ymy-21uncass','www.uar.co.uk'],['FTCOM-12cul-12trasea','www.ft.otc-uk.com'],['FTCOM-24spt-12spgolf','www.sportinglife.com/clients/ft/golf'],['FTCOM-24spt-12spform','www.sportinglife.com/clients/ft/formula1'],['FTCOM-24spt-12sprugu','www.sportinglife.com/clients/ft/rugbyunion'],['FTCOM-24spt-12spfoot','www.sportinglife.com/clients/ft/football'],['FTCOM-24spt-12spboxi','www.sportinglife.com/clients/ft/boxing'],['FTCOM-24spt-12spracg','www.sportinglife.com/clients/ft/racing'],['FTCOM-24spt-12spsnok','www.sportinglife.com/clients/ft/snooker'],['FTCOM-24spt-12spcric','www.sportinglife.com/clients/ft/cricket'],['FTCOM-24spt-12spgrey','www.sportinglife.com/clients/ft/greyhounds'],['FTCOM-24spt-12sprugb','www.sportinglife.com/clients/ft/rugbyleague'],['FTCOM-24spt-12sporar','www.sportinglife.com/clients/ft/story_get'],['FTCOM-24spt-12sptenn','www.sportinglife.com/clients/ft/tennis'],['FTCOM-24spt-12spothr','www.sportinglife.com/clients/ft/others'],['FTCOM-24spt-12spnfls','www.sportinglife.com/clients/ft/nfl'],['FTCOM-24spt-12sports','www.sportinglife.com/clients/ft/home'],['FTCOM-24spt-12spbett','www.sportinglife.com/clients/ft/betting'],['FTCOM-24bfs-24burest','www.businessesforsale.com/ft/aspx/public/quicksearch.aspx'],['FTCOM-24bfs-24burest','www.businessesforsale.com/ft/advancedSearch.aspx'],['FTCOM-24bfs-24busale','www.businessesforsale.com/ft/servicesDirectory/'],['FTCOM-24bfs-24burest','www.businessesforsale.com/ft/quickSearch.aspx'],['FTCOM-24bfs-24burest','www.businessesforsale.com/ft/advert'],['FTCOM-24bfs-24burest','www.businessesforsale.com/ft/1'],['FTCOM-20job-20notice','www.businessesforsale.com/ft/notices'],['FTCOM-24bfs-24busale','www.businessesforsale.com/ft'],['FTCOM-3won-3ukespc','www.clic2mail.com/FT']];  

// Get a non ft.com domain code
function getSiteNav(){
	var realDomain;
	var realLoc = '';
	if (self == top){ realLoc = window.location.toString(); }
	else if (window.ourLoc){ realLoc = window.ourLoc; }
	else if (document.referrer){ realLoc = document.referrer; }
	else { realLoc = window.location.toString(); }
	var navStr = '';
	for (var i = 0; i < extLoc.length ; i++){
		if (realLoc.indexOf(extLoc[i][1]) != -1){ return(navStr + extLoc[i][0]); }
	}
	return(navStr);
}

// Attempt to get FTSite, FTSection and FTPage from cookie if not yet set
// Set cookie values to default values
if (!FTSite && !FTSection && !FTPage && !FTIndices && !FTSectors && !FTSubjects && !FTFund){
	var FTSection = 'undef';
	var FTPage = 'undef';
	var FTIndustry = 'XXXX';
	var FTIndices = '';
	var FTSectors = '';
	var FTSubjects = '';
	var FTFund = 'undef';
	var FTAdValues = getSiteNav();
	if (FTAdValues != '') {
		// We matched an external, non-ft.com domained 3rd party. Retrieve the ad values from the delimited string returned by getSiteNav
		FTAdValues = FTAdValues.split('-');
		FTSite = FTAdValues[0];
		FTSection = FTAdValues[1];
		FTPage = FTAdValues[2];
	} else {
		// We didn't get a match, so grab the ad values from the cookie
		// FTSection and FTPage - use the values in FTAdValues or FTSection / Page if available, or set to undef if neither available
		// Note format is fixed!
		var FTSite = getCookieValue('FTSite','');
		var FTAdValues = getCookieValue('FTAdValues','').split(':');
		FTSection = FTAdValues[0];
		FTPage = FTAdValues[1];
		FTIndices = FTAdValues[2];
		FTSectors = FTAdValues[3];
		FTSubjects = FTAdValues[4];
		FTFund = FTAdValues[5];
	}
}

// Create page & clientAds object
var thisPage = new PageAttributes(FTSite,FTSection,FTPage,FTFund);

// Support functions
// Gets a value from a string or returns default
function getValueFromStr(key,defaultVal,inStr,sep,keySep){
	var value = defaultVal;
	var begin;
	var str;
	if (key && key.length > 0){
		key += arguments.length >= 5 ? keySep : '=';
		begin =  inStr.indexOf(key) > -1 ? inStr.indexOf(key) + key.length : -1;
		if( begin > -1){
			str =  inStr.substr(begin, inStr.length);
			value = str.substr(0, str.indexOf(sep) >= 0 ? str.indexOf(sep) : str.length);
		}
	}
	return value;
}

// Gets a cookie value or returns default
function getCookieValue(key,defaultVal){
	return(getValueFromStr(key,defaultVal,document.cookie,';'));
}

// Sets a cookie value
function setCookieValue(key,value,domain,expireInMinutes){
	var expDate = new Date();
	expDate.setTime(expDate.getTime() + (expireInMinutes * 60000) );
	document.cookie
	var cookie = key + '=' + value + ';domain=' + domain + ';path=/;';
	if( expireInMinutes > -1 ){ cookie +=  'expires=' + expDate.toGMTString(); }
	document.cookie = cookie;
	return true;
}

// Deletes a cookie
function deleteCookie(key,domain){
	document.cookie = key + '=' + ( (domain) ? ';domain=' + domain : '') + ';path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT';
	return true;
}

// Open a popup window with no location buttons etc
function openPopUp(location,name,width,height,relativeTo,top,left){
	var tly;
	var tlx;
	var winProps;
	switch( relativeTo ){
		case 'screenTR':
			tlx = screen.width - width - left;
			tly = top;
			break;
		case 'windowTL':
			tlx = window.dialogLeft ? window.dialogLeft + left : 0;
			tly = window.dialogTop ? window.dialogTop + top : 0;
			break;
		case 'screenTL':
			default:
			tlx = left;
			tly = top;
			break;
	}
	winProps = 'scrollbars=no,toolbar=no,location=no,nonresizable,width=' + width + ',height=' + height + ',left=' + tlx + ',top=' + tly;
	var objWin = window.open(location, name, winProps);
	objWin.focus();
	return objWin;
}

// Navigates to user selection from drop down list without need for a Go button
function FTCheckGo(obj){
	// Prepare for cross-browser support
	var winRef = 'top.';
	if (is.nav4){ winRef = ''; }
	var sValue = obj.options[obj.options.selectedIndex].value;
	if (sValue != ''){ eval(winRef + 'location.href="' + sValue + '"'); }
	obj.selectedIndex = 0; // Reset dropdown box
	return true;
}

// Get the date
function getDate(inDate){
	if (inDate == null){
		var now = new Date();
	} else {
		var now = new Date(inDate);
	}
	var day = now.getDay();
	var dday = now.getDate();
	var mon = now.getMonth();
	var year = now.getFullYear();
	// English
	var gbDays = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var gbMons = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
	// Chinese
	var zhDays = new Array('&#26143;&#26399;&#26085;','&#26143;&#26399;&#19968;','&#26143;&#26399;&#20108;','&#26143;&#26399;&#19977;','&#26143;&#26399;&#22235;','&#26143;&#26399;&#20116;','&#26143;&#26399;&#20845;');
	var thisChnYear = "&#24180;";
	var thisChnMon = "&#26376;";
	var thisChnDay = "&#26085;";
	var outStr;
	switch( FTSite ){
		case 'FTCOM':
			outStr = gbDays[day] + ' ' + gbMons[mon] + ' ' + dday + ' ' + year;
			break;
		case 'FTCHINA':
			outStr = year + thisChnYear + (mon+1) + thisChnMon + dday + thisChnDay + ' ' + zhDays[day];
			break;
	}
	return outStr;
}

function commonOnLoad(){
	if (!is.nav4){ }
	if (!is.nav4){ init(); }
}

function finishPage(){
	var pop = new Advert("pop",thisPage.ftsite,thisPage.alladparams,thisPage.issec,thisPage.wrap);
	document.write(pop.adHTML);
}

// "Make FT.com your homepage" code
function setHomepage(obj, url){
	if (is.ie && document.getElementById){
		obj.style.behavior = 'url(#default#homepage)';
		obj.setHomePage(url);
	} else if (is.nav4){
		var msg = '- Go to Preferences in the Edit Menu.\n'+
		'- Choose Navigator from the list on the left.\n'+
		'- Click on the "Use Current Page" button.';
		alert(msg);
	} else if (is.gecko){
		var msg = 'Drag the link onto your Home button to make this your Home Page.';
		alert(msg);
	} else if (is.opera5 || is.opera6){
		var msg = '- Go to Set Home Page in the Navigation Menu.\n'+
		'- Click on the "Use active" button.';
		alert(msg);
	} else if (is.opera7){
		var msg = '- Go to Set Home Page in the Navigation Menu.\n'+
		'- Click on the "Use current" radio button.';
		alert(msg);
	}
}

// Common Template functions
function writeheader(siteVal,FTSite,FTSection,FTPage,FTFund){
	var html = '';
	var headerLoc = 'http://globalelements.ft.com/FTCOM/Wrapper/';
	var secHeaderLoc = 'https://globalelements.ft.com/FTCOM/Wrapper/';
	if (siteVal == 'noLoginHead') {
		header = headerLoc+'noLoginHeader.html';
		secureHeader = secHeaderLoc+'secure_noLoginHeader.html';
	} else if (isSub != 0){
		header = 'http://news.ft.com/global/subpageheader';
		secureHeader = secHeaderLoc+'secure_header.html?isSub=Y';
	} else {
		header = 'http://news.ft.com/global/header';
		secureHeader = secHeaderLoc+'secure_header.html';
	}
	var srcFile = isSecure(document) ? secureHeader : header;
	var protocol = isSecure(document) ? 'https' : 'http';
	if (is.nav4){
		html += '<layer name="header" width="772" height="108" top="0" left="0" src="' + srcFile + '"></layer>';
		html += '<img src="'+protocol+'://globalelements.ft.com/c.gif" width="1" height="118" alt="" /><br />';
	} else {
		html += '<iframe src="' + srcFile + '" name="header" width="772" height="108" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe><br />';
		html += '<img src="'+protocol+'://globalelements.ft.com/c.gif" width="1" height="10" alt="" /><br />';
	}
	document.write(html);
}

function writefooter(siteVal,FTSite,FTSection,FTPage,FTFund){
	var html = '';
	var footer = 'http://news.ft.com/global/footer';
	var secureFooter = 'https://globalelements.ft.com/FTCOM/Wrapper/secure_footer.html';
	var srcFile = isSecure(document) ? secureFooter : footer;
	if (is.nav4){ html += '<layer name="footer" width="778" height="60" src="' + srcFile + '"></layer>'; }
	else { html += '<iframe src="' + srcFile + '" name="footer" width="778" height="60" marginwidth="0" marginheight="0" scrolling="no" frameborder="0"></iframe>'; }
	document.write(html);
}

// NS Utils
function netscapeCssFix(){
	if (document.FT.netscapeCssFix.initWindowWidth != window.innerWidth || document.FT.netscapeCssFix.initWindowHeight != window.innerHeight){ document.location = document.location; }
}

function netscapeCssFixCheckIn(){
	if (is.nav4 == true){
		if (typeof document.FT == 'undefined'){ document.FT = new Object; }
		if (typeof document.FT.FT_scaleFont == 'undefined'){
			document.FT.netscapeCssFix = new Object;
			document.FT.netscapeCssFix.initWindowWidth = window.innerWidth;
			document.FT.netscapeCssFix.initWindowHeight = window.innerHeight;
		}
		window.onresize = netscapeCssFix;
	}
}

netscapeCssFixCheckIn();

// Page Loaded
function ready(){
	if(window.loading || (is.ie && (document.readyState != 'complete')) ){ return(false); }
	else { return(true); }
}

// Legacy ad call support
function getAdHTML(pos,width,height,ftsite,ftsection,ftpage,ftindustry){
	eval("var "+pos+" = new Advert(\""+pos+"\",thisPage.ftsite,thisPage.alladparams,thisPage.issec,thisPage.wrap);");
	return eval(pos+".adHTML");
}

