and : $('html, body').animate({ scrollTop: offset.top, scrollLeft: offset.left }); } function zoom(el,value){ // document.getElementById('idofyourelement').style.zoom=value; $(el).css("zoom", value); $(el).css("-moz-transform", "scale("+value+")"); $(el).css("-moz-transform-origin", "0 0"); } //not standardized yet // set proper viewport (better than the viewport meta tag) // function initresize(elementtoscroll, width,physical) { if (arguments.length < 3) physical = false; var pixelratio = window.devicePixelRatio; if (!pixelratio) pixelratio=1; var contentwidth; // physical size wanted rather than logical size ? if (arguments.length < 2) { if (physical) width = window.screen.width; else width = $(window).width(); contentwidth = width; } else contentwidth = width; p_r([window.screen.width, width, pixelratio, contentwidth]); // put the viewport tag in the header $('head').append(''); // wrap a centered div around the webpage $('body').wrapInner('
'); $("#_wrapper").css({"margin-left": "auto", "margin-right": "auto"}); var width = $(window).width(); $(window).resize(function() { $("#_wrapper").css("width", $(window).width()); // if ($(window).width() > 600) // $(".objcoord")white-space: nowrap; }); // scroll to element if (typeof(elementtoscroll)!="undefined" && elementtoscroll) { var elem_top = $(elementtoscroll).offset()['left']; // Scroll to the middle of the viewport var my_scroll = (width / 2) - elem_top; $(window).scrollLeft(-my_scroll); //p_r([elem_top,width,my_scroll]); } } /////////////////////////////////////// Popup on site ///////////////////////////////// function togglepopup(active) { g_popupopen = active; // $("#modal-background").toggleClass("active"); // $("#modal-content").toggleClass("active"); var top = ($(window).height() - $("#modal-content").outerHeight()) / 2; var left = ($(window).width() - $("#modal-content").outerWidth()) / 2; $("#modal-content").css({"left" : left, "top" : top}); if (active) { $("#modal-background").addClass("active"); $("#modal-content").addClass("active"); } else { $("#modal-background").removeClass("active"); $("#modal-content").removeClass("active"); } } function popuptext(text) { $("#modal-content").html(text); togglepopup(true); $("#modal-content").click(function() { togglepopup(false) } ); // remove if one clicks on it } function nl2br (str) { var breakTag = '
'; var res = (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2'); return res; } // show or hide data forms on clicking function showhidedata(showhideelement, plusminelement, show, whattoshow) { if (!whattoshow) whattoshow = ["[+]","[-]"]; if (typeof(show)=="undefined") show = -1; // toggle var newshow = 0; if (show == -1) { if ($(showhideelement).css("display")=="none") newshow = 1; //p_r($(showhideelement).css("display")); //p_r($(showhideelement).is(':visible')); } else newshow = show; if (newshow) { $(showhideelement).show(); $(plusminelement).html(whattoshow[1]); } else { $(showhideelement).hide(); $(plusminelement).html(whattoshow[0]); } } function resizeevent() { var y = $("#ephemdiv").position().top; var h = $(window).height()-y-10; //p_r([y,h,$(window).height()]); if (h > 100) $("#main").css("height", h+"px"); // fixed height dirty trick cannot be done with css } function __reloadnocache() { var path = window.location + "", path2; var nocache = "&_nocache"; var rand = Math.floor(Math.random()*1000000000) + "" + Math.floor(Math.random()*1000000000) if (path.match(/&\d+/g)) path2 = path.replace(/&\d+/g, "&"+rand); else path2 = path + "&" + rand; window.location.replace(path2); } ////////////////////////////////////// PAGE START //////////////////////////////////// $(document).ready(function() { //******************** init debug stuff if (g_d) { window.onerror = function(m,u,l) { g_d.innerHTML += "!!! JS ERROR !!! " + u.replace(/^.+?\/([^\/]+?)\?.+?$/, "$1") + " " + l + ": " + m + ""; $('#js_debug').show(); } $("#js_debugclick").after("
RELOAD!
"); //$('table#formtable td').css("border", "solid 1px #08F"); document.title += " TEST VERSION"; } //******************** optimization for ephem data display // click on object box, toggle objextra $('body').on( "click", '.objhead' , function() { var parent = $(this).parent(); var boxid = $(parent).attr("id") + "extra"; var box = $("#"+boxid); // var box = $(parent).find(".objextra"); //p_r(box.html()); box.toggle(); //p_r(g_leaveopen[parent.attr("id")]); if (box.css("display")=="block") g_leaveopen[parent.attr("id")] = true; else g_leaveopen[parent.attr("id")] = false; //p_r([box.css("display"), g_leaveopen[parent.attr("id")] ] ); }); //$('.objhead').css('display', 'inline'); //$('.objcoord').css('display', 'inline'); //******************** viewport and resize events p_r(window.screen.width); //if (window.screen.width > 850) // initresize(false, 800); initresize(false); // at start and every resize or rotate of screen resizeevent(); $(window).resize(function() {resizeevent();}); $("header").click(function() { var left = $(this).css("left").replace("px", "")*1; if (left < -100) left += 180; else left -=180; left += "px"; //p_r(left); $(this).finish().animate({left:left}, 200); }); /* $("header").hover(function() { $(this).finish().animate({left:"-4px"}, 200)}, function() { $(this).finish().animate({left:"-184px"}, 200)} ); */ // hide ugly scrollbars when not needed if (false) { $("html").niceScroll(); } else { $("#main div").mouseover(function() { $(this).css("overflow", "auto"); }); $("#main div").mouseout (function() { $(this).css("overflow", "hidden"); }); } //******************** set date geolocation var now = new Date(); if (typeof(window.DeviceOrientationEvent) == "undefined") $("#motionselect").hide(); if (navigator.geolocation) { $('#gps_here').after('\ \ Get from GPS\ \n'); } // overrule .contains case insensitive $.expr[":"].contains = $.expr.createPseudo(function(arg) { return function( elem ) { return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; }; }); //******************** Check whether online if (g_d) { function hostReachable() { return navigator.onLine; } $("ul#options").before("XXXXX"); function isonline() { if (hostReachable()) $('#online').text("internet available").css("color", "#080"); else $('#online').text("NO internet available").css("color", "red"); setTimeout(function() { isonline(); } , 6000); } isonline(); } //******************** clickable help texts helptext = nl2br("Version 2016.0205 This web app is intended for:\n\n\ Polar alignment when no access to the pole star\n\ Looking up objects with a telescope on an altazimuth or equatorial mount with setting circles.\n\ Currently only brighter stars are added intended for looking up at daytime.\n\ Later deepsky objects will be added.\n\n\ © 2003-2016 Skysurfer. Best viewed with Chrome, Firefox, Safari or Opera and most Android / iOS browsers.\ "); $("ul#options li").click(function(e) { var texts = [ "Show only Sun and Moon and no other objects." , "Show only bright stars until about +1.5 magnitude.", "Right Ascension value will be adjusted due to the Earth's rotation which means that the RA is decreased with the time "+ "elapsed since the user clicked on the \"NOW\" button. " + "This means that when looking up another object, use this corrected value instead of the real RA.", "For use in the southern hemisphere and the setting circles on your mount are for for northern hemisphere use only ," + "the right ascension values are subtracted from 24 so one can use the values of the 'northern' circles on the mount " + "to look up an object.\n" + "Declination is expressed in south positive and north negative which is the reverse of the usual way.", "Displays Hour Angle, i.e. meridian is zero, east negative, west positive.
" + "NOTE The hour angle is counted in the same direction as the right ascension, unlike the standard. When reverse right ascension is checked, it is in the same direction as the negated RA.", "Display also objects below the horizon. Otherwise, only the Sun and Moon are displayed when they are below the horizon. " + "Objects never visible from the specified latitude (i.e. which are anticircumpolar) won't be displayed anyway." , "Azimuth value also originates from North and eastward, but values west of the Meridian are displayed as a negative number "+ "i.e. 200° is displayed as -160°. East of meridian the values are displayed normally.", "When your device has a tilt detector (most smartphones and tablets have) display the horizontal tilt of your device.
" + "Note: the accuracy is usually not better than 1 degree. Dedicated inclinometers are usually better.", "When one uses an altazimuth mount or a Dobson and uses an (electronic) inclinometer to set the altitude, " + " and the inclinometer is not calibrated to zero when horizontal. " + "Fill in here the value displayed by the inclinometer when it is exactly horizontal.", ""] var index = $("ul#options li").index(this); if (!e.target.type) { // not clicked on the checkbox but the text popuptext(nl2br(texts[index])); } } ); //******************** datepicker $( "#datimepicker" ).datetimepicker( { dateFormat: 'yy-mm-dd', timeFormat: 'HH:mm:ss', showSecond: true, firstDay:1, changeMonth: true, changeYear: true, showAnim: 'slideDown', // defaultTimezone: "+0000", addSliderAccess: true, sliderAccessArgs: { touchonly: false }, showOtherMonths: true } ).datepicker("setDate", new Date()); //******************** start app var header = makeheader(1); // fillinfields(false); showhidedata(".canhide", "#showhidedata td", true); if (get_value('t')) doaction(document.input); if (g_d && get_value('tw')) twilightdiagram(gdata); } ); function showsearchresults(value) { var elem='.objhead'; $(elem).each(function(index) { $("#searchobject").val(value); // save value //p_r( $(this).parent().find("searchable").text().toUpperCase()); // parent of parent is a which should be hidden or shown /* var re = new RegExp(value, "ig"); p_r(re); if ($(this).text().toUpperCase().match(re).length) */ if ($(this).text().toUpperCase().indexOf(value.toUpperCase()) >=0) $(this).parent().parent().show(); else $(this).parent().parent().hide(); }); } function searchfieldevent() { $("#searchobject").keyup(function(e) { var key = e.keyCode; var value = $("#searchobject").val(); // trim value = value.replace(/^\s*(.+?)\s*$/g, "$1"); if (value == '') $('#searchobject').hide(); // hide when search term is empty if (key == 13 || value=='') { // enter key showsearchresults(value); } }); }
Calculate location according to altitude of stars
Lunar Phases
Eclipses
NOW![-] Find
Latitude (-=S)
Longitude (-=W):
local-UTC (-=behind):
Options:
Sort:
date+time:
Calculate!
Yesterday Tomorrow
1 hour earlier 1 hour later
NOW!

Info