'; jQuery("body").append(script); }; this.cssChanges = function(rulesCSS){ for(var e in rulesCSS){ for (var rule in rulesCSS[e]){ jQuery(e).css(rule, rulesCSS[e][rule]); } } }; this.queueAd = function(id, codeid){ if(typeof codeid == 'undefined') codeid = id; if(this.currentAdsLoaded < this.maxAds){ this.loadQueue.push({ "id": id, "codeid": codeid}); this.currentAdsLoaded++; } }; this.init = function(options, width, height, disableSuperiorAd, cb){ if(typeof options.width !== 'undefined'){ this.gameSize["width"] = options.width; } if(typeof options.height !== 'undefined'){ this.gameSize["height"] = options.height; } if(typeof options.showSuperiorAd !== 'undefined'){ this.superiorAdDisabled = !options.showSuperiorAd; } if(typeof options.showFatAd !== 'undefined'){ this.showFatAd = options.showFatAd; } if(typeof options.adsense_data !== 'undefined'){ this.adCode = options.adsense_data; } /*if(location.hash.match(new RegExp(/sandbox/))){ this.sandboxMode = true; }*/ if(typeof options.sandboxMode !== 'undefined'){ this.sandboxMode = true; } if(!this.superiorAdDisabled){ this.queueAd("ad_unit_slot1"); } this.loadedAds = this.howManyHAds("adsense"); var changeValues = {}; switch(this.loadedAds){ case 2: if(this.sandboxMode){ if(this.showFatAd && this.sideAdsSelected.size == 300+155 + 160 + 155 && $(window).width() >= 1300){ this.queueAd("ad_unit_slot3_big", "fixed300x600"); this.queueAd("ad_unit_slot4"); var separacion = 300+150; var separacion2 = 300+30; }else if( $(window).width() >= 1159){ this.queueAd("ad_unit_slot3", "fixed160x600"); this.queueAd("ad_unit_slot4"); var separacion = 160+150; var separacion2 = 160+30; } changeValues = { ".game_cnt" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size), "margin-left" : 0 }, ".game_title" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title h1" : { "margin-left" : 30 }, ".game_itself" : { "margin-left" : separacion }, ".titled_area" : { "margin-left" : separacion }, "#ad_unit_slot3_big" :{ "left" : 0, "position" : "fixed", "top" : 65 }, "#ad_unit_slot3" :{ "left" : 0, "position" : "fixed", "top" : 65 }, ".juegoextras" :{ "margin-left" : separacion2 }, "#ad_unit_slot2" :{ "margin-left" : separacion2 }, "#ad_unit_slot4" :{ "right" : 0, "left" : "auto" }, ".relacionados" :{ "margin-left" : separacion2, } }; }else{ if(this.showFatAd && this.sideAdsSelected.size == 300+155 + 160 + 155){ this.queueAd("ad_unit_slot3_big"); this.queueAd("ad_unit_slot4"); }else{ this.queueAd("ad_unit_slot3"); this.queueAd("ad_unit_slot4"); } changeValues = { ".game_cnt" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title h1" : { "margin-right" : 300 } }; } /* if(this.sandboxMode && window.screen.width >= 1254){ changeValues["#ad_unit_slot2"] = { "margin-left" : 240 }; changeValues["#ad_unit_slot4"] = { "position" : "fixed", "top" : "65px", "left" : "2px" }; changeValues[".juegoextras"] = { "margin-left" : 220 }; console.log("wuuuut"); }*/ //jQuery(".relacionados").addClass("twosideads"); break; case 1: if(this.sandboxMode){ if(this.showFatAd && this.sideAdsSelected.size == 300+155 && $(window).width() >= 1300){ this.queueAd("ad_unit_slot3_big", "fixed300x600"); var separacion = 300+150; var separacion2 = 300+30; }else if( $(window).width() >= 1159){ this.queueAd("ad_unit_slot3", "fixed160x600"); var separacion = 160+150; var separacion2 = 160+30; } changeValues = { ".game_cnt" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size), "margin-left" : 0 }, ".game_title" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title h1" : { "margin-left" : 30 }, ".game_itself" : { "margin-left" : separacion }, ".titled_area" : { "margin-right" : 0 }, "#ad_unit_slot3_big" :{ "left" : 0, "position" : "fixed", "top" : 65 }, "#ad_unit_slot3" :{ "left" : 0, "position" : "fixed", "top" : 65 }, ".juegoextras" :{ "margin-left" : separacion2 }, "#ad_unit_slot2" :{ "margin-left" : separacion2 }, ".relacionados" :{ "margin-left" : separacion2 } }; }else{ if(this.showFatAd && this.sideAdsSelected.size == 300+155){ this.queueAd("ad_unit_slot3_big"); }else{ this.queueAd("ad_unit_slot3"); } changeValues = { ".game_cnt" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title" : { "width" : this.gameSize["width"] + (this.sideAdsSelected.size) }, ".game_title h1" : { "margin-left" : 30 }, ".game_itself" : { "margin-left" : 0 }, ".titled_area" : { "margin-left" : 0 } }; } //jQuery(".relacionados").addClass("onesideads"); break; case 0: changeValues = { ".game_cnt" : { "width" : this.gameSize["width"] }, ".game_title" : { "width" : this.gameSize["width"] }, ".game_title h1" : { "margin-left" : 30 } }; // jQuery(".relacionados").addClass("nosideads"); break; } if(!this.sandboxMode){ if(typeof this.sideAdsSelected.left != 'undefined'){ if(typeof changeValues['.game_itself'] == 'undefined'){ changeValues['.game_itself'] = {}; } changeValues['.game_itself']['margin-left'] = this.sideAdsSelected.left; } if(typeof this.sideAdsSelected.right != 'undefined'){ if(typeof changeValues['.game_itself'] == 'undefined'){ changeValues['.game_itself'] = {}; } changeValues['.game_itself']['margin-right'] = this.sideAdsSelected.right; } } this.cssChanges(changeValues); var rel = $(".relacionados"); var gamecnt = $(".game_cnt"); setTimeout(jQuery.proxy(function(){ if(this.loadedAds>1){ rel.css("width", (this.gameSize["width"]+200) +"px"); rel.css("margin-left", ($(".game_itself").offset().left - 100) + "px"); }else{ rel.css("width", (this.gameSize["width"]+100) *0.95 +"px"); if(!this.sandboxMode){ rel.css("margin-left", ($(".game_itself").offset().left ) + "px"); } } }, this), 100); this.queueAd("ad_unit_slot1"); if(this.currentAdsLoaded < this.maxAds){ this.queueAd("ad_unit_slot2"); } this.queueAd("ad_unit_slot5"); if(typeof cb != 'undefined') cb(); }; }; var BaitScroller = function(){ this.selectors = { visibleLayer : $(".bait"), fullLayer : $(".dptc") }; this.status = "auto"; this.config = { visibleHeight : this.selectors.visibleLayer.height(), totalHeight : this.selectors.fullLayer.height() }; this.intervals = { up : null, down : null }; this.init = function(){ this.bindNavigation(); /* if(this.config.totalHeight > this.config.visibleHeight){ var t = setTimeout($.proxy(function(){ if(this.status == "auto"){ this.scrollDown(); } },this), 20000); }*/ }; this.stopIntervals = function(){ if(this.up){ clearInterval(this.up); this.up = null; } if(this.down){ clearInterval(this.down); this.down = null; } }; this.bindNavigation = function(){ this.selectors.visibleLayer.on("mouseenter", $.proxy(function(e){ var offset = this.selectors.visibleLayer.offset(); if(offset.left < 0){ $(".game_cnt").css("left", (offset.left*-1)+"px"); } clearInterval(this.up); clearInterval(this.down); },this)); this.selectors.visibleLayer.on("mouseover", $.proxy(function(e){ var offset = this.selectors.visibleLayer.offset(); var y = e.pageY - offset.top; if(y < 50){ if(this.status == "auto"){ this.scrollUp(1000); this.status = "manual"; } }else if(y > (this.config.visibleHeight - 50)){ if(this.status == "auto"){ this.scrollDown(1000); this.status = "manual"; } }else{ this.status = "auto"; clearInterval(this.up); clearInterval(this.down); } },this)); this.selectors.visibleLayer.on("mouseleave", $.proxy(function(e){ $(".game_cnt").css("left", "0px"); this.status = "auto"; clearInterval(this.up); clearInterval(this.down); },this)); }; this.scrollDown = function(mode){ if(this.status == "auto"){ this.goDown(); var mode = ((typeof mode != "undefined") ? mode : 15000); this.down = setInterval($.proxy(function(){ this.goDown(); },this), mode); } }; this.scrollUp = function(mode){ if(this.status == "auto"){ this.goUp(); var mode = ((typeof mode != "undefined") ? mode : 15000); this.up = setInterval($.proxy(function(){ this.goUp(); },this), mode); } }; this.goDown = function(){ var top = parseFloat(this.selectors.fullLayer.css("top").replace("px", "")); if((top*-1) > (this.config.totalHeight - this.config.visibleHeight)){ clearInterval(this.down); if(this.status == "auto"){ this.stopIntervals(); var t = setTimeout($.proxy(function(){ this.scrollUp(); }, this), 18000); } return; } this.selectors.fullLayer.css("top", (top - 65)+"px"); }; this.goUp = function(){ var top = parseFloat(this.selectors.fullLayer.css("top").replace("px", "")); if((top*-1) <= 0){ clearInterval(this.up); if(this.status == "auto"){ this.stopIntervals(); var t = setTimeout($.proxy(function(){ this.scrollDown(); }, this), 18000); } return; } this.selectors.fullLayer.css("top", (top + 65)+"px"); }; }; var RelacionadosScroller = function(){ this.totalElements = null; this.cursor = 0; this.scroll = $(".relg-scroll"); this.wrapper = $(".relwrp"); this.topdiv = $(".relacionados"); this.thumbWidth = null; this.width = null; this.busy = false; this.init = function(wrapper, scrollLeft, scrollRight){ if(!this.totalElements){ this.maxpages = 2; }else{ this.maxpages = Math.ceil(this.totalElements / this.elementsPerPage); } var wrapper = $(wrapper); wrapper.on("click", scrollLeft, jQuery.proxy(this.prev, this)); wrapper.on("click", scrollRight, jQuery.proxy(function(){ this.next(false); }, this)); }; this.notBusyAnymore = function(){ setTimeout(jQuery.proxy(function(){ this.busy = false; },this), 400); }; this.gamesInScreen = function(){ return Math.floor(this.width / this.thumbWidth); }; this.deleteCache = function(){ this.thumbWidth = null; this.width = null; this.totalElements = null; }; this.resetCursor = function(reverse){ if(!reverse){ this.wrapper.css("left", "0px"); this.cursor = 0; }else{ this.cacheData(); this.cursor = this.totalElements - this.gamesInScreen(); var moveTo = "-" +(this.cursor * this.thumbWidth)+"px"; this.wrapper.css("left", moveTo); } } this.cacheData = function(){ if(!this.thumbWidth) this.thumbWidth = this.wrapper.children().first().outerWidth(true); if(!this.width) this.width = this.scroll.width(); if(!this.totalElements) this.totalElements = this.wrapper.find("li").size(); }; this.next = function(reverse){ if(typeof reverse == 'undefined') reverse = false; if(this.busy) return; this.cacheData(); this.busy = true; var decimalGamesInScreen = this.width / this.thumbWidth; var gamesInScreen = Math.floor(decimalGamesInScreen); if(!reverse){ var totalThumbsLeft = this.totalElements - gamesInScreen - Math.ceil(this.cursor); }else{ var totalThumbsLeft = Math.ceil(this.cursor); } if(totalThumbsLeft == 0){ this.resetCursor(reverse); }else{ if(totalThumbsLeft >= gamesInScreen){ var thumbsToMove = gamesInScreen; } else { var resto = decimalGamesInScreen-gamesInScreen; if(resto>0){ var thumbsToMove = (totalThumbsLeft-1) + (1-resto); }else{ var thumbsToMove = totalThumbsLeft; } } var widthToMove = thumbsToMove * this.thumbWidth; var widthMovedAlready = this.cursor * this.thumbWidth; if(!reverse){ var moveTo = "-" + (widthToMove+widthMovedAlready) +"px"; }else{ var moveTo = "-" + (widthMovedAlready - widthToMove) +"px"; } this.wrapper.css("left", moveTo); if(!reverse){ this.cursor = this.cursor + thumbsToMove; }else{ this.cursor = this.cursor - thumbsToMove; } } this.notBusyAnymore(); }; this.prev = function(){ this.next(true); }; this.expand = function(){ if(GameAdsSettings.howManyHAds("adsense") > 0){ var adBig = $("#ad_unit_slot3_big"); var bigH = ((adBig.css("display") == "none") ? 0 : adBig.height()); var adSmall = $("#ad_unit_slot3"); var smallH = ((adSmall.css("display") == "none") ? 0 : adSmall.height()); var ad3 =null; if(bigH > 500){ ad3 = $("#ad_unit_slot3_big"); } if(smallH > 500){ ad3 = $("#ad_unit_slot3"); } if(ad3.offset().top + 600 < this.scroll.offset().top){ if(!this.topdiv.hasClass("expand")){ this.topdiv.addClass("expand"); } }else{ if(this.topdiv.hasClass("expand")){ this.topdiv.removeClass("expand"); } } } }; }; var waitForFinalEvent = (function () { var timers = {}; return function (callback, ms, uniqueId) { if (!uniqueId) { uniqueId = "Don't call this twice without a uniqueId"; } if (timers[uniqueId]) { clearTimeout (timers[uniqueId]); } timers[uniqueId] = setTimeout(callback, ms); }; })(); function maximizeIframe(){ $("body").on("mouseover", "iframe:#flashobj",function(e){ var game = $("iframe:#flashobj"); if(typeof window.gameData == "undefined"){ window.gameData = { height: game.height(), width: game.width() }; } clearTimeout(window.autofulliframe); window.autofulliframe = setTimeout(function(){ var alturacabecera = $(".cc").height()+2; var altura = $(window).height() - alturacabecera; $("iframe:#flashobj").css("position", "fixed").css("width", "100%").css("height", altura+"px").css("top", alturacabecera+"px").css("left", 0); $(".juegoextras").hide(); }, 6000); }).on("mouseout", "iframe:#flashobj",function(e){ clearTimeout(window.autofulliframe); window.autofulliframe = setTimeout(function(){ $("iframe:#flashobj").css("position", "relative").css("width", window.gameData.width+"px").css("height", window.gameData.height+"px").css("top", 0); $(".juegoextras").show(); }, 2000); }); if(typeof window.navScroller != "undefined"){ window.navScroller.config.delay = 1500; } }; var FullScreener = function(){ this.toggler = $("#autoexpand-gm"); this.busy = false; this.afterMaximizeCallback = null; this.everythingWrapped = $(".game_cnt"); this.augmentableElements = { "game_cnt" : jQuery(".game_cnt"), "titled_area" : jQuery(".titled_area"), "game_itself" : jQuery(".game_itself") }; this.augmented = null; this.resizeFrameDivs = function(augmentation){ for(var x in this.augmentableElements){ var getWith = this.augmentableElements[x].width(); this.augmentableElements[x].css("width", (getWith + augmentation) + "px"); } }; this.resizeOriginal = function(){ var flashobj = $("#flashobj"); if(this.originals.width < flashobj.width()){ this.minimizeTransition(this.originals.width, this.originals.height, this.originals.width - flashobj.width()); }else{ this.maximizeTransition(this.originals.width, this.originals.height, flashobj.width()-this.originals.width); } }; this.resize = function(autoresize){ if(this.preloadingAds()) return; if(this.busy) return; this.busy = true; var augment = this.calculateWidthIncrement(); this.flashobject = $("#flashobj"); var flashWidth = this.flashobject.width(); if(typeof autoresize == 'undefined'){ this.originals = {width: flashWidth,height: this.flashobject.height()}; } var aspect_ratio = this.flashobject.height() / flashWidth ; if(!this.flashobject.hasClass("loaded")){ this.flashobject.addClass("loaded"); } $(window).scrollTop(this.augmentableElements["game_cnt"].offset().top-70); var maximumHeight = $(window).height() - $(".cc").height() - $(".titled_area").height(); var newWidth = flashWidth + augment; var newHeight = aspect_ratio * newWidth; // comprobar que el height entre en maximized if(maximumHeight < newHeight){ var aspect_ratio_h = flashWidth / this.flashobject.height(); var newHeight = maximumHeight; var newWidth = aspect_ratio_h * maximumHeight; var augment = newWidth - flashWidth; } if(augment<0){ if(this.originals && newWidth < this.originals.width){ this.minimizeTransition(this.originals.width, this.originals.height, this.originals.width - this.flashobject.width()); }else{ this.minimizeTransition(newWidth, newHeight, augment); } }else{ this.maximizeTransition(newWidth, newHeight, augment); } this.augmentableElements["game_itself"].css("height", newHeight); if(this.afterMaximizeCallback){ setTimeout(jQuery.proxy(function(){ this.afterMaximizeCallback(); },this),1000); } }; this.maximizeTransition = function(newWidth, newHeight, augment){ this.resizeFrameDivs(augment); setTimeout(jQuery.proxy(function(){ this.resizeFlash(newWidth, newHeight); setTimeout(jQuery.proxy(function(){ setTimeout(jQuery.proxy(function(){ relacionadosScroller.expand(); this.busy = false; },this),1500); },this),1000); },this),1500); }; this.minimizeTransition = function(newWidth, newHeight, augment){ this.resizeFlash(newWidth, newHeight); this.resizeFrameDivs(augment); setTimeout(jQuery.proxy(function(){ this.augmentableElements["game_itself"].height(newHeight); setTimeout(jQuery.proxy(function(){ relacionadosScroller.expand(); this.busy = false; },this),1500); },this),1000); }; this.resizeFlash = function(width, height){ this.flashobject.css("height", height).css("width", width + "px"); this.flashobject.attr("width", width).attr("height", height); }; this.preloadingAds = function(){ if(typeof showpubli !=='undefined'){ return showpubli.ads_running; }else{ return false; } }; this.calculateWidthIncrement = function(){ if(GameAdsSettings.howManyHAds("adsense") == 0){ return $(window).width()-30 - (this.augmentableElements.game_cnt.width() + 110); }else{ return $(window).width()-30 - (this.augmentableElements.game_cnt.width()); } }; this.setupAnimations = function(){ var b = $("body"); if(!b.hasClass("resizing")){ b.addClass("resizing"); } }; this.disableAnimations = function(){ var b = $("body"); if(b.hasClass("resizing")){ b.removeClass("resizing"); } }; this.init = function(afterMaximizeCallback){ this.toggler.on("click", jQuery.proxy(function(){ if(this.busy) return; if(this.preloadingAds()) return; if(!this.toggler.hasClass("toggled")){ this.setupAnimations(); this.toggler.addClass("toggled"); this.resize(); }else{ this.toggler.removeClass("toggled"); this.resizeOriginal(); } },this)); if(typeof afterMaximizeCallback != 'undefined') this.afterMaximizeCallback = afterMaximizeCallback; }; }; function loadRecommended(delay){ var d = delay || 7000; setTimeout(function(){ $.get("./", {recomendados : 1},function(datos){ if(datos.success){ $("#ajxrcm").html(datos.data).promise().done(function(){ centralesRebind(".jpg"); $(".juegoextras #rcmd").slick({ accessibility: false, touchMove: false, slidesToShow: 1, slidesToScroll: 1 }); }); } }); }, d); }; jQl.ready(function(){ if(window.autoMaximizedGame){ maximizeIframe(); } $(".tjpanl").qtip({ style: { classes: 'qtip-bootstrap' }, position: { my: 'center left', at: 'center right', viewport: $(window) }, show: { effect: function(offset){ $(this).slideDown({duration:50,easing: "easeOutBounce"}); } } }); loadRecommended(); var baitScroller = new BaitScroller(); baitScroller.init(); $(".pestana_comments").click(function(){ $(".pestana_comments_active").removeClass("pestana_comments_active"); $(this).addClass("pestana_comments_active"); }); $("#commentwith_macro").click(function(){ $(".zona_comentarios").removeClass("mostrar_gplus").removeClass("mostrar_fb").addClass("mostrar_macro"); }); $("#commentwith_google").click(function(){ $(".zona_comentarios").removeClass("mostrar_macro").removeClass("mostrar_fb").addClass("mostrar_gplus"); var po = document.createElement('script'); po.type = 'text/javascript'; po.async = false; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); var g = $("#gplus_comments"); g.html('
'); }); $("#commentwith_facebook").click(function(){ $(".zona_comentarios").removeClass("mostrar_gplus").removeClass("mostrar_macro").addClass("mostrar_fb"); window.FBTIMER = setInterval(function(){ if(typeof FB != 'undefined'){ FB.XFBML.parse(); clearInterval(FBTIMER); } }, 3000); }); cargarComentarios(); cargarUltimosVisitantes(); $("#game_fav").click(function(){ addfavoritos($(this).attr("data-href")); }); $("#trigger_like").click(function(){ likegame($(this).attr("data-href"),1); }); $("#trigger_dislike").click(function(){ likegame($(this).attr("data-href"),-1); }); $('#night_mode').click(function(){ var shadow=$('#shadow'); shadow.css('height', $(document).height()); if(shadow.css('display') == 'none'){ shadow.show(); }else{ shadow.hide(); } $(this).toggleClass("toggled"); }); $(".pestana_comments_active").click(); });
Anúncio
Anúncio
Anúncio

Body Doctor Little Hero


Carregando ...

Um momento, por favor ...

Você deve saber que o Adobe Flash Player é constantemente atualizado, os jogos podem não funcionar corretamente se você não atualizar a sua versão do Adobe Flash Player.

Baixe a nova versão de Flash Player a partir do site oficial

Anúncio
Anúncio

New Games - The latest developments

Facebook
Body Doctor Little Hero
Votos: 0 - Rating: 2.5 (1-5)

Body Doctor Little Hero


Últimos visitantes
Deixe um comentário usando sua rede social favorita

Copyright (c) 2005-2024 | www.microjogos.com | Política de Privacidade, Termos de uso e as questões jurídicas