
$(function(){$('.updateSubscription').each(function(){var obj=this;$(obj).click(function(){var countVal=$('#count_'+this.id).val();$('#message').html('');$.ajax({type:"POST",url:'?c_=NBG_mysubscriptions&m_=updateSubscription',data:'id='+this.id+'&count='+countVal,success:function(response){var resp=response.split('|');if(resp[1]=='ok')
{$('#message').html(resp[0]);$('#count_'+resp[2]).css({'color':'black','font-weight':'normal'});}
if(resp[1]=='error')
{$('#message').html(resp[0]);$('#count_'+resp[2]).css({'color':'red','font-weight':'bold'});}}})})});});function deleteThis(id)
{$('#subid').val(id);loadDeletePopup();}
function loadDeletePopup(){if(popupStatus==0){$("#backgroundPopup").css({"opacity":"0.7"});centerPopup();$("#backgroundPopup").fadeIn("slow");$("#popupContact").fadeIn("slow");popupStatus=1;}}
function disableDeletePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut("slow");$("#popupContact").fadeOut("slow");popupStatus=0;}}
function confirmDelete(id)
{$.ajax({type:"POST",url:'?c_=NBG_mysubscriptions&m_=deleteSub&id='+$('#subid').val(),success:function(response){$('#responsen').html(response);$('#formcontrolls').css({display:'none'});$('#subscriptionrow_'+id).css({display:'none'});}})}
function centerPopup(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupContact").height();var popupWidth=$("#popupContact").width();$("#popupContact").css({"position":"absolute","top":windowHeight/2-popupHeight/2,"left":windowWidth/2-popupWidth/2});$("#backgroundPopup").css({"height":windowHeight});}
