
//---------------------------------------------------------------------------------------------
//
// Open eQuotes / CashBack in new window
//
//---------------------------------------------------------------------------------------------

function openAppWindow (page){
	var page;
	window.open(page,'','resizable=no,scrollbars=yes,status=yes,width=800,height=600');
}


//---------------------------------------------------------------------------------------------
//
// Open new popup windows for help etc.
//
//---------------------------------------------------------------------------------------------

function openInfoWindow(url,winName,width,height){ // No scroll bars
	var new_window = window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height);
}

function openInfoWindowScroll(url,winName,width,height){ // With scroll bars
	var new_window = window.open(url,winName,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=' + width + ',height=' + height);
}


//---------------------------------------------------------------------------------------------
//
// Flash detect functions
//
//---------------------------------------------------------------------------------------------

// These are the user defined globals.

var requiredVersion = 5;   // Version the user needs to view site (max 6, min 2)
var useRedirect = false;   // Set to false to embed the ovie or alternate html directly into this page.

// *************
// Everything below this point is internal until after the BODY tag.
// Do not modify!
// *************

// System globals
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var maxVersion = 6;
var actualVersion = 0;
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;



// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}


// standard javascript detection that uses the
// navigator.plugins array. Detector into a function so it loads
// before we run it.

function detectFlash() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // can get the major version by grabbing the character before the period
      var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

      // found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion >= 6;
    }
  }
	for (var i = 2; i <= maxVersion; i++) {
		var iVersion = eval("flash" + i + "Installed")
		if (iVersion == true) {
			actualVersion = i;
		}
	}


  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;
		if (actualVersion >= requiredVersion) {
		hasRightVersion = true;
		}
  }

detectFlash();  // call our detector now that it's safely loaded.

//
function popup(url,width,height) {
window.open(url,'Popupwin','left=30,top=30,width=' + width + ',height=' + height + ',menubar=no,toolbar=no,location=no,directories=no,scrollbars=no,status=no,resizable=no');
}

//
function writeBanner(swf,gif,w,h,link){
	<!--
	if (!useRedirect) {
		if(hasRightVersion) {
			var re = new RegExp ('&', 'gi') ;
			var link = link.replace(re, '%26') ;
			var oeTags = '<a href="' + link + '" border="0" >'
			+ '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'WIDTH="' + w + '" HEIGHT="' + h + '"'
			+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
			+ '<PARAM NAME="MOVIE" VALUE="' + swf + '?clickTag=' + link + '&clickWin=_top">'
			+ '<PARAM NAME="PLAY" VALUE="true">'
			+ '<PARAM NAME="LOOP" VALUE="true">'
			+ '<PARAM NAME="QUALITY" VALUE="high">'
			+ '<PARAM NAME="MENU" VALUE="false">'
			+ '<EMBED SRC="' + swf + '?clickTag=' + link + '&clickWin=_top"'
			+ 'WIDTH="' + w + '" HEIGHT="' + h + '"'
			+ 'PLAY="true"'
			+ 'LOOP="true"'
			+ 'QUALITY="high"'
			+ 'MENU="false"'
			+ 'TYPE="application/x-shockwave-flash"'
			+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
			+ '</EMBED>'
			+ '</OBJECT></a>';
			document.write(oeTags);
		} else {
			// flash is too old or can't detect the plugin
			var alternateContent = '<a href="' + link + '" title="" border="0"><img border="0" src="' + gif + '" width="' + w + '" height="' + h + '"></a>';
			document.write(alternateContent);
		}
	}
	// -->
}

//
function writeTravelBanner(swf,w,h){
	<!--
	if (!useRedirect) {
		if(hasRightVersion) {
			var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'
			+ 'width="' + w + '" height="' + h + '" id="swf_anim">'
			+ '	<param name="movie" value="' + swf + '" />'
			+ '	<param name="quality" value="high" />'
			+ '	<param name="bgcolor" value="#ffffff" />'
			+ '	<embed src="' + swf + '"'
			+ '	quality="high"'
			+ '	bgcolor="#FFFFFF"'
			+ '	width="' + w + '" height="' + h + '"'
			+ '	name="swf_anim"'
			+ '	type="application/x-shockwave-flash"'
			+ '	pluginspage="https://www.macromedia.com/go/getflashplayer">'
			+ '	</embed>'
			+ '</object>';
			document.write(oeTags);
		} else {
			// flash is too old or can't detect the plugin
			var alternateContent = '<b>For instant cover call us on</b><br /><br /><b>0800 032 1959</b><br /><br />Our lines are open between 8am and 8pm, Monday to Friday, and 9am to 5pm on Saturdays.(Please note that calls may be recorded in case of subsequent query.)<br /><br />';
			document.write(alternateContent);
		}
	}
	// -->
}


