 $(document).ready(function() {
/*
$(".digg").fancybox({
    'type': 'iframe',
	'targetLink': 'http://digg.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),
    'position': 'fixed'
 });

$(".facebook").fancybox({
    'type': 'iframe',
	'targetLink': 'http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title),
    'position': 'fixed'
 });

$(".twitter").fancybox({
    'type': 'iframe',
	'targetLink': 'http://twitter.com/home?status='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title),
    'position': 'fixed'
 });

$(".legal").fancybox({
    'type': 'iframe',
	'targetLink': 'http://bms.com/legal/Pages/notice.aspx',
    'position': 'fixed'
 });

$(".privacy").fancybox({
    'type': 'iframe',
	'targetLink': 'http://bms.com/legal/Pages/privacy.aspx',
    'position': 'fixed'
 });
 
 $(".reyataz").fancybox({
    'type': 'iframe',
	'targetLink': 'http://www.reyataz.com/',
    'position': 'fixed'
 });
 
 $(".ppa").fancybox({
    'type': 'iframe',
	'targetLink': 'http://www.pparx.org/Intro.php/',
    'position': 'fixed'
 });
 
 $(".ailey").fancybox({
    'type': 'iframe',
	'targetLink': 'http://www.alvinailey.org',
    'position': 'fixed'
 });
 

/*we can add more ids like this for more popups*/

} );


(function($) {
    function confirm(redirect_url, popupType) {
        $(popupType).modal({
            overlayId: 'confirm-modal-overlay',
            containerId: 'confirm-modal-container',
            autoPosition: true,
            opacity: 85,
            onShow: function(dialog) {
                var modal = this;
                $('.yes_confirm', popupType).click(function(e) {
                    e.preventDefault();
                    $.modal.close();
                    window.open(redirect_url, "_blank");
                    //window.location.href = redirect_url;
                });
                $('.closePopNo', popupType).click(function(e) {
                    e.preventDefault();
                    $.modal.close();                    
                });
            }
        });
    }

    jQuery(function($) {
        var $modalVar = $('a.confirm-modal'),
			$modalVarFooter = $('a.confirm-modal-foot'),
			modal_html = '<div class="modal-popup"><div id="leavingSite"><div id="leavingSiteContiner"><div id="closeSiteContainer"><div id="closeLink"><a href="javascript:void(0);" class="closePopNo" onMouseOver="this.style.cursor =\'pointer\'" class="closePopUp">Close Window</a><img src="images/navClose.png" class="closePopNo" onclick="javascript:void(0);" onMouseOver="this.style.cursor =\'pointer\'" class="closePopUp" /></div></div><div id="brandContainer"  style="width:450px;"><img src="images/leaveSiteBrandImage.gif"  id="contestBrand"/></div><div id="bodyContainer" style="width:450px;_width:530px;"><img src="images/leaveSiteHeading_2.gif" /><br />FightHIVYourWay.com may provide links or references to other Web sites not<br />affiliated with Bristol-Myers Squibb. Bristol-Myers Squibb is not responsible for<br />the content of such other sites and shall not be liable for any damages or injury<br />arising from users\' access to such sites. Links to other sites are provided only<br />as a convenience to users of FightHIVYourWay.com.<br /><br /><span class="highlight">Would you like to leave FightHIVYourWay.com?</span></div><div id="buttonContainer"  style="width:450px;_width:480px;"><a href="javascript:void(0);"><img id="yesButton" src="images/leaveSiteYesButton.gif" class="yes_confirm" /></a><a href="javascript:void(0);"><img id="noButton" src="images/leaveSiteNoButton.gif" class="closePopNo" /></a></div></div></div></div>';
			
        if ($modalVar.length) {
            if(jQuery('.modal-popup').length == 0){
                jQuery(modal_html).appendTo('body');
            }
            $modalVar.click(function(e) {
                e.preventDefault();
                var redirect_url = $(this).attr('href');
                confirm(redirect_url, '.modal-popup');
            });
        }       
        	
    });
} (jQuery))


