var leaving_site_popup_containter = '<div id="leaving_site_popup" class="standard_popup" style="display:none; position: absolute;"> \
<div id="standard_popup_iefix"></div> \
<a href="#" id="top_button" class="canceller"><img src="'+SITEROOT+'/images/shell/btn_close_x.gif" /></a> \
<div class="inner_iefix"></div><div class="inner"> \
<h1>Usted est&aacute; saliendo de ENBREL.com</h1> \
<p>Por favor, sepa que Amgen y Pfizer no promocionan ni son responsables del contenido incluido en el sitio que est&aacute; a punto de entrar. Haga clic en el bot&oacute;n "Continuar" para proceder.</p> \
\
<div class="buttons"> \
<a href="#" class="leaving_submit btn_continue"/></a> <a href="#" class="canceller">Cancelar</a> \
<div class="clearall"><br/></div> \
</div> \
<p style="clear: both;">Para regresar a ENBREL.com, haga clic en "Cancelar" o cierre esta ventana.</p> \
<div class="pop_footer"> \
<p style="clear: both; margin: 0;"><a href="http://www.enbrel.com/privacy-policy.jspx">Pol&iacute;tica de privacidad</a>  |  <a href="http://www.enbrel.com/terms-of-use.jspx">T&eacute;rminos de uso</a><br/> \
Este sitio est&aacute; destinado para <a href="http://www.enbrel.com/terms-of-use.jspx">audiencias de los EE. UU. solamente</a>.<br/> \
&copy; 2011 Amgen, Thousand Oaks, CA 91320 y Pfizer Inc.</p> \
</div> \
</div> \
<div class="bottom_iefix"></div><div class="bottom"></div> \
</div>';

var url="";

var pdf_popup_containter = '<div id="pdf_popup" class="standard_popup" style="display:none; position: absolute;"> \
<div id="standard_popup_iefix"></div> \
<a href="#" id="top_button" class="canceller"><img src="'+SITEROOT+'/images/shell/btn_close_x.gif" /></a> \
<div class="inner_iefix"></div><div class="inner"> \
<h1>Notice</h1> \
<p>The following information is intended for use only by residents of the United States. Countries outside of the United States may have regulatory requirements or medical practices that are different than those in the United States and may require reference to different or additional information. Therefore, this information may not be appropriate outside of the United States.</p> \
<p>If you are a resident of the United States or one of its territories, or a health care professional practicing your profession in the United States or one of its territories, please click below.</p> \
<div class="buttons"> \
<a href="#" class="leaving_submit btn_continue"/></a> \
<div class="clearall"></div> \
</div> \
<p style="clear: both; margin: 0;">If you are a resident of a country other than the United States, please visit the <a href="http://www.pfizer.com" target="_blank">Pfizer website</a> and the <a href="http://www.amgen.com" target="_blank">Amgen website</a> to find information about our offices around the globe.</p> \
</div> \
<div class="bottom_iefix"></div><div class="bottom"></div> \
</div>';

var interstitial_init = function()
{
    // insert the container
     $('div#main').after(leaving_site_popup_containter);
     $('div#main').after(pdf_popup_containter);	 
     // add click events
     $('.external').click(show_leaving);
     $('a.us_pdf').click(show_download);
}

var show_leaving = function(e)
{
    e.preventDefault();
    url = this.href;
    $('div#leaving_site_popup a.canceller').click(hide_interstitial);
    $('div#leaving_site_popup a.leaving_submit').click(function()
    {	
        evokeModalDialog.hide();	
        window.open (url,"mywindow");
    });
    evokeModalDialog.setBgColor("#FFFFFF");
    evokeModalDialog.show('leaving_site_popup');
}

var show_download = function(e)
{
    e.preventDefault();
    url = this.href;
    $('div#pdf_popup a.canceller').click(hide_interstitial);
    $('div#pdf_popup a.leaving_submit').click(function()
    {	
        evokeModalDialog.hide();	
        window.open (url,"mywindow");
    });
    evokeModalDialog.setBgColor("#FFFFFF");
    evokeModalDialog.show('pdf_popup');
}

var hide_interstitial = function(e)
{
    e.preventDefault();
    evokeModalDialog.hide();
}

