jQuery(function(){
    jQuery('a.popupLink').click(function(e){
		e.preventDefault();
        var url = jQuery(this).attr('href');
        openPopup(url);
    });
});

jQuery(function(){
    jQuery('a.popupLinkTest').click(function(e){
		e.preventDefault();
        var url = jQuery(this).attr('href');
        openPopup(url);
    });
});


function openPopup(url) {
    scroll(0,0);  //move screen to top
    jQuery('#popup-container').bPopup({
        content : 'iframe',
        contentContainer : '#popup',
        follow: [false,true],
        position: [70, 'auto'],
        loadUrl: url
    });
}

function closePopup() {
    jQuery('#popup-container').bPopup().close();
}

function resizePopup(size) {
    jQuery('#popup-container').css('opacity', 100);
    jQuery('#popup iframe').css('height', size+'px');
    jQuery('#popup iframe').css('width', '100%');
}

function closeandcheckretract(){
    jQuery('#field-renonce1').attr('checked', true);
    jQuery('#popup-container').bPopup().close();
}

function closeAndCheckDegroupage(){
    jQuery('#field-degroupage').attr('checked', true);
    jQuery('#popup-container').bPopup().close();
}
