
$(function(){$("#abonnerknapp").click(function(){centerPopup();loadPopup();});$("#popupContactClose").click(function(){disablePopup();});$("#backgroundPopup").click(function(){disablePopup();});$(document).keypress(function(e){if(e.keyCode==27&&popupStatus==1){disablePopup();}});$('#newCommentSend').click(function(){var str=$("#newComment").serialize();$.post('?'+str,function(data){$('#newCommentMsg').html(data);},"text");});$('#tipAFriendSend').click(function(){var str=$("#tipAFriend").serialize();$.post('?'+str,function(data){$('#tipAFriendMsg').html(data);},"text");});});function openAdminPop()
{window.open('/index.php?c_=NBG247_SubscriberadminGUI&m_=show','name','height=600,width=900,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');}
function verifySubData(obj)
{obj.submit();}
var popupStatus=0;function loadPopup(){if(popupStatus==0){$("#backgroundPopup").css({"opacity":"0.7"});$("#backgroundPopup").fadeIn("slow");$("#popupContact").fadeIn("slow");popupStatus=1;}}
function disablePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut("slow");$("#popupContact").fadeOut("slow");popupStatus=0;}}
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});}
function changetoinvoice()
{$.post("index.php",{c_:'NBG_mysubscriptions',m_:'setInvoicePayment'},function(data){$('#paymentResponse').html(data);});}
function setpay(obj)
{if($(obj).val()=='dibs')
{$('#invoiceupdate').css({'display':'none'});$('#changepay').css({'display':'block'});}
else
{$('#changepay').css({'display':'none'});$('#invoiceupdate').css({'display':'block'});}}
(function($){$.fn.modal=function(options){return this.each(function(){if(this._modal)return;if(typeof(options)!="undefined")var params=$.extend({},$.fn.modal.defaults,options);else var params=$.fn.modal.defaults;if(typeof(modal_count)=="undefined")modal_count=0;modal_count++;this._modal=modal_count;H[modal_count]={config:params,target_modal:this};$(this).modal_add_show(this);});}
$.fn.modal_add_show=function(ele){return $.modal.show(ele);}
$.fn.modal_show=function(){return this.each(function(){$.modal.open(this);});}
$.fn.modal_hide=function(){return this.each(function(){$.modal.hide(this);});}
$.fn.modal.defaults={show:false,hide:false,modal_styles:{display:"block",zIndex:1001},resize:true,hide_on_overlay_click:true};$.modal={hash:{},show:function(ele){var pos=ele._modal,h=H[pos];jQ(h.target_modal).click(function(){$.modal.open(ele);return false;});return false;},hide:function(ele){var pos=ele._modal,h=H[pos];if(h.config.hide_on_overlay_click)var idstr="#modal_overlay, .modal_close";else var idstr=".modal_close";jQ(idstr).click(function(){jQ("#modal_content").remove();jQ("#modal_overlay").remove();if(h.config.hide)h.config.hide();return false;});},open:function(ele){var pos=ele._modal;var h=H[pos];$.modal.insert_overlay();$.modal.insert_content_container();var content=$.modal.get_content($(h.target_modal));jQ("#modal_content").html(content);if(h.config.modal_styles)jQ("#modal_content").css(h.config.modal_styles);if(h.config.resize)$.modal.resize_container();$.modal.for_ie(jQ("#modal_overlay"));if(h.config.show)h.config.show();$.modal.hide(ele);},resize_container:function(){var max_width=0,max_height=0;jQ('#modal_content *').load(function(){jQ('#modal_content *').each(function(){var tw=jQ(this).outerWidth(),th=jQ(this).outerHeight();if(tw>max_width)max_width=tw;max_height+=th;});if(max_width>0&&max_height>0)jQ('#modal_content').css('width',(max_width+jQ('#modal_content .modal_close:first').outerWidth())+'px').css('height',(max_height)+'px').css('margin-left','-'+(max_width/2)+'px');});},insert_overlay:function(){if(!jQ('#modal_overlay').length)jQ("body").append('<div id="modal_overlay"></div>');jQ("#modal_overlay").css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':1000,opacity:50/100});},insert_content_container:function(){if(!jQ('#modal_content').length)jQ("body").append('<div id="modal_content"></div>');},get_content:function(trig){c="<div class='modal_close'><div>x</div></div>";if(trig.attr("rel")){div_id=jQ('#'+trig.attr('rel'));div_class=jQ('.'+trig.attr('rel'));if(div_id.length){c+=div_id.html();}
else if(div_class.length){c+=div_class.html();}}else if(trig.attr('href')){if(trig.attr('title')){c+="<h3 class='modal_title'>"+trig.attr('title')+"</h3><img src='"+trig.attr('href')+"' alt='"+trig.attr('title')+"' />";}
else{c+="<img src='"+trig.attr('href')+"' alt='modal' />";}}else{c=c+trig.html();}
return c;},for_ie:function(o){if(ie6&&$('html,body').css({height:'100%',width:'100%'})&&o){$('html,body').css({height:'100%',width:'100%'});i=$('<iframe src="javascript:false;document.write(\'\');" class="overlay"></iframe>').css({opacity:0});o.html('<p style="width:100%;height:100%"/>').prepend(i)
o=o.css({position:'absolute'})[0];}}}
var H=$.modal.hash,jQ=jQuery;ie6=$.browser.msie&&($.browser.version=="6.0");})(jQuery);