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>You are leaving ENBREL.com</h1> \
<p>Please know that Amgen and Pfizer do not endorse and are not responsible for the content included on the site you are about to enter. Click the "Continue" button to proceed.</p> \
\
<div class="buttons"> \
<a href="#" class="leaving_submit btn_continue"/></a> <a href="#" class="canceller">Cancel</a> \
<div class="clearall"><br/></div> \
</div> \
<p style="clear: both;">To return to ENBREL.com click "Cancel", or close this window.</p> \
<div class="pop_footer"> \
<p style="clear: both; margin: 0;"><a href="'+SITEROOT+'/privacy-policy.jspx">Privacy Policy</a>  |  <a href="'+SITEROOT+'/terms-of-use.jspx">Terms of Use</a><br/> \
This site is intended for <a href="'+SITEROOT+'/terms-of-use.jspx">U.S. audiences only</a>.<br/> \
&copy; 2010 Amgen, Thousand Oaks, CA 91320 and 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();
}
