dojo.require('pepper.util.OnLeave');

dojo.addOnLoad(function() {
    var familySites = [
        'abbott.com', 'abbottdiabetescare.com', 'abbottincalifornia.com', 'abbottinvestor.com',
        'myfreestyle.com', 'smartmanual.biz', 'abbott-diabetes-care.at', 'abbott-diabetes-care.ch',
        'abbott-diabetes-care.de', 'abbott-diabetescare.pl', 'abbott-diabetes.se', 'abbott.co.in',
        'abbott.co.jp', 'abbott.co.kr', 'abbott.co.th', 'abbott.com.cn', 'abbott.com.hk',
        'abbott.com.my', 'abbott.com.ph', 'abbott.com.pk','abbott.com.sg', 'abbott.com.tw',
        'abbott.dk', 'abbottdiabetes.com.br', 'abbottdiabetescare.be', 'abbottdiabetescare.ca',
        'abbottdiabetescare.com.ar', 'abbottdiabetescare.com.au', 'abbottdiabetescare.cz',
        'abbottdiabetescare.dk', 'abbottdiabetescare.es', 'abbottdiabetescare.ie',
        'abbottdiabetescare.nl', 'abbottdiabetescare.pt', 'abbottdiabetescare.ru', 'diabetesnow.co.uk',
        'endocrineindia.com', 'logaland.is', 'abbottdiabetescare.co.uk', "{same}"
    ];

    var externalLinkMessage = ([
        '<p>Notice</p>',
        '<p>The "Yes" link below will take you out of the Abbott Laboratories family of websites.</p>',
        '<p>Links which take you out of Abbott Laboratories worldwide web sites are not under the control of Abbott Laboratories,  and Abbott Laboratories is not responsible for the contents of any such site or any further links from such site. Abbott Laboratories is providing these links to you only as a convenience,  and the inclusion of any link does not imply endorsement of the linked site by Abbott Laboratories.</p>',
        '<p>Do you wish to leave this site?</p>',
        '<div class="absolute-wrapper"><p class="confirmation-doc-id">DOC19079_Rev-A 06/09</p></div>'
    ]).join('');

    var baseURL = 'http://' + document.domain + '/';

    // Set up the normal on-leave dialog
    ol = new pepper.util.OnLeave({
        content: externalLinkMessage,
        hostLacks: familySites,
        title: 'Exit Abbott.com',
        type: 'popup',
        width: 500,
        height: 360,
        stay: '<img src="' + (dojo.isIE && dojo.isIE < 8 ? baseURL : '') + '/static/images/no.gif"/>',
        go: '<img src="' + (dojo.isIE && dojo.isIE < 8 ? baseURL : '') + '/static/images/yes.gif"/>',
		newWindow: 'true'
    });
});

