var dateExpirePersistentCookies=new Date().setTime(new Date()+(30*24*60*60*1000));(function(a){a.fn.extend({min:function(c){var b=null;this.each(function(){var d=jQuery(this);if(b==null||c.compare(d,b,c)<0){b=d}});return b}})})(jQuery);function redirection(a){jQuery(document).ready(function(){document.location.href=a});setTimeout("document.location.href='"+a+"';",3000)}function RedirectTimezone(){jQuery(document).ready(function(){if(!(document.location.href.indexOf("TimeZoneUTCOffset")>0)&&!jQuery.cookie("TimeZone")&&!jQuery.cookie("TimeZoneUTCOffset")){var a=-1*new Date().getTimezoneOffset()/60;jQuery.cookie("TimeZoneUTCOffset",a,{path:"/"});jQuery("a").each(function(){var b=this["href"];if(b&&b.indexOf("http://")<0&&b.indexOf("javascript")<0&&b.indexOf("(")<0){b=b+(b.indexOf("?")>=0?"&":"?")+"TimeZoneUTCOffset="+a;this["href"]=b}})}})}function launchSearch(c,j,a,e,d,h,f){var i=URLEncode(jQuery("#"+c).val());if(i){var g="?";if(j.indexOf("?")>=0){g="&"}var b=j+g;if(a){b+="DId="+a+"&"}if(e){b+="DId2="+e+"&"}if(d){b+="DId3="+d+"&"}if(h){b+="InviteUserId="+h+"&"}document.location.href=b+"QueryType="+URLEncode(f)+"&Query="+i}return false}function registerHelp(a,b){var d=jQuery("#"+a);var c=jQuery("#"+b);d.focus(function(){c.show()});d.blur(function(){setTimeout(function(){c.hide()},100)})}function requireIdentification(){if(IdentificationId){return true}if(confirm("You need to be registered and log in to do this. Do you want to sign up now?")){document.location.href="/Y/SignUp/"}return false}function getTrackingUrl(a,c,b){c=c.replace("{0}",b);return a.replace("{0}",c).replace("{1}",URLEncode(c))}var haveFBVar=false;var haveFBInitialized=false;function haveFB(){return haveFBVar}function havePublished(){return jQuery.cookie("havePublishedFeed")}function setHavePublished(){return jQuery.cookie("havePublishedFeed","1",{path:"/",expires:new Date().setTime(new Date()+(24*60*60*1000))})}function initFB(){if(!haveFB()){haveFBVar=true;window.fbAsyncInit=function(){FB.init({appId:fbConnectAppId,status:true,cookie:true,xfbml:true});haveFBInitialized=true;processWaitFB()};(function(){var b=document.createElement("script");b.async=true;b.src="//connect.facebook.net/en_US/all.js";var a=document.getElementById("fb-root");if(a!=null){a.appendChild(b)}}())}}var waitFBCallbacks=new Array();function waitFB(a){if(a){waitFBCallbacks.push(a)}processWaitFB()}function processWaitFB(){if(haveFBInitialized){var a;while(a=waitFBCallbacks.pop()){a()}}}function retrieveExternals(){initFB();waitFB(function(){var a=new Array();jQuery(".External_FACEBOOK").each(function(){var b=getObjClassId(this);if(!a[b]){a[b]=true;FB.api("/"+b,function(c){jQuery(".External_FACEBOOK.Id_"+c.id+".ExternalName").text(c.name);jQuery(".External_FACEBOOK.Id_"+c.id+".ExternalPicSquare").attr("src","http://graph.facebook.com/"+c.id+"/picture")})}})})}var currentUserUid;var currentUserUidCallbacks;function getCurrentUserUid(b){if(currentUserUid){b(currentUserUid);return}var a=false;if(!currentUserUidCallbacks){currentUserUidCallbacks=new Observer;a=true}currentUserUidCallbacks.subscribe(b);if(a){initFB();waitFB(function(){FB.login(function(c){currentUserUid=c.session.uid;currentUserUidCallbacks.fire(currentUserUid);currentUserUidCallbacks=null})})}}var friendsFB=null;function feedPublishRandomFriend(a,b,e,d,i,g,c,h,f){waitFB(function(){if(friendsFB==null){getCurrentUserUid(function(j){var k=FB.Data.query("SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1={0})",j);k.wait(function(m){friendsFB=new Array();for(var l=0;l<m.length;l++){friendsFB.push(m[l].uid)}a(b,e,getRandomFriend(),d,i,g,c,h,f)})})}else{a(b,e,getRandomFriend(),d,i,g,c,h,f)}})}function getRandomFriend(){if(friendsFB!=null&&friendsFB.length>0){return friendsFB[Math.round(Math.random()*friendsFB.length*10)%friendsFB.length]}return null}function feedPublishDialog(a,d,j,c,i,g,b,h){return;if(haveFB()){if(h||!havePublished()){var f=new Object();f.value=b;var e=j?[j]:null;FB.ui({method:"stream.publish",message:b,attachment:{name:"Connect",caption:"The Facebook Connect JavaScript SDK",href:"http://github.com/facebook/connect-js"},action_links:[{text:"Code",href:"http://github.com/facebook/connect-js"}],user_prompt_message:"Share your thoughts about Connect"},function(k){});FB.Connect.showFeedDialog(a,d,e,c,null,FB.RequireConnect.promptConnect,function(){if(i){i(result)}SafeTrackEvent("facebook-actions","publish-showFeedDialog-random","userId: "+UserId+";");return},g,f)}}}function feedPublishSilent(a,d,i,c,h,f,b,g,e){return;if(haveFB()){if(g||!havePublished()){requestPermission("publish_stream",function(j){setHavePublished();if(j){var k=FB.Facebook.apiClient;k.friends_getAppUsers(function(l){if(!l){l=i?[i]:null}k.feed_publishUserAction(a,d,l,c,2,b,function(m,n){if(h){h(m)}SafeTrackEvent("facebook-actions","publish-feed_publishUserAction","userId: "+UserId+";")})})}else{if(e){feedPublishDialog(a,d,i,c,h,f,b,true)}}})}}}function requestPermission(a,b){waitFB(function(){FB.login(function(c){if(b){b(result)}},{perms:a})})}function fbGetInfosByUid(b,c){if(c){for(var a=0;a<c.length;a++){if(c[a].uid==b){return c[a]}}}return null}function getPageArticles(){var b=new Array();var a=0;jQuery(".articleBox").each(function(){var f=new Object();var e=jQuery(this);var d=e.find("a").attr("href");d=d.startsWith("http://")?d:"http://beterz.com/"+d;var c=e.find("img").attr("src");c=c.startsWith("http://")?c:"http://beterz.com/"+c;b[a]=f;a++});if(b.length==0){b[0]={href:"http://beterz.com/Y/LogIn/FBConnect/",img:"http://beterz.com/Images/Logo.png"}}return b}var toggledBoxes=new Array();function toggleBox(f,b){var e=jQuery(b);var c=jQuery(f);var d=e.closest("div");var a=!c.is(":visible");if(a){c.slideDown("fast",function(){d.find(".show").hide();d.find(".hide").show()})}else{c.slideUp("fast",function(){d.find(".show").show();d.find(".hide").hide()})}toggleBoxSave(f,a);return false}function toggleBoxSave(c,b){var a=(b!="hide"&&b)?1:0;toggledBoxes[c]=a;jQuery.cookie("toggledBoxes",ToQueryString(toggledBoxes))}function toggleBoxRestore(){toggledBoxes=FromQueryString(jQuery.cookie("toggledBoxes"));for(var a in toggledBoxes){if(toggledBoxes[a]>0){jQuery(a).parent().find(".show").click()}}}var expand=new Array();function expandSmallReply(a){if(IdentificationId){if(!expand[a.id]){expand[a.id]=true;jQuery("#"+a.id+"_li .inputButton").removeClass("replyInvisible");jQuery("#"+a.id).autogrow({})}}else{document.location.href="/Y/SignUp/"}}function reduceSmallReply(a){if(jQuery("#"+a.id).val()==""){expand[a.id]=false;jQuery("#"+a.id+"_li .inputButton").addClass("replyInvisible")}}function setVisibleTab(c,b,a){jQuery("#"+c+" .tabs li").removeClass("active");jQuery("#"+c+" .tabsPanel>div").each(function(){this.style.display="none"});jQuery("#"+b).addClass("active");jQuery("#"+a).fadeIn("fast");SafeTrackEvent("tab-change","set-tab-in-"+c,"tab: "+b+";")}parameterValueFromClassIdClicked=false;function setParameterValueFromClassId(d,a,b,g,f){parameterValueFromClassIdClicked=true;var c=jQuery(d);var e=getObjClassId(d);setHashValue(a,e);createGetToPostHiddenFields(b,jQuery("input[name='PostBackKey']").closest("span"));jQuery("input[name='"+a+"']").val(e);if(g){window.scroll(0,0)}if(f){return f(d,a,b,g)}return true}function restoreLinkButtonClickFromHash(hashParameterName,jContainer,clickAll){var id=getHashValue(hashParameterName);if(id){var elements;if(clickAll){elements=jContainer.find("a")}else{elements=jContainer.find(".Id_"+id)}elements.each(function(){var jThis=jQuery(this);var href=jThis.attr("href");jThis.click();eval(href);return})}}function setPercentValue(c,b){b=Math.round(b);b=Math.max(b,0);b=Math.min(b,100);var a=c.find(".percentValue");a.html(b+"%");a.animate({width:b+"%"},2000)}function updateStatus(){var a=jQuery("#status").val();if(IdentificationId){TGB.WebServices.BeterZ.UserWebService.SetStatus(IdentificationId,a,function(b){if(b){highlightParentsAndDescendants(jQuery("#updateStatus").get(0))}},function(b){});SafeTrackEvent("update-status","update-status",a)}return false}function highlightMarked(b,a){jQuery.each(a.get_panelsUpdated(),function(){highlightParentsAndDescendants(this)})}function highlightParentsAndDescendants(a){if(a&&a.id){jQuery.each(jQuery(".highlightThis:has(#"+a.id+")"),function(){highlight(this)});jQuery.each(jQuery("#"+a.id+" .highlightThis"),function(){highlight(this)})}}function highlight(a){if(a&&a.id){setTimeout("jQuery('#"+a.id+"').addClass('highlight');jQuery('#"+a.id+"').removeClass('noHighlight');",0);setTimeout("jQuery('#"+a.id+"').addClass('noHighlight');jQuery('#"+a.id+"').removeClass('highlight');",100);setTimeout("jQuery('#"+a.id+"').addClass('highlight');jQuery('#"+a.id+"').removeClass('noHighlight');",200);setTimeout("jQuery('#"+a.id+"').addClass('noHighlight');jQuery('#"+a.id+"').removeClass('highlight');",300);setTimeout("jQuery('#"+a.id+"').addClass('highlight');jQuery('#"+a.id+"').removeClass('noHighlight');",400);setTimeout("jQuery('#"+a.id+"').addClass('noHighlight');jQuery('#"+a.id+"').removeClass('highlight');",500)}}function activeParentsAndDescendants(a){if(a&&a.id){jQuery(".activeThis:has(#"+a.id+")").addClass("active");jQuery("#"+a.id+" .activeThis").addClass("active")}}function desactiveParentsAndDescendants(a){if(a&&a.id){jQuery(".activeThis:has(#"+a.id+")").removeClass("active");jQuery("#"+a.id+" .activeThis").removeClass("active")}}function imgRollover(a){jQuery(a).each(function(){jQuery(this).hover(function(){jQuery(this).attr("src",jQuery(this).attr("src").replace("-off","-on"))},function(){jQuery(this).attr("src",jQuery(this).attr("src").replace("-on","-off"))})})}var slidingElements=new Array();var filledElements=new Array();function slide(callingImage,imgSrcUp,imgSrcDown,imgSrcWait,webService,webMethod,webMethodParameters){var divId=callingImage.id+"_div";if(!slidingElements[callingImage.id]){slidingElements[callingImage.id]="up"}switch(slidingElements[callingImage.id]){case"down":jQuery("#"+divId).slideUp("normal",function(){callingImage.src=imgSrcUp;slidingElements[callingImage.id]="up";desactiveParentsAndDescendants(jQuery("#"+divId).get(0))});break;default:var context=new Array(callingImage,divId,imgSrcUp,imgSrcDown);if(filledElements[divId]){SlideDownHTML("",context)}else{eval(webService+"."+webMethod+"("+webMethodParameters+",SlideSuccededCallback,SlideFailedCallback,context)");callingImage.src=imgSrcWait;slidingElements[callingImage.id]="down";SafeTrackEvent("webservice-call",webService+"."+webMethod,"fromImage: "+callingImage.id+";")}break}}function SlideSuccededCallback(a,f){if(!a){a="Nothing :("}var h=f[0];var b=f[1];var g=f[2];var e=f[3];var d="";if(a.length&&typeof(a)=="object"){d="<ul>";for(var c=0;c<a.length;c++){d+="<li>"+a[c]+"</li>"}d+="</ul>"}else{d=a}filledElements[b]=true;SlideDownHTML(d,f);initCommonThings()}function SlideFailedCallback(a,b){html="Sorry, an error occured. Please check your network connection a try again. The returned error was: "+a.get_message();SlideDownHTML(html,b)}function SlideDownHTML(d,c){var f=c[0];var a=c[1];var e=c[2];var b=c[3];if(d){jQuery("#"+a).html(d)}jQuery("#"+a).slideDown("fast",function(){f.src=b;slidingElements[f.id]="down";activeParentsAndDescendants(jQuery("#"+a).get(0))})}var sports;function initSports(b){var a={SessionKey:IdentificationId,Locale:Locale};TGB.WebServices.BeterZ.Public.v1_0.PublicWebService.GetSports(a,function(c){sports=c.Sports;if(b){b()}},function(c){debug(c.get_message());if(b){b()}})}function getSportsName(c){var b="";if(c){for(var a=0;a<c.length;a++){if(b){b+=", "}b+=getSport(c[a]).Name}}return b}function getSport(a){for(var b=0;b<sports.length;b++){if(sports[b].Id==a){return sports[b]}}}var followedThings=new Array();var followedEvents,followedPersons;function preInitFollowing(){if(IdentificationId){followedEvents=jQuery.cookie("followedEvents"+hex_sha1(IdentificationId));followedPersons=jQuery.cookie("followedPersons"+hex_sha1(IdentificationId));if(followedEvents==null&&followedPersons==null){TGB.WebServices.BeterZ.FollowsWebService.GetFollowedUsers(IdentificationId,succeedFollowing,failedFollowing,"followedPersons");SafeTrackEvent("webservice-call","FollowsWebService.GetFollowedUsers")}}}function succeedFollowing(result,context){if(IdentificationId){var stringTmp=createString(result);eval(context+"=stringTmp;");jQuery.cookie(context+hex_sha1(IdentificationId),stringTmp,{path:"/"});initFollowing()}}function failedFollowing(a,b){}function initFollowing(){var b;b=getIds(followedEvents);for(var a=0;a<b.length;a++){followedThings["("+b[a]+",0)"]=true;ActivateImageFollow(b[a],0)}b=getIds(followedPersons);for(var a=0;a<b.length;a++){followedThings["(0,"+b[a]+")"]=true;ActivateImageFollow(0,b[a])}String.prototype.startsWith=function(d,c){if(c==false){return(d==this.substring(0,d.length))}else{return(d.toLowerCase()==this.substring(0,d.length).toLowerCase())}};jQuery(".followThis").each(function(){var f=0,g=0;var d=this.className.split(" ");for(var c=0;c<d.length;c++){if(d[c]){var e=d[c].trim();if(e){var h=e.split("_");if(e.startsWith("followPerson_")){g=h[1]}else{if(e.startsWith("followEvent_")){f=h[1]}}if(f>0||g>0){break}}}}if(f>0||g>0){jQuery(this).click(function(){toggleFollowing(f,g)})}})}function toggleFollowing(eventId,personId){if(IdentificationId){if(eventId||personId){var startOrStop="start";if(followedThings["("+eventId+","+personId+")"]){startOrStop="stop"}var context=new Array(startOrStop,eventId,personId);eval("TGB.WebServices.BeterZ.FollowsWebService."+(startOrStop=="start"?"Start":"Stop")+"Following(IdentificationId,personId>0?personId:null,eventId>0?eventId:null,FollowSuccededCallback,FollowFailedCallback,context);");SafeTrackEvent("webservice-call","FollowsWebService."+(startOrStop=="start"?"Start":"Stop")+"Following","personId: "+personId+"; eventId: "+eventId+";")}}else{document.location.href="/Y/SignUp/"}return false}function FollowSuccededCallback(a,b){if(a){var c=b[1],d=b[2];if(b[0]=="start"){if(c&&c>0&&IdentificationId){TGB.WebServices.BeterZ.FollowsWebService.GetFollowedEventsNoCache(IdentificationId,succeedFollowing,failedFollowing,"followedEvents");SafeTrackEvent("webservice-call","FollowsWebService.GetFollowedEventsNoCache")}else{ActivateImageFollow(c,d)}}else{DisableImageFollow(c,d)}}}function FollowFailedCallback(a,b){}function ActivateImageFollow(a,b){if(a>0){followedEvents=addIdToString(followedEvents,a)}if(b>0){followedPersons=addIdToString(followedPersons,b)}followedThings["("+a+","+b+")"]=true;SetImageFollow(a,b,"on")}function DisableImageFollow(a,b){if(a>0){followedEvents=removeIdToString(followedEvents,a)}if(b>0){followedPersons=removeIdToString(followedPersons,b)}followedThings["("+a+","+b+")"]=false;SetImageFollow(a,b,"off")}function SetImageFollow(a,b,c){var e="-on",d="-off";if(c=="on"){e="-off";d="-on"}if(a>0){jQuery(".followEvent_"+a+" img").each(function(){this.src=this.src.replace(e,d)});jQuery.cookie("followedEvents"+hex_sha1(IdentificationId),followedEvents,{path:"/"});if(d=="-off"){jQuery(".removeThingsStopFollowed .followBox:has(.followEvent_"+a+")").fadeOut()}}if(b>0){jQuery(".followPerson_"+b+" img").each(function(){this.src=this.src.replace(e,d)});jQuery.cookie("followedPersons"+hex_sha1(IdentificationId),followedPersons,{path:"/"})}}function updateWalletAmount(b,a){TGB.WebServices.BeterZ.UserWebService.GetWalletAmount(IdentificationId,b,function(c){jQuery(".PlaceHolder.Wallet_Amount.WalletId_"+b).html(c.Amount);jQuery(".PlaceHolder.Wallet_Amount.WalletId_"+b+".FormatPrint").text(formatNumber(Math.floor(c.Amount*100)/100,2));var d=Math.floor(c.AmountInPlay*100)/100;jQuery(".PlaceHolder.Wallet_AmountInPlay.WalletId_"+b+".FormatPrint").text(d>0?("+ "+formatNumber(d,2)):"")});SafeTrackEvent("webservice-call","UserWebService.GetWalletAmount","currency: "+a+";")}function getPageWalletAmount(a){return parseFloat(jQuery(".PlaceHolder.Wallet_Amount.WalletId_"+a+":not(.FormatPrint)").html())}function getWalletById(a){return Wallets[a]}function getWalletByCurrencyId(d){var c={Id:0,CurrencyId:d,Amount:0,AmountInPlay:0};for(var b in Wallets){var a=Wallets[b];if(a.CurrencyId==d){c.Id=a.Id;c.Amount+=a.Amount;c.AmountInPlay+=a.AmountInPlay}}return c}function getWalletHTML(b,c){if(b){var d="";d+='<span class="PlaceHolder Wallet_Amount WalletId_'+b.Id+" CurrencyId_"+b.CurrencyId+' FormatPrint">'+formatNumber(Math.floor(b.Amount*100)/100,2)+"</span> "+c;d+='<span class="PlaceHolder Wallet_Amount WalletId_'+b.Id+" CurrencyId_"+b.CurrencyId+' displayNone">'+b.Amount+"</span>";d+="<br />";var a=Math.floor(b.AmountInPlay*100)/100;d+='<span class="PlaceHolder Wallet_AmountInPlay WalletId_'+b.Id+" CurrencyId_"+b.CurrencyId+' FormatPrint" title="Amount in play">'+(a>0?"+ "+formatNumber(a,2):"")+"</span>";return d}return""}var stepWidths=new Array();var currentSteps=new Array();function initSteps(){jQuery(".stepContainer").each(function(){var b=jQuery(".stepsNoOverflow:has(#"+this.id+")").width();stepWidths[this.id]=b;jQuery("#"+this.id+" > .step").css("width",b+"px");jQuery("#"+this.id+" > .step").css("vertical-align","top");var a=getNumberOfSteps(this.id);jQuery(this).css("width",Math.round(a*2*b)+"px")})}function cancelSteps(a){jQuery("#"+a+" > .step").css("width","100%");jQuery("#"+a).css("width","100%")}function slideStep(b,d){var e=(1-d)*stepWidths[b];currentSteps[b]=d;var a=getNumberOfSteps(b);var c="#Step"+((d%a)+1);jQuery("#"+b).animate({marginLeft:e+"px"})}function nextStep(b){var a=getNumberOfSteps(b);var c=(currentStep%a)+1;slideStep(b,c)}function getNumberOfSteps(a){return jQuery("#"+a+" > .step").size()}function showDialog(b,a){b.dialog(jQuery.extend({hide:"highlight",close:function(c,d){jQuery(this).dialog("destroy")}},a))}var currentAnchorStep=null;function checkAnchorStep(e,a,f,b){if(!f){f=document.location.hash}if(currentAnchorStep!=f){currentAnchorStep=f;var d=currentAnchorStep;if(!d){d="#"+e+"1"}var c=d.replace("#"+e,"");if(!isNaN(c)){if(!b){b=slideStep}b(a,c)}}}function initHeaderTab(a){var b="#"+a;jQuery(b).hover(function(){jQuery(b+" ul").fadeIn("fast")},function(){});jQuery(b+" ul").hover(function(){},function(){jQuery(b+" ul").fadeOut("fast")});jQuery(document).click(function(){jQuery(b+" ul").fadeOut("fast")})}var optionsValues=new Array("#advancedBetting");function initOptions(){for(var b=0;b<optionsValues.length;b++){var a=jQuery.cookie("options_"+b);if(a>0||a==null){jQuery(optionsValues[b]).each(function(){this.checked=true})}jQuery(optionsValues[b]).click(function(){saveOptions()})}}function saveOptions(){applyOptions();for(var a=0;a<optionsValues.length;a++){jQuery.cookie("options_"+a,jQuery(optionsValues[a]).is(":checked")?1:0,{path:"/",expires:dateExpirePersistentCookies})}}function applyOptions(){for(var a=0;a<optionsValues.length;a++){var b=jQuery(optionsValues[a]).is(":checked");switch(optionsValues[a]){case"#advancedBetting":if(b){jQuery(".backCol").removeClass("backColInvisible");jQuery(".layCol").removeClass("layColInvisible");setTimeout("SafeTrackEvent('apply-option','advancedBetting','true',60)",60000)}else{jQuery(".backCol").addClass("backColInvisible");jQuery(".layCol").addClass("layColInvisible");setTimeout("SafeTrackEvent('apply-option','advancedBetting','false',60)",60000)}break}}}function makeTextareasAdaptatives(){jQuery("textarea:not(.html):not(.replyBox):not(.noAutoGrow)").autogrow({})}function makeRoundings(){jQuery("div.insideTabs").wrap('<div class="insideTabsBorder"></div>');jQuery(".insideTabs").corner("round 5px").parent().css("padding","1px").corner("round 6px")}function updatePanelLoaded(b,a){initCommonThings()}function initHelpBoxes(){jQuery(".helpBox").each(function(){var b=jQuery(this);var a=b.find(".dialog").dialog({hide:"highlight",autoOpen:false});b.data("jBox",a)}).mouseover(function(){var a=getPosition(this);jQuery(this).data("jBox").dialog("option","position",[a.x+10,a.y-60]).dialog("open")}).mouseout(function(){jQuery(this).data("jBox").dialog("close")})}function initCommonThings(){jQuery("table.alternable tbody tr:even,tr.alternable:even,ul.alternable li:even").addClass("alt");jQuery("input.uint").autotab({format:"numeric"});initFollowing()}if(window.hs!=undefined){hs.graphicsDir="/Images/Highslide/";hs.Expander.prototype.onBeforeExpand=function(){jQuery("object").hide()};hs.Expander.prototype.onAfterClose=function(){jQuery("object").show()}}jQuery(document).ready(function(){preInitFollowing();initCommonThings();toggleBoxRestore();makeTextareasAdaptatives();Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(updatePanelLoaded);setTimeout("SafeTrackEvent('unbounce','unbounce','unbounce',60)",60000);document.onclick=function(d){var b=getClickContainerObj();var a=getPosition(b);var f=getCursorPosition(d);var c={x:f.x-a.x,y:f.y-a.y};logClick(c)}});