
var more_info_containter = '<div id="moreInfoPopup" style="display:none; position: absolute;"> \
<div class="content"></div> \
</div>';

var wt_init = function()
{
        //alert('wt_init');
	$("a#copay_whatsthis_link").click(show_wt);
        
        $('div#main').after(more_info_containter);
        $('span.moreInfoSmall').hover(show_more_info_landing, hide_more_info);
        $('span.moreInfoSmallGoGreen').hover(show_more_info, hide_more_info);
        $('img#moreSharpsInfoPopup').hover(show_more_info_nospan, hide_more_info); 


}

var show_wt = function(e)
{
	var posi = $(this).position();
	var offset = $(this).offset();
	
	var cssPosObj = {
		'top' : Math.round(offset.top) + $(this).height() - 73 + "px",
		'left' : Math.round(offset.left) + $(this).width() + 5 + "px"
	}
	mode = "span";

	$("div#copay_whatsthis").css(cssPosObj);
	$("div#copay_whatsthis").show("fast");

} 
var hide_wt = function(e)
{
	$("div#copay_whatsthis").hide("fast");
}


    var miText2 = "<p class=\"bold_green_text\">\"Going green\" with the ENBREL Sharps Mail-Back Program</p> \
<p>Enrolling in the ENBREL Sharps Mail-Back Program ensures that 100% of your injection materials are recycled and are not sent to landfills. They are instead changed into materials used in the construction of buildings, roads, bridges, etc.</p> \
<p>The Program also provides a safe, convenient way to store used sharps materials before shipping them back. Postage-paid return boxes and sharps disposal are provided at no cost to you.</p> \
<p>You should receive your gallon-sized sharps container in about 7 to 10 business days.</p>";


    var miText = "<p class=\"bold_green_text\">Program Benefits </p><p>The ENBREL Sharps Mail-Back Program gives you a:</p> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em; margin-bottom:0.5em; '><span style='font-size: 12px;'>Safe, convenient way to store used sharps materials before<br/> shipping them back</span></li> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em; margin-bottom:0.5em; '><span style='font-size: 12px;'>Hassle-free sharps disposal at no cost to you</span></li> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em;'><span style='font-size: 12px;'>Green way of disposing ENBREL injectables&#151;no ENBREL<br/> needles in landfills</span></li></ul><p></p>";



    var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

    var miText_chrome = "<p class=\"bold_green_text\">Program Benefits </p><p>The ENBREL Sharps Mail-Back Program gives you a:</p> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em; margin-bottom:0.5em; '><span style='font-size: 12px;'>Safe, convenient way to store used sharps materials before<br/>&nbsp;&nbsp;&nbsp;shipping them back</span></li> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em; margin-bottom:0.5em; '><span style='font-size: 12px;'>Hassle-free sharps disposal at no cost to you</span></li> \
<li style='list-style:square; margin-left: 14px; font-size:8px; padding-left:0em;'><span style='font-size: 12px;'>Green way of disposing ENBREL injectables&#151;no ENBREL<br/>&nbsp;&nbsp;&nbsp;needles in landfills</span></li></ul><p></p>";

var show_more_info = function() {
    //alert('show_more_info');
    var offset = $(this).offset();
    
    var cssPosObj = {
        'top' : Math.round(offset.top) + $(this).height() + 5 + "px",
        'left' : Math.round(offset.left) + 188 + "px"
    }
    mode = "span";

    $("div#moreInfoPopup").css(cssPosObj);
    
    $("div#moreInfoPopup div.content").html(miText2);
    $("div#moreInfoPopup").show("fast");
}


var show_more_info_landing = function() {
    //alert('show_more_info');
    var offset = $(this).offset();
    
    var cssPosObj = {
        'top' : Math.round(offset.top) + $(this).height() + 5 + "px",
        'left' : Math.round(offset.left) + 188 + "px"
    }
    mode = "span";

    $("div#moreInfoPopup").css(cssPosObj);
    if( is_chrome) {
        $("div#moreInfoPopup div.content").html(miText_chrome);
    } else {
        $("div#moreInfoPopup div.content").html(miText);
    }
    $("div#moreInfoPopup").show("fast");
}


var show_more_info_nospan = function() {
    //alert('show_more_info');
    var offset = $(this).offset();
    
    var cssPosObj = {
        'top' : Math.round(offset.top) + $(this).height() + 5 + "px",
        'left' : Math.round(offset.left) + 0 + "px"
    }
    mode = "span";

    $("div#moreInfoPopup").css(cssPosObj);
    
    $("div#moreInfoPopup div.content").html(miText2);
    $("div#moreInfoPopup").show("fast");
}

var hide_more_info = function(e)
{
	$("div#moreInfoPopup").hide("fast");
}
