function openPagePost(page, request, blank){ var blank = typeof blank !== 'undefined' ? blank : false; var inputs = ''; request.forEach(function(element, index, array){ inputs += ''; }); $('
'+inputs+'
').appendTo("body").submit(); } function bannerClick(banner, link){ $.ajax({url: "stats/bannerClick.php", method: "POST", data: { "banner": banner, "source": window.location.href }, dataType: "html" }); window.open(link); } function openRegistration(){ $.ajax({ method:"POST", url:'registrationMobile.php', dataType:'html', success: function(data){ $(".loginData").html(data); } }); } function openLogin(){ $.ajax({ method:"POST", url:'loginMobile.php', dataType:'html', success: function(data){ $(".loginData").html(data); } }); } function logout(){ $.ajax({ method:"POST", url:'logoutMobile.php', dataType:'html', success: function(data){ location.reload(); } }); } function bannerRoll(prev,pos,category){ if (!$('#'+prev).parent().is("[seq]")){ $('#'+prev).parent().attr("seq",0); } var seq = parseInt($('#'+prev).parent().attr("seq")); if (seq++ < 12){ $.ajax({ method:"POST", url:'getBanner.php?replaced='+prev+'&pos='+pos+'&cat='+category, dataType:'html', success: function(data){ $('#'+prev).parent().html(data); } }); $('#'+prev).parent().attr("seq",seq); // console.log(prev + " on seq " + (seq) ); } } function previewImage(imageSrc){ $('.clickableImageContainer').html(''); $('.imageOverlay').css("display","block"); $('.clickableImageContainer').css("display","block"); } function hidePreview(){ $('.imageOverlay').css("display","none"); $('.clickableImageContainer').css("display","none"); $('#clickImage').remove(); } function printNews(newsId){ // $.ajax({ // method:"POST", // url:'printPage.php?id='+ newsId, // dataType:'html', // // }); openPagePost("printPage.php",[{name:'id',value:newsId}],true); } function openMenuWithLoginPage(){ $("#loginMobile").trigger("click"); } function openMenuWithRegistrationPage(){ openRegistration(); $(".loginContainer").trigger("open"); }