function snp_onclose_popup()
{
var popup=jQuery('#snp_popup').val();
if(jQuery('#snp_popup').val())
{
var cookie_close=jQuery('#'+jQuery('#snp_popup').val()+' .snp_cookie_close').val();
}
else
{
cookie_close=-1;
}
if(!jQuery.cookie('snp_'+popup))
{
if(!cookie_close)
{
cookie_close=-1;
}
snp_set_cookie('snp_'+popup, '1', cookie_close);
}
if(jQuery('#snp_exithref').val())
{
// exit popup
//if(jQuery('#snp_exittarget').val()=='_blank')
//{
// window.open(jQuery('#snp_exithref').val());
//}
//else
//{
document.location.href=jQuery('#snp_exithref').val();
//}
}
jQuery('.fancybox-overlay').removeClass('snp-pop-'+jQuery('#snp_popup_id').val()+'-overlay');
jQuery('.snp-wrap').removeClass('snp-pop-'+jQuery('#snp_popup_id').val()+'-wrap');
jQuery('#snp_popup_theme').val('');
jQuery('#snp_popup').val('');
jQuery('#snp_popup_id').val('');
jQuery('#snp_exithref').val('');
jQuery('#snp_exittarget').val('');
}
function snp_close()
{
if(jQuery.fancybox2!==undefined && jQuery.fancybox2.isOpen)
{
jQuery.fancybox2.close();
}
else
{
var popup=jQuery('#snp_popup').val();
if(snp_f[popup+'-open']!==undefined)
{
snp_f[popup+'-close']();
snp_onclose_popup();
}
}
}