var currs = ["", "", "", "", ""]; var stats = ["views", "visitors", "pages", "time", "countries"]; var words = ['Monthly Impressions', 'Monthly Unique Visitors', 'average pages visited', 'spent in the Icepique network', 'Countries']; var expla = ['The potential for the explosure of your campaign', 'Potential future customers', 'Optimal opportunity for interaction', 'Time to win a new client', 'For global exposure']; var m = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,6}(\.[a-z]{2}){0,2})$/i; $(document).ready(function() { $("#menu img").hover(function() { if ($(this).attr("rel") !== "on") { $(this).attr("src", $(this).attr("src").replace("off", "over")); } }, function() { if ($(this).attr("rel") !== "on") { $(this).attr("src", $(this).attr("src").replace("over", "off")); } }); $(".key_point").click(function() { window.location.href = $(this).attr("rel")+".html"; }); $("select#site").change(function() { var pathname = window.location.pathname; if($(this).attr("value") !== "") { window.location.href = pathname+"?site="+$(this).attr("value"); } }); $('#slider').anythingSlider({ easing: "easeInOutExpo", autoPlay: false, delay: 3000, startStopped: false, animationTime: 600, hashTags: true, buildNavigation: true, pauseOnHover: true, startText: "СТАРТ", stopText: "СПРИ", navigationFormatter: formatText }); $("#slide-jump").click(function(){ $('#slider').anythingSlider(6); }); }); function formatText(index, panel) { return index + ""; } function setStat(state) { if (state == "next") { if (curr < stats.length-1) { curr++; } else { curr = 0; } } else { if (curr > 0) { curr--; } else { curr = stats.length-1; } } $('#stat_sub').html(expla[curr]); $('#stat_title').html(currs[curr]+" "+words[curr]); $('#stat_desc p').html($('#stat_explain_'+curr).html()); $('#stat_icon img').attr("src", "images/"+stats[curr]+".gif"); $('#stats_plate').attr("src", "stats.php?type="+stats[curr]); } function verifyContact() { if ($('input[name=name]').val() == "") { $('#pointer1').attr("src", "images/report.gif"); alert("Please, fill in your name in the field above."); $('input[name=name]').focus(); return false; } else if (m.test($('input[name=email]').val()) == false) { $('#pointer2').attr("src", "images/report.gif"); alert("Please, fill in your email address."); $('input[name=email]').focus(); return false; } else if ($('textarea[name=comments]').val().length < 10) { $('#pointer3').attr("src", "images/report.gif"); alert("Please, enter your question in the box above."); $('textarea[name=comments]').focus(); return false; } else if ($('input[name=captcha]').val() == "") { $('#pointer1').attr("src", "images/report.gif"); alert("Please, fill in the captcha code you see in the picture above."); $('input[name=captcha]').focus(); return false; } else { document.contact.submit(); return true; } } function unclear(which) { $('#'+which).attr("src", "images/space.gif"); }