function writeGlossary(swf,gif,w,h){
	<!--
	if (!useRedirect) {
		if(hasRightVersion) {
			var oeTags = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ 'WIDTH="' + w + '" HEIGHT="' + h + '"'
			+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
			+ '<PARAM NAME="MOVIE" VALUE="' + swf + '">'
			+ '<PARAM NAME="PLAY" VALUE="true">'
			+ '<PARAM NAME="LOOP" VALUE="false">'
			+ '<PARAM NAME="QUALITY" VALUE="high">'
			+ '<PARAM NAME="MENU" VALUE="false">'
			+ '<EMBED SRC="' + swf + '"'
			+ 'WIDTH="' + w + '" HEIGHT="' + h + '"'
			+ 'PLAY="true"'
			+ 'LOOP="false"'
			+ 'QUALITY="high"'
			+ 'MENU="false"'
			+ 'TYPE="application/x-shockwave-flash"'
			+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
			+ '</EMBED>'
			+ '</OBJECT>';
			document.write(oeTags);
		} else {
			// flash is too old or can't detect the plugin
			var alternateContent = '<a href="/maia?h=home_head&amp;f=home_footer&amp;p=consumer/faq_callback&amp;u=home_utility&amp;n=shared/help_glossary&amp;t=glossary_top&amp;b=shared/help/glossary/glossary" title="Glossary section" border="0"><img src="'+gif+'" width="'+w+'" height="'+h+'"></a>';
			document.write(alternateContent);
		}
	}
	// -->
}

// Tall banner
function banner138x276(swf,gif,link){
	writeBanner("/promo/img/" + swf,"/promo/img/" + gif,138,276,link);
}
// Medium banner
function banner138x192(swf,gif,link){
	writeBanner("/promo/img/" + swf,"/promo/img/" + gif,138,192,link);
}
// Medium banner
function banner138x180(swf,gif,link){
	writeBanner("/promo/img/" + swf,"/promo/img/" + gif,138,180,link);
}
// Short banner
function banner138x90(swf,gif,link){
	writeBanner("/promo/img/" + swf,"/promo/img/" + gif,138,90,link);
}


// TRAVEL
function travelBanner(){
	writeBanner("/promo/img/banner_rowing_small.swf","/promo/img/ban_cashback_138x90.gif",138,109);
}

// EHC calc tool
function banner450x150(swf,gif,link){
	writeBanner("/body/img/" + swf,"/body/img/" + gif,450,150,link);
}

// Glossary box
function glossary(swf,gif){
	writeGlossary("/promo/img/" + swf,"/promo/img/" + gif,138,320);
}

// DrHilary
function drHilaryLink(area) {
	var newWindow = window.open('http://reporting.axappphealthcare.co.uk/cgi-bin/rr.cgi/http://www.axappphealthcarecampaign.co.uk/popup_webchat.asp&nourl=www.axappphealthcare.co.uk/links/' + area + '/drhilary_medium','webchatPopup', 'WIDTH=538,HEIGHT=564,TOP=10,LEFT=10,resizable');
	newWindow.focus();
}

// HOMEPAGE AD BANNERS
function banner230x108(swf,gif,link){
	writeBanner("/body/img/homepage/" + swf,"/body/img/homepage/" + gif,230,108,link);
}
function bannerHomepage(swf,gif,link){
	writeBanner("/body/img/homepage/" + swf,"/body/img/homepage/" + gif,211,126,link);
}


//---------------------------------------------------------------------------------------------
//
// Text size changer functions
//
//---------------------------------------------------------------------------------------------

// dw_cookies.js - cookie functions for www.dyn-web.com
// Recycled from various sources

// Modified from Bill Dortch's Cookie Functions (hidaho.com)
// (found in JavaScript Bible)
function setTcCookie(name,value,days,path,domain,secure) {
  var expires, date;
  if (typeof days == "number") {
    date = new Date();
    date.setTime( date.getTime() + (days*24*60*60*1000) );
		expires = date.toGMTString();
  }
  document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
	//alert('set cookie name=' +name);
}

