$(function() {
//	$("#guarantee a").click(function() {
//		window.open(this.href, 'guarantee', 'width=300, \
//			height=110, \
//			directories=no, \
//			location=no, \
//			menubar=no, \
//			resizable=no, \
//			scrollbars=0, \
//			status=no, \
//			toolbar=no');
//		return false;
//	});

	$('.mailer #keycode a').lightbox({speed: 'fast'});
});

$(function() {
	$("a.see_label").click(function() {
		window.open(this.href, 'labelIngredients', 'width=920, \
			height=280, \
			directories=no, \
			location=no, \
			menubar=no, \
			resizable=no, \
			scrollbars=0, \
			status=no, \
			toolbar=no');
		return false;
	});
});
$(function() {
	$("a.guarantee").click(function() {
		window.open(this.href, 'guarantee', 'width=385, \
			height=320, \
			directories=no, \
			location=no, \
			menubar=no, \
			resizable=no, \
			scrollbars=0, \
			status=no, \
			toolbar=no');
		return false;
	});
});
$(function () {
$('#research #offer_content').append('<div class="module_help"><h4>Can Petadolex&reg; help you?</h4><p>Preventive therapy with Petadolex&reg; may be right for you if any of the following criteria apply:</p><ol><li>Frequent attacks (at least two migraines a month that last 3 or more days)</li><li>Intense migraines that interfere with daily routines</li><li>Use of Rx (prescription) or OTC (non-prescription) migraine medications at least twice a week</li><li>Doctor-prescribed medications have not been effective, were not well tolerated, or interact with other medications you\'re taking</li></ol><p>As with any preventive treatment, it may take 2-3 months for the benefits of Petadolex&reg; to become apparent. During this time, it is important to take Petadolex consistently.  Afterwards, if you then experience a period without migraines you can consider tapering or discontinuing your dosage.</p></div>');
});

// MODAL DHTML LAYER
$(document).ready(function() {  

        //select all the a tag with name equal to modal
        $('*[name=modal]').click(function(e) {
                //Cancel the link behavior
                e.preventDefault();
                
                //Get the A tag
                var id = $(this).attr('href');
        
                //Get the screen height and width
                var maskHeight = $(document).height();
                var maskWidth = $(window).width();
        
                //Set heigth and width to mask to fill up the whole screen
                $('.mask').css({'width':maskWidth,'height':maskHeight});
                
                //transition effect             
                $('.mask').fadeIn(500);
                $('.mask').fadeTo("fast",0.8);  
                                 if ($.browser.msie && $.browser.version.substr(0,1)<7) { $('select').hide(); } // Explorer 6 Strict

                //Get the window height and width
                 if (self.pageYOffset) {
                                yScroll = self.pageYOffset;
                } else if (document.documentElement && document.documentElement.scrollTop){  // Explorer 6 Strict
                                yScroll = document.documentElement.scrollTop;
                } else if (document.body) {// all other Explorers
                                yScroll = document.body.scrollTop;
                }
                
                var winH = yScroll;
                var winW = $(window).width();
                
              
                //Set the popup window to center
                $(id).css('top', winH+50);
                $(id).css('left', winW/2-$(id).width()/2);

                
                //transition effect of window
                $(id).fadeIn(2000);
        });
        
        //if close button is clicked
        $('.window .close').click(function (e) {
                //Cancel the link behavior
                e.preventDefault();
                
                $('.mask').hide();
                $('.window').hide();
                               $('select').show();
        });             
        
        //if mask is clicked
        $('.mask').click(function () {
                $(this).hide();
                $('.window').hide();
                                $('select').show();
        });                     
        
});