baseURL = '/index.php'; $.ui.dialog.defaults.bgiframe = true; window.onload = function() { settings = { tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 5 }, br: { radius: 5 }, antiAlias: true, autoPad: true } settings_toplogin = { tl: { radius: 5 }, tr: { radius: 5 }, bl: { radius: 0 }, br: { radius: 0 }, antiAlias: true, autoPad: false } var myBoxObject = new curvyCorners(settings, "rounded"); myBoxObject.applyCornersToAll(); var myBoxObject2 = new curvyCorners(settings_toplogin, "rounded_toplogin"); myBoxObject2.applyCornersToAll(); } $(document).ready(function () { $('#popup_login_a').click(function(){ $('#loading').show(); $('.popupcontent').hide(); $('#popup_content_main').hide(); //$('#popup_menu').hide(); $('#loading').hide(); $('#popup_content_login').show(); }); $('#popup_signup_a').click(function(){ $('#loading').show(); $('#popup_content_main').hide(); $('.popupcontent').hide(); //$('#popup_menu').hide(); $('#loading').hide(); $('#popup_content_signup').show(); }); $('#popup_form_login').submit(function () { $('#loading').show(); $('#popup_form_login_response').html(''); $.ajax({ type: 'POST', url: '/account/_login', data: 'submit42=true&email='+$('#popup_form_login_email').val()+'&password='+$('#popup_form_login_password').val()+'&', dataType:'json', success: function(d){ if (d.status) { $('#popup_menu').hide(); $('#popup_content_login').hide(); $('#popup_content_signup').hide(); $.ajax({ type: 'POST', url: '/cashback/_getShopData', data: 'id='+$('#saveShopID').val()+'&', dataType:'html', success: function(d){ $('#popup_content_main').html(d); $('#loading').hide(); $('#popup_content_main').show(); } }); } else { $('#loading').hide(); $('#popup_form_login_response').html(d.response); $.each(d.error,function(i, e) { $('#popup_form_login #'+e).addClass('ui-state-error'); }); } } }); }); $('#closePopup').click(function() {$('#popup').hide();$('#blackbox').hide();}) $('#popup_form_signup').submit(function () { queryString = 'submit42=true&email='+$('#popup_form_signup_email').val(); if ($("#popup_form_signup_terms").attr('checked') == true) { queryString += '&terms='+$("#popup_form_signup_terms").val(); } $('#loading').show(); $('#popup_form_signup_response').html(''); $.ajax({ type: 'POST', url: '/account/_signup', data: queryString, dataType:'json', success: function(d){ if (d.status) { $('#popup_content_login').hide(); $('#popup_content_signup').hide(); $('#popup_menu').hide(); $.ajax({ type: 'POST', url: '/cashback/_getShopData', data: 'id='+$('#saveShopID').val()+'&', dataType:'html', success: function(d){ $('#loading').hide(); $('#popup_content_main').html(d); $('#popup_content_main').show(); } }); } else { $('#loading').hide(); $('#popup_form_signup_response').html(d.response); $.each(d.error,function(i, e) { $('#popup_form_signup #'+e).addClass('ui-state-error'); }); } } }); }); }); function openPopup(shopID) { $('#loading').show(); $('#saveShopID').val(shopID); $('#popup_fb_a').attr('href', 'http://www.bonuskoenig.de/default/go/'+shopID); $('#popup').show(); $('#blackbox').fadeIn('slow'); $.ajax({ type: 'POST', url: '/cashback/_getShopData', data: 'id='+shopID+'&', dataType:'html', success: function(d){ $('#loading').hide(); $('#popup_content_login').show(); $('#popup_content_signup').show(); } }); } function getPageScroll() { var xScroll, yScroll; if (self.pageYOffset) { yScroll = self.pageYOffset; xScroll = self.pageXOffset; } else if (document.documentElement && document.documentElement.scrollTop) { yScroll = document.documentElement.scrollTop; xScroll = document.documentElement.scrollLeft; } else if (document.body) {// all other Explorers yScroll = document.body.scrollTop; xScroll = document.body.scrollLeft; } return new Array(xScroll,yScroll) } // Adapted from getPageSize() by quirksmode.com function getPageHeight() { var windowHeight if (self.innerHeight) { // all except Explorer windowHeight = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) { windowHeight = document.documentElement.clientHeight; } else if (document.body) { // other Explorers windowHeight = document.body.clientHeight; } return windowHeight } function openCalcPopup(shopID) { $('#popup').show(); $('#blackbox').fadeIn('slow'); $.ajax({ type: 'POST', url: '/cashback/_getCalcData', data: 'id='+shopID+'&', dataType:'html', success: function(d){ $('#popup_content_main').html(d); } }); }