document.write("
"); ;(function(window) { 'use strict'; function isIOSSafari() { var userAgent; userAgent = window.navigator.userAgent; return userAgent.match(/iPad/i) || userAgent.match(/iPhone/i); }; function isTouch() { var isIETouch; isIETouch = navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; return [].indexOf.call(window, 'onclick') >= 0 || isIETouch; }; var isIOS = isIOSSafari(), clickHandler = isIOS || isTouch() ? 'click' : 'click'; function extend( a, b ) { for( var key in b ) { if( b.hasOwnProperty( key ) ) { a[key] = b[key]; } } return a; } function Animocon(el, options) { this.el = el; this.options = extend( {}, this.options ); extend( this.options, options ); this.checked = false; this.timeline = new mojs.Timeline(); for(var i = 0, len = this.options.tweens.length; i < len; ++i) { this.timeline.add(this.options.tweens[i]); } var self = this; this.el.addEventListener(clickHandler, function() { if( self.checked ) { self.options.onUnCheck(); } else { self.options.onCheck(); self.timeline.replay(); } self.checked = !self.checked; }); } Animocon.prototype.options = { tweens : [ new mojs.Burst({}) ], onCheck : function() { return false; }, onUnCheck : function() { return false; } }; function init() { var pong=document.getElementById("4"); var el2 = pong.querySelector('button.icobutton'), el2span = el2.querySelector('span'),el2counter = el2.querySelector('span.icobutton__text'); loadXMLDoc('4'); new Animocon(el2, { tweens : [ new mojs.Burst({ parent: el2, count: 6, radius: { 40 : 90 }, timeline: { delay: 300 }, children: { fill: '#C0C1C3', radius: 7, opacity: 0.6, duration: 1500, easing: mojs.easing.bezier(0.1, 1, 0.3, 1) } }), new mojs.Shape({ parent: el2, radius: {0: 50}, fill: 'transparent', stroke: '#C0C1C3', strokeWidth: {35:0}, opacity: 0.6, duration: 600, easing: mojs.easing.ease.inout }), new mojs.Tween({ duration : 1100, onUpdate: function(progress) { if(progress > 0.3) { var elasticOutProgress = mojs.easing.elastic.out(1.43*progress-0.43); el2span.style.WebkitTransform = el2span.style.transform = 'scale3d(' + elasticOutProgress + ',' + elasticOutProgress + ',1)'; } else { el2span.style.WebkitTransform = el2span.style.transform = 'scale3d(0,0,1)'; } } }) ], onCheck : function() { el2.style.color = '#988ADE'; if(Number(el2counter.innerHTML)<1000){ el2counter.innerHTML = Number(el2counter.innerHTML) + 1; } fetch('4','0'); }, onUnCheck : function() { el2.style.color = '#C0C1C3'; var current = Number(el2counter.innerHTML); if(Number(el2counter.innerHTML)<1000){ el2counter.innerHTML = current > 1 ? Number(el2counter.innerHTML) - 1 : ''; } fetch('4','1'); } }); } init(); })(window); function fetch(per,serk){ var xmlHttpReq = false; var self = this; var WriteURI = 'http://demo.scriptsez.net/rating/script.php?action=vote&vid='+per+'&sub='+serk; if (window.XMLHttpRequest) { self.xmlHttpReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP"); } self.xmlHttpReq.open('POST', WriteURI, true); self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); self.xmlHttpReq.send(''); self.xmlHttpReq.onreadystatechange = handleResponse; return false; } function loadXMLDoc(per){ var xmlhttp; var WriteURI = 'http://demo.scriptsez.net/rating/script.php?vid='+per; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("p"+per).innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST",WriteURI,true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(""); } function handleResponse() { if(xmlHttpReq.readyState == 4 && xmlHttpReq.status == 200){ var response = xmlHttpReq.responseText; if(response) { } } }