// Modified from Jesse Chisholm or Scott Andrew Lepera ?
// (found at both www.dansteinman.com/dynapi/ and www.scottandrew.com/junkyard/js/)

function getTcCookie(name) {
	//alert('cookie name= ' +name);
  var nameq = name + "=";
  var c_ar = document.cookie.split(';');
  for (var i=0; i<c_ar.length; i++) {
    var c = c_ar[i];
	//alert('cookie value=' +c);
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameq) == 0) return unescape( c.substring(nameq.length, c.length) );

  }
	//alert('can\'t find cookie');
  return null;

}

// from Bill Dortch's Cookie Functions (hidaho.com)
function deleteTcCookie(name,path,domain) {
  if (getTcCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// dw_sizerdx.js version date: Jan 2004
// requires dw_cookies.js

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2004 by Sharon Paine
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function setPageDefaults () {

	// Set default values of 'dw_fontSizerDX' object
	dw_fontSizerDX.sizeUnit = "em";
	dw_fontSizerDX.defaultSize = .7;
	dw_fontSizerDX.maxSize = 1.1;
	dw_fontSizerDX.minSize = .6;

	// set elements to be controlled
	// Arguments: (selector text, default size, minimum, maximum)

	dw_fontSizerDX.set('.bodyText', .7, .7, 1.1);
	dw_fontSizerDX.set('.bodyTextNarrow', .7, .7, 1.1);
	dw_fontSizerDX.set('.bodyTextNarrow2', .7, .7, 1.1);
	dw_fontSizerDX.set('.bodyTextWide', .7, .7, 1.1);

	dw_fontSizerDX.set('.membTableText', .7, .7, 1.1);

	dw_fontSizerDX.set('.wideText', .7, .7, 1.1);
	dw_fontSizerDX.set('.border', .9, .9, 1.2);
	dw_fontSizerDX.set('.rightText', .7, .7, 1.1);
	dw_fontSizerDX.set('.navContainerText', .7, .7, 1.1);
	dw_fontSizerDX.set('.navContainerTextOn', .7, .7, 1.1);

	dw_fontSizerDX.set('.tableText', .7, .7, .9);
	dw_fontSizerDX.set('.tableSpacer', .7, .7, .9);
	dw_fontSizerDX.set('.bodyTextSmall', .6, .6, .8);
	dw_fontSizerDX.set('.bodyTextNoSubHeader', .7, .7, 1.1);
	dw_fontSizerDX.set('.dataProtectionPadlockText', .6, .6, .8);
	dw_fontSizerDX.set('.offerTextNoBorder', .7, .7, 1.1);
	dw_fontSizerDX.set('h3.normalHeaders', .7, .7, 1.1);
	dw_fontSizerDX.set('h4.numberedHeaders', .7, .7, 1.1);
	dw_fontSizerDX.set('h5.numberedHeaders', .7, .7, 1.1);
	dw_fontSizerDX.set('h3.subHeader', .75, .75, 1.15);
	dw_fontSizerDX.set('div#footer', .65, .65, .85);
	dw_fontSizerDX.set('div#largeNavText', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavLink', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavLinkOn', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSubLink', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSubLinkOn', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSubLinkBlue', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSubLinkBlueOn', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSub2Link', .7, .7, .9);
	dw_fontSizerDX.set('a.leftNavSub2LinkOn', .7, .7, .9);
	dw_fontSizerDX.set('a.navTextWithTop', .7, .7, .9);
	dw_fontSizerDX.set('div#keywordSearchForm', .7, .7, .9);
	dw_fontSizerDX.set('a.keywordSearch', .7, .7, .9);
	dw_fontSizerDX.set('a.utilityBlueLinks', .7, .7, 1.1);
	dw_fontSizerDX.set('a.utilityBlueLinksTop', 1, 1, 1.1);
	dw_fontSizerDX.set('h6.yourQuestionsHeader', .7, .7, .9);
	dw_fontSizerDX.set('div.generalFormField', 1, 1, 1.1);
	dw_fontSizerDX.set('.clickOn', .7, .7, 1.1);
	dw_fontSizerDX.set('div.contentDescriptionRight', .7, .7, 1.1);
	dw_fontSizerDX.set('.letters', .8, .8, 1.1);
	dw_fontSizerDX.set('a.letters', .95, .95, 1.25);

	dw_fontSizerDX.set('.paginationTop', .65, .65 , .75);
	dw_fontSizerDX.set('.paginationBottom', .65, .65, .75);
	dw_fontSizerDX.set('.nextPageLinkBox', .65, .65, .75);

	// Consumer homepage specific
	dw_fontSizerDX.set('.famBodyText', .7, .7, 1.1);
	dw_fontSizerDX.set('.nutritionInfo', .65, .65, .75);
	dw_fontSizerDX.set('.healthyText', .65, .65, .75);
	dw_fontSizerDX.set('.hcLink', .7, .7, 1.1);
	dw_fontSizerDX.set('.famHeadingText', .75, .75, .95);

	// Corporate homepage specific
	dw_fontSizerDX.set('.corpBodyText', .75, .75, 1.15);
	dw_fontSizerDX.set('.corpPromoText', .7, .7, .9);

	// Health hub specific
	dw_fontSizerDX.set('.hubIntro', .7, .7, 1.1);
	dw_fontSizerDX.set('.contentDescription', .7, .7, .9);
	dw_fontSizerDX.set('.IframeText', .7, .7, .9);

	// Microsites
	dw_fontSizerDX.set('h6.yourQuestionsHeader', .7, .7, .9);
	dw_fontSizerDX.set('h4.yourQuestions', .7, .7, .9);

	// BrightFM
	dw_fontSizerDX.set('.textSmall', .9, .9, 1.2);
	dw_fontSizerDX.set('.redSmall', .8, .8, 1.1);
	dw_fontSizerDX.set('.footerPad', .85, .85, 1.15);
	dw_fontSizerDX.set('body#bright', .7, .7, .9);

	// ?

	dw_fontSizerDX.set('.promoText', .8, .8, 1.1);
	dw_fontSizerDX.set('.text span', .8, .8, 1.1);

	// PMI hub page specific
	dw_fontSizerDX.set('.pmiHubBodyText', .7, .7, .9);

	// PMI
	dw_fontSizerDX.set('.ukPMIIntro', .75, .65, 1.15);
	dw_fontSizerDX.set('.ukPMIIntroWide', .75, .65, 1.15);
	dw_fontSizerDX.set('.ukPMIBorderTab', .9, .8, 1.2);
	dw_fontSizerDX.set('.ukPMIList', .7, .7, 1.1);
	dw_fontSizerDX.set('.ukPMIListPad', .7, .7, 1.1);
	dw_fontSizerDX.set('.ukPMITableList', .7, .6, 1.1);
	dw_fontSizerDX.set('.ukPMIHeaderLarge', .95, .85, 1.25);
	dw_fontSizerDX.set('.ukPMIBodyText', .7, .6, 1.1);

	dw_fontSizerDX.set('.content h2', .7, .6, 1.1);
	dw_fontSizerDX.set('.content h3', .7, .6, 1.1);
	dw_fontSizerDX.set('.content p', 1, 1, 1.1);


	dw_fontSizerDX.set('.bigBox li#pmi', 1, 1, 1.1);
	dw_fontSizerDX.set('p.introPMI', .7, .7, 1.1);

	dw_fontSizerDX.set('table#howToClaim', 1, 1, 1.3);
	dw_fontSizerDX.set('td .left#howToClaim', 1, 1, 1.3);
	dw_fontSizerDX.set('td .right#howToClaim', 1, 1, 1.3);

	dw_fontSizerDX.set('.pmiTableTextLeft', .7, .6, 1.1);
	dw_fontSizerDX.set('.pmiTableTextRight', .7, .6, 1.1);

	dw_fontSizerDX.set('table#benefits', .7, .6, 1.1);
	dw_fontSizerDX.set('th#benefits', 1.2, 1.2, 1.2);
	dw_fontSizerDX.set('td .left#benefits', 1, 1, 1.3);
	dw_fontSizerDX.set('td .right#benefits', 1, 1, 1.3);
	dw_fontSizerDX.set('td .blue#benefits', 1, 1, 1.3);

	dw_fontSizerDX.set('a.cssTooltip:hover span', 11, 11, 11);

	dw_fontSizerDX.set('.pmiLongBodyText', .7, .7, 1.1);

	dw_fontSizerDX.set('p#howToChoose', 1, 1, 1.1);

	// Guide to health insurance
	dw_fontSizerDX.set('.guideQuestionText', .75, .7, 1);
	dw_fontSizerDX.set('div#footerLong', .65, .65, .85);
	dw_fontSizerDX.set('.guideText', .75, .7, 1);
	dw_fontSizerDX.set('.bodyTextNarrow3', .7, .7, 1);
	dw_fontSizerDX.set('.bodyTextNarrow4', .6, .6, 1);


	//corporate pages
	//dw_fontSizerDX.setUnit('h3', 18, 18, 21, 'px');
	dw_fontSizerDX.set('.reasons-description ul li h2', 1.3, 1.3, 1.6);
	dw_fontSizerDX.set('.questions h2', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.introPromo h2', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.introPromo1 h2', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.about-us h3', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.other-business h3', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.business-knowledge h3', 1.35, 1.35, 1.65);
	dw_fontSizerDX.set('.reasons-choose p', 1.35, 1.35, 1.65);

	dw_fontSizerDX.set('.navigation ul li a', 1.2, 1.2, 1.6);
	dw_fontSizerDX.set('.contentBody', 1.0, 1.0, 1.4);


	// call init() function
	dw_fontSizerDX.init();
}

function setCorpPageDefaults () {

	// Set default values of 'dw_corpfontSizerDX' object
	dw_corpfontSizerDX.sizeUnit = "em";
	dw_corpfontSizerDX.defaultSize = .7;
	dw_corpfontSizerDX.maxSize = 1.1;
	dw_corpfontSizerDX.minSize = .6;

	// set elements to be controlled
	// Arguments: (selector text, default size, minimum, maximum)


	//corporate pages
	dw_corpfontSizerDX.set('.reasons-description ul li h2', 1.3, 1.3, 1.6);
	dw_corpfontSizerDX.set('.questions h2', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.introPromo h2', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.introPromo1 h2', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.about-us h3', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.other-business h3', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.business-knowledge h3', 1.35, 1.35, 1.65);
	dw_corpfontSizerDX.set('.reasons-choose p', 1.35, 1.35, 1.65);

	dw_corpfontSizerDX.set('.navigation ul li a', 1.2, 1.2, 1.6);
	dw_corpfontSizerDX.set('.contentBody', 1.0, 1.0, 1.4);
	dw_corpfontSizerDX.set('body', 0.75, 0.75, 1.0);

	// call init() function
	dw_corpfontSizerDX.init();
}

// dw_fontSizerDX javascript object
	var dw_fontSizerDX = {

	  // object local variables
	  sizeUnit:    "px",
	  defaultSize: 11,
	  maxSize:     14,
	  minSize:     10,

	  // array
	  adjustList: [],

	  // set array values function
		set: function (sel,dflt,mn,mx) {
		this.setUnit(sel,dflt,mn,mx,'em');
		},

	// set array values function
		setUnit: function (sel,dflt,mn,mx,unit) {
		this.adjustList[this.adjustList.length] = arguments;
		},

  // init function
  init: function() {
	// local variables
    var size, sizerEl, i;
	// simple browser compatibility detection - stop (return) if false
    if ( !document.getElementById || !document.getElementsByTagName ) return;
	// try and get cookie
    size = getTcCookie("fontSize");
	// if size is a number, turn into a float eg. 1.0 else use default size
    size = !isNaN( parseFloat(size) )? parseFloat(size): this.defaultSize;
    // check size is in max - min range. if not, then use default size
    if ( size > this.maxSize || size < this.minSize ) size = this.defaultSize;
	// curSize variable set to default value
    this.curSize = this.defaultSize;
	// these two are a bit of a mystery
    sizerEl = document.getElementById('sizer');
    if (sizerEl) sizerEl.style.display = "block";
    // hold ratio of this element's default size to this.defaultSize for calcs in adjust fn
    for (i=0; this.adjustList[i]; i++)
      this.adjustList[i][5] = this.adjustList[i][1] / this.defaultSize;
    if ( size != this.defaultSize ) this.adjust( size - this.defaultSize );
  },

  adjust: function(n) {
    var alist, size, list, i, j;
    // check against max/minSize
    if ( n > 0 && dw_fontSizerDX.maxSize ) {
      if ( dw_fontSizerDX.curSize + n > dw_fontSizerDX.maxSize )
          n = dw_fontSizerDX.maxSize - dw_fontSizerDX.curSize;
    } else if ( n < 0 && dw_fontSizerDX.minSize ) {
        if ( dw_fontSizerDX.curSize + n < dw_fontSizerDX.minSize )
          n = dw_fontSizerDX.minSize - dw_fontSizerDX.curSize;
    }
    if ( n == 0 ) return false;
    dw_fontSizerDX.curSize += n;
    // loop through adjustList, calculating size, checking max/min
    alist = dw_fontSizerDX.adjustList;
    for (i=0; alist[i]; i++) {
      size = dw_fontSizerDX.curSize * alist[i][5]; // maintain proportion
      size = Math.max(alist[i][2], size); size = Math.min(alist[i][3], size);
      list = dw_getElementsBySelector( alist[i][0] );
      for (j=0; list[j]; j++) { list[j].style.fontSize = size + alist[i][4]; }
    }
    setTcCookie( "fontSize", dw_fontSizerDX.curSize, 180, "/" );
  },

  // Reset adjustList elements to their default sizes
  reset: function() {
    var alist = dw_fontSizerDX.adjustList, list, i, j;
    for (i=0; alist[i]; i++) {
      list = dw_getElementsBySelector( alist[i][0] );
      for (j=0; list[j]; j++) { list[j].style.fontSize = alist[i][1] + alist[i][4]; }
    }
    dw_fontSizerDX.curSize = dw_fontSizerDX.defaultSize;
    deleteTcCookie("fontSize", "/");
  }
}
// end of object











// dw_corpfontSizerDX javascript object
	var dw_corpfontSizerDX = {

	  // object local variables
	  sizeUnit:    "px",
	  defaultSize: 11,
	  maxSize:     14,
	  minSize:     10,

	  // array
	  adjustList: [],

	  // set array values function
		set: function (sel,dflt,mn,mx) {
		this.setUnit(sel,dflt,mn,mx,'em');
		},

	// set array values function
		setUnit: function (sel,dflt,mn,mx,unit) {
		this.adjustList[this.adjustList.length] = arguments;
		},

  // init function
  init: function() {
	// local variables
    var size, sizerEl, i;
	// simple browser compatibility detection - stop (return) if false
    if ( !document.getElementById || !document.getElementsByTagName ) return;
	// try and get cookie
    size = getTcCookie("fontSize");
	// if size is a number, turn into a float eg. 1.0 else use default size
    size = !isNaN( parseFloat(size) )? parseFloat(size): this.defaultSize;
    // check size is in max - min range. if not, then use default size
    if ( size > this.maxSize || size < this.minSize ) size = this.defaultSize;
	// curSize variable set to default value
    this.curSize = this.defaultSize;
	// these two are a bit of a mystery
    sizerEl = document.getElementById('sizer');
    if (sizerEl) sizerEl.style.display = "block";
    // hold ratio of this element's default size to this.defaultSize for calcs in adjust fn
    for (i=0; this.adjustList[i]; i++)
      this.adjustList[i][5] = this.adjustList[i][1] / this.defaultSize;
    if ( size != this.defaultSize ) this.adjust( size - this.defaultSize );
  },

  adjust: function(n) {
    var alist, size, list, i, j;
    // check against max/minSize
    if ( n > 0 && dw_corpfontSizerDX.maxSize ) {
      if ( dw_corpfontSizerDX.curSize + n > dw_corpfontSizerDX.maxSize )
          n = dw_corpfontSizerDX.maxSize - dw_corpfontSizerDX.curSize;
    } else if ( n < 0 && dw_corpfontSizerDX.minSize ) {
        if ( dw_corpfontSizerDX.curSize + n < dw_corpfontSizerDX.minSize )
          n = dw_corpfontSizerDX.minSize - dw_corpfontSizerDX.curSize;
    }
    if ( n == 0 ) return false;
    dw_corpfontSizerDX.curSize += n;
    // loop through adjustList, calculating size, checking max/min
    alist = dw_corpfontSizerDX.adjustList;
    for (i=0; alist[i]; i++) {
      size = dw_corpfontSizerDX.curSize * alist[i][5]; // maintain proportion
      size = Math.max(alist[i][2], size); size = Math.min(alist[i][3], size);
      list = dw_getElementsBySelector( alist[i][0] );
      for (j=0; list[j]; j++) { list[j].style.fontSize = size + alist[i][4]; }
    }
    setTcCookie( "fontSize", dw_corpfontSizerDX.curSize, 180, "/" );
  },

  // Reset adjustList elements to their default sizes
  reset: function() {
    var alist = dw_corpfontSizerDX.adjustList, list, i, j;
    for (i=0; alist[i]; i++) {
      list = dw_getElementsBySelector( alist[i][0] );
      for (j=0; list[j]; j++) { list[j].style.fontSize = alist[i][1] + alist[i][4]; }
    }
    dw_corpfontSizerDX.curSize = dw_corpfontSizerDX.defaultSize;
    deleteTcCookie("fontSize", "/");
  }
}
// end of object



















// resource: simon.incutio.com/archive/2003/03/25/getElementsBySelector
function dw_getElementsBySelector(selector) {
 	var nodeList = [document], tokens, bits, list, els, i, j, k;
  if (!document.getElementsByTagName) return [];
  tokens = selector.split(' ');
  for (i=0; tokens[i]; i++) {
    if ( tokens[i].indexOf('#') != -1 ) {  // id
      bits = tokens[i].split('#');
      nodeList = [ document.getElementById( bits[1] ) ];
      continue;
    } else if ( tokens[i].indexOf('.') != -1 ) {  // class
      bits = tokens[i].split('.');
      for (j=0; nodeList[j]; j++)
        list = dw_getElementsByClassName( bits[1], bits[0], nodeList[j]);
      nodeList = [];
      for (j=0; list[j]; j++) { nodeList.push(list[j]); }
      continue;
    } else {  // element
      els = [];
      for (j = 0; nodeList[j]; j++) {
        list = nodeList[j].getElementsByTagName(tokens[i]);
        for (k = 0; list[k]; k++) { els.push(list[k]); }
      }
      nodeList = els;
    }
  }
  return nodeList;
}

function dw_getElementsByClassName(sClass, sTag, oCont) {
  var result = [], list, i;
  oCont = oCont? oCont: document;
  if ( document.getElementsByTagName ) {
    if ( !sTag || sTag == "*" ) {
      list = oCont.all? oCont.all: oCont.getElementsByTagName("*");
    } else list = oCont.getElementsByTagName(sTag);

    for (i=0; list[i]; i++)
      if ( list[i].className.match( new RegExp("\\b" + sClass + "\\b", "i") ) ) result.push( list[i] );
  }
  return result;
}

if (!Array.prototype.push) {  // for ie5.0
	Array.prototype.push =  function() {
		for (var i=0; arguments[i]; i++) this[this.length] = arguments[i];
		return this.length;
	}
}


//---------------------------------------------------------------------------------------------
//
// Function for displaying 'Please wait' on home and health info hub pages while iframe
// is retrieving web news feed content
//
//---------------------------------------------------------------------------------------------


function holdOn() {
	document.getElementById('wait').style.display = 'none';
	document.getElementById('iframe').style.display = 'block';
}


//---------------------------------------------------------------------------------------------
//
// Functions for opening 'Call back' in new window
//
//---------------------------------------------------------------------------------------------

function popup_equotes(){
	var url = "http://www.axappphealthcarecampaign.co.uk/callback/popup_equote.asp"
	var newWindow = window.open(url, 'popup_e', 'width=550,height=500');
	newWindow.focus();
}

function popup_pmi(){
	var url = "http://www.axappphealthcarecampaign.co.uk/callback/popup_pmi.asp"
	var newWindow = window.open(url, 'popup_p', 'width=550,height=500');
	newWindow.focus();
}



//---------------------------------------------------------------------------------------------
//
// Functions for opening 'Member area competition entry form' in popup
//
//---------------------------------------------------------------------------------------------

function brwWindowOpen(winURL, winName, width, height, top, left, scrollbars, menubar, toolbar, resizable){
	var properties = ""
	if (width > 0) properties += 'WIDTH=' + width + ',';
	if (height > 0) properties += 'HEIGHT=' + height + ',';
	if (top > -1) properties += 'TOP=' + top + ',';
	if (left > -1) properties += 'LEFT=' + left + ',';
	if (scrollbars) properties += 'scrollbars' + ',';
	if (menubar) properties += 'menubar' + ',';
	if (toolbar) properties += 'toolbar' + ',';
	if (resizable) properties += 'resizable';
	var newWindow = window.open(winURL, winName, properties);
	newWindow.focus();
}

function returnUniqueWinId(){
	return new Date().getTime().toString();
}


//---------------------------------------------------------------------------------------------
//
// Functions for adding page to favourites
//
//---------------------------------------------------------------------------------------------

function bookmarkPage() {

	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
	addToFavourites();
	}
	else {
		alert("You can bookmark this page by pressing the keys Ctrl+D");
		}
	}

function addToFavourites() {
	var url = self.location.href;
	var title = "AXA PPP healthcare";
	window.external.AddFavorite(url,title);
	}


//---------------------------------------------------------------------------------------------
//
// Functions for adding Email a friend
//
//---------------------------------------------------------------------------------------------

function emailFriend() {
	var page = self.location.href;
	var url = "https://www.axappphealthcare.co.uk/body/html/shared/email_friend/emaillink.jhtml?referer=" + page;

	window.open(url, 'EmailFriend', 'fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=430,height=500');
}


//---------------------------------------------------------------------------------------------
//
// Used as part of the ppc microsite
//
//---------------------------------------------------------------------------------------------


function getReferrerString() {
	if (window.location.href && window.location.href != "") {
		var url = window.location.href;
		if (getParameter( "axacmp" , url) != "") {
			return getParameter( "axacmp" , url);
		}
	}
}

function getCampaign(campaign) {
	if (window.location.href && window.location.href != "") {
		var url = window.location.href;
		if (getParameter( campaign , url) != "") {
			return getParameter( campaign , url);
		}
	}
}

function getParameter( name , url)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( url );
  if( results == null )
    return "";
  else
    return results[1];
}

function setCookie() {
	var searchTerm = getCampaign('mori_campaign');
	if (searchTerm != null) {
         document.cookie = 'mori_campaign=' + searchTerm + '; path=/';
	}
}

//---------------------------------------------------------------------------------------------
//
// Web chat function to detect if instanthchatoption divs are on page - Hannah 15/04/2008
//
//---------------------------------------------------------------------------------------------

function checkWebChatDiv() {
	var div1 = document.getElementById('instantchatoption');
	var div2 = document.getElementById('instantchatoption2');
	var div3 = document.getElementById('instantchatoption3');

	if (div1) {
		document.write('<'+'img src="https://admin.instantservice.com/resources/smartbutton/5982/18940/available.gif?'+Math.floor(Math.random()*10001)+'"style="width:0;height:0;visibility:hidden;position:absolute;" onload="Javascript: document.getElementById(\'instantchatoption\').style.display = \'block\';" onerror="Javascript: document.getElementById(\'instantchatoption\').style.display = \'none\';">');
	}
	if (div2) {
		document.write('<'+'img src="https://admin.instantservice.com/resources/smartbutton/5982/18940/available.gif?'+Math.floor(Math.random()*10001)+'"style="width:0;height:0;visibility:hidden;position:absolute;" onload="Javascript: document.getElementById(\'instantchatoption2\').style.display = \'block\';" onerror="Javascript: document.getElementById(\'instantchatoption2\').style.display = \'none\';">');
	}
	if (div3) {
		document.write('<'+'img src="https://admin.instantservice.com/resources/smartbutton/5982/18940/available.gif?'+Math.floor(Math.random()*10001)+'"style="width:0;height:0;visibility:hidden;position:absolute;" onload="Javascript: document.getElementById(\'instantchatoption3\').style.display = \'block\';" onerror="Javascript: document.getElementById(\'instantchatoption3\').style.display = \'none\';">');
	}
}

function readCookie(cookieName) {
	var theCookie = "" + document.cookie;
	var ind = theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1 = theCookie.indexOf(';',ind);
	if (ind1==-1) ind1 = theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function launchChat() {
	var SIVISITOR = readCookie("SIVISITOR");
	if (SIVISITOR != null && SIVISITOR != '') {
		window.open('http://axapppquote.metafaq.com/templates/axapppquote/main/chatpage?simigvis=' + SIVISITOR,'custclient','width=500,height=320,scrollbars=0');
	} else {
		window.open('http://axapppquote.metafaq.com/templates/axapppquote/main/chatpage','custclient','width=500,height=320,scrollbars=0');
	}

}



