function toggle() { var ele = document.getElementById("toggleText"); var text = document.getElementById("displayText"); if(ele.style.display == "block") { ele.style.display = "none"; text.innerHTML = "show more"; } else { ele.style.display = "block"; text.innerHTML = "hide"; } } function popup(){ window.open('/tell_a_friend.php', 'tellafriend_script','scrollbars=1,statusbar=1,resizable=1,width=460,height=640,left = 10,top = 10'); } function showsubform(){ $('#smallemail').show(); $('#smallemail').val(''); $('#Cters').show(); $("#sign-up-buttonsBox").html(''); } $(document).ready(function() { $.ajax({ type: "POST", async: false, url: "/include/updates/live.php", data: "", success: function(data){ $("#numberoflives").html(data); } }); $.ajax({ type: "POST", async: false, url: "/include/updates/last.php", data: "", success: function(data){ $("#lastupdate").html(data); } }); $("#addComment").click(function(){$('html, body').animate({scrollTop: $("#leaveComment").offset().top }, 1500);}); //$(document).pngFix(); /* $("#sign-up-form").validationEngine({ ajaxSubmit:true, ajaxSubmitFile: "/mail.php", ajaxSubmitMessage: "Thank you, we received your inscription!", ajaxSubmitExtraData: "?email="+$('#subemail').val()+"&tags=weekly email"+"&linked="+$('#linked').val()+"&formtitle="+$('#formtitle').val(), success : false, failure : function() {} }); */ $(".copy-butt").each(function(){ clip = new ZeroClipboard.Client(); clip.clipText = $(this).attr("title"); var camid = $(this).attr("alt"); clip.glue($(this).attr("id"),$(this).attr("id")); clip.buttonid = $(this).attr("id"); clip.camid = camid; clip.addEventListener('complete', function (client, text) { $("#"+client.buttonid).css("background-position","0px 38px"); $("#"+client.buttonid).html(""); }); }); $(".like").click(function() { var id=$(this).attr("id"); var name=$(this).attr("name"); var dataString = 'id='+ id + '&name='+ name; $(this).parent().find(".votebox").slideDown("slow"); $(this).parent().find(".flash").fadeIn("slow"); $.ajax ({ type: "POST", url: "/classes/rating.php", data: dataString, cache: false, success: function(html) { //$("#flash").fadeOut("slow"); $("#content_"+id).html(html); } }); return false; }); $(".sortdeals").click(function() { params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var name= $(this).attr("name"); var strNewURL = "http://www.promocodes.co.uk/" + name +"/1/sortbydeals/" ; wind = window.open(strNewURL, "_self", params ); return false; }); $(".closeBtn").bind("click", (function (event) { $("#codePopUpBox_"+$(this).attr("title")).css('left','-2090px'); })); $(".codeclick").unbind('click').bind("click", (function (event) { //$(this).find(".showcode").show().addClass("open"); var ared = $(this).attr('id'); $("#codePopUpBox_"+ared).css('left','290px'); $('a#copyBtn'+ared).zclip({ path:'/ZeroClipboard.swf', copy:$('p#codeBox'+ared).text() }); //$(this).parents('.vouchers-container').find(".showcode").show(); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var ared = $(this).attr('id'); var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + ared ; wind = window.open(strNewURL, "_Self", params ); //wind.focus(); //wind.blur(); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); return false; })); $(".sortcodes").click(function() { params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var name= $(this).attr("name"); var strNewURL = "http://www.promocodes.co.uk/" + name +"/1/sortbycodes/" ; wind = window.open(strNewURL, "_self", params ); return false; }); $(".close").click(function() { $("#votebox").slideUp("slow"); }); $('#sign-up-form').submit(function() { if($('#sign-up-form').validationEngine({returnIsValid:true})){ //$(this).find('.submit_button2').hide(); // //setTimeout("window.location.href = '/thankyou.php'",100); $.ajax({ type: "POST", async: false, url: "/mail.php", data: "email="+$('#smallemail').val()+"&tags=weekly email&linked="+$('#linked').val()+"&formtitle=News Leeter Sign-up", success: function(data){ if(data=='saved'){ //alert(221); $('#smallemail').hide(); $('#Cters').hide(); $("#sign-up-buttonsBox").html("
"); setTimeout("showsubform();",3250); } } }); return false; } }); $("#cover-type").change(function() { var src = $("option:selected", this).val(); //alert(src); window.open(src,'_self') }); $('.blurcode').hide(); $('.showcode').hide(); $('.showcode-new-deal').hide(); $('.showcode2').hide(); $(".small-thermo").bind("click", (function (event) { var clicknumb = ""; $.ajax({ type: "POST", async: false, url: "/classes/gethotclick.php", data: "camapin="+$(this).attr('id').replace("thermo-",''), success: function(data){ clicknumb = data; } }); if (clicknumb >=0 && clicknumb <=0){ $(this).css("background-position","0px 0px"); } else if(clicknumb >=1 && clicknumb <=2){ $(this).css("background-position","0px 110px"); } else{ $(this).css("background-position","0px 56px"); } return false; })); $(".voucher-box-button").bind("mouseover", (function (event) { if($(this).find("div").hasClass("open")){} else{ $(this).css("background-position","0px 310px"); } })); $(".voucher-box-button").bind("mouseleave", (function (event) { if($(this).find("div").hasClass("open")){} else{ $(this).css("background-position","0px 0px"); } //$('.showcode').hide(); })); $(".get-new-deal-code-button").bind("click", (function (event) { $(this).find(".showcode-new-deal").show().addClass("open"); var ared = $(this).attr('id'); $(this).parents('.promo-info-container').find(".showcode-new-deal ").show(); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var ared = $(this).attr('id'); var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + ared ; wind = window.open(strNewURL, "Redirect_Page", params ); //wind.focus(); //wind.blur(); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', fullscreen=yes' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); $(this).replaceWith('
' + $(this).text() + "
"); return false; })); $(".click2").unbind('click').bind("click", (function (event) { $(this).find(".showcode").show().addClass("open"); var ared = $(this).attr('id'); $(this).parents('.vouchers-container').find(".showcode").show(); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var ared = $(this).attr('id'); var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + ared ; wind = window.open(strNewURL, "_Self", params ); //wind.focus(); //wind.blur(); //$(this).replaceWith('
' + $(this).text() + "
"); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); return false; })); $(".click").unbind('click').bind("click", (function (event) { $(this).find(".showcode").show().addClass("open"); var ared = $(this).attr('id'); $(this).parents('.vouchers-container').find(".showcode").show(); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var ared = $(this).attr('id'); var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + ared ; wind = window.open(strNewURL, "_Self", params ); //wind.focus(); //wind.blur(); $(this).replaceWith('
' + $(this).text() + "
"); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); return false; })); $(".freestuff").unbind('click').bind("click", (function (event) { var strNewURL = "http://www.promocodes.co.uk/redirect_freestuff.php?id=" + $(this).attr('id'); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; wind = window.open(strNewURL, "free_stuff_"+$(this).attr('id'), params ); return false; })); $(".click-top20").bind("click", (function (event) { var ared = $(this).attr('id'); $(this).parents(".expiring-container").find(".showcode").show().addClass("get-promo-code-button2"); $(this).parents(".expiring-container").find(".get-promo-code-button").remove(); //alert($(this).parents(".expiring-container").find(".get-promo-code-button").css("background")); //$(this).find(".blurcode").show(); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + $(this).attr('id'); wind = window.open(strNewURL, "_Self", params ); // wind.focus(); //wind.blur(); $(this).replaceWith("
"+ $(this).text() + "
"); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); return false; })); $(".deal-link").unbind('click').bind("click", (function (event) { var ared = $(this).attr('id'); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=30'; params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var ared = $(this).attr('id'); var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + ared ; wind = window.open(strNewURL, "_Self", params ); //wind.focus(); //wind.blur(); //$(this).replaceWith('
' + $(this).text() + "
"); params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view_"+$(this).attr('id'), params ); return false; /* params = 'width=700'; params += ', height=800'; params += ', top=0, left=0' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL =$(this).attr('href'); wind = window.open(strNewURL, "Campain_view", params ); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=0' params += ', fullscreen=yes' params += ', scrollbars=yes'; params += ', toolbar=yes'; params += ', resizable=yes'; params += ', menubar=yes'; var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + $(this).attr('id'); wind = window.open(strNewURL, "Redirect_Page"+$(this).attr('id'), params ); */ //wind.focus(); //wind.blur(); return false; })); $(".print-Deal").bind("click", (function (event) { var ared = $(this).attr('id'); $.ajax({ type: "POST", url: "/classes/getclick.php", data: "camapin="+ared, success: function(data){ } }); params = 'width='+((screen.width / 100) * 70); params += ', height='+((screen.height / 100) * 70); params += ', top=0, left=0' params += ', fullscreen=yes' var strNewURL = "http://www.promocodes.co.uk/redirect.php?id=" + $(this).attr('id'); wind = window.open(strNewURL, "Redirect_Page", params ); //wind.focus(); // wind.blur(); return false; })); });