/////////////////////////////////////// // // // Helpers // // // /////////////////////////////////////// function scrollToItem(id){ var tx=$("#"+id).offset().top; if(id=="contact"){ tx=tx-100; } $('html, body').animate({scrollTop: tx+"px"},'slow'); } function focusAtEnd(el) { el.focus(); var s = el.value; el.value = ''; el.value = s; } function setMenu(what){ scrollToItem(what); } /////////////////////////////////////// // // // Socialize // // // /////////////////////////////////////// function startTwitterRE(thisid, thisintent, thisto){ var TwReWinURL='https://twitter.com/intent/'+thisintent+'?'+thisto+'='+thisid+'&via=s42at'; TwReWin = window.open(TwReWinURL, "TwReWin1", "width=550,height=350,left=100;top=100;toolbar=yes,scrollbars=yes,resizable=no,location=no"); TwReWin.focus(); } function shareIt(on, code){ if(on=="Twitter"){ var via="S42AT"; var url="http://vorgesorgt.de/"+code; var popurl="https://twitter.com/intent/tweet?via="+via+"&url="+url; wintw = window.open( popurl , "wintwl", "width=600,height=400,left=100;top=100,toolbar=no,scrollbars=yes,resizable=no,location=no"); wintw.focus(); } if(on=="Facebook"){ var headredicerct=encodeURIComponent("http://s42.at/services/facebook/cb.php"); var url=encodeURIComponent("http://vorgesorgt.de/"+code); var popurl="https://www.facebook.com/dialog/feed?app_id=178598588995216&display=popup&link="+url+"&redirect_uri="+headredicerct; winfb = window.open( popurl , "winfbl", "width=600,height=400,left=100;top=100,toolbar=no,scrollbars=yes,resizable=no,location=no"); winfb.focus(); } if(on=="Google"){ var url=encodeURIComponent("http://vorgesorgt.de/"+code); var popurl="https://plus.google.com/share?url="+url; wingo = window.open( popurl , "wingol", "width=500,height=500,left=100;top=100,toolbar=no,scrollbars=yes,resizable=no,location=no"); wingo.focus(); } } function emailIt(code, title, imgurl){ window.location='mailto:?subject='+title+'&body=http://vorgesorgt.de/'+code; } /////////////////////////////////////// // // // URL // // // /////////////////////////////////////// function setPlaceURL(u, t){ document.title="Hopzaa"+t; var url="http://vorgesorgt.de/places/"+u; var stateObj = { foo: "hopzaa" }; history.pushState(stateObj, "hopzaa", url); }