// ====================================================================================================
// This file is part of the astronomy package of Henk Reints.
// It defines JavaScript variables
// containing correct HTML code for displaying copyright and references:

function mainroot (domainOnly)
{	// next line get last 2 fields of domain + first directory,
	// e.g. it takes: "yourdomain.com/blahblah" from: "http://somesubdomain.yourdomain.com/blahblah/subdir1/subdir2"
	// updated: 22-sep-2004: implemented 'domainOnly' argument for migration to henk-reints.nl
	if (domainOnly)
		return location.hostname.split('.').slice(-2).join('.').toLowerCase()
	else	return location.hostname.split('.').slice(-2).join('.') + "/" + location.href.split('/')[3]
}

function sitemeter (center,debug)
{
	var smServer	= 'sm6'
	var smSite	= '?site=' + smServer + 'HReintsAstro'
	var now		= new Date()
	var smDomain	= 'http://' + smServer + '.sitemeter.com/'
	var smStats	= smDomain + 'stats.asp' + smSite
	var smMeter	= smDomain + 'meter.asp' + smSite
	var smRefer	= (parent ? parent.document.referrer : document.referrer)
	var smRtype	= (smRefer ? (parent ? 1 : 4) : 0)
	var smHours	= now.getHours()
	var smMinutes	= now.getMinutes()
	var smParams	= '&refer=' + escape(smRefer) + '&rtype=' + smRtype + '&hours=' + smHours + '&minutes=' + smMinutes
	return	(center ? '<center>' : '')
		+ '<a target=_blank href="' + smStats + '">'
		+ '<img'
		+ ' title="Site Meter' + (debug ? '\n(' + smMeter + smParams + ')"' : '"')
		+ ' id=sitemeterlogo'
		+ ' border=0'
		+ ' lowsrc=../pictures/sitemeterlogo.gif'
		+ (mainroot(1) != 'henk-reints.nl'
			? ' src=../pictures/sitemeterlogo.gif'
			: ' src="'+smMeter+smParams+'"'
			)
		+ '></a><br>'
		+ (center ? '</center>' : '')
}

var	HenkReints
	= 'JavaScript encoding &amp; web design: &copy; 2000-2006 '
	+ '<a href="http://henk-reints.nl" target=_top>Henk Reints</a> '
	+ ml2 + '<a hr' + 'ef="' + ml2HR + '?sub' + 'je' + 'ct' + '=' + 'HR_Astronomical_Computations">' + mlHR + '</a>'

var	JeanMeeus
	= 'Jean Meeus: '
	+ '<a href="http://www.amazon.com/exec/obidos/ASIN/0943396611/qid=974297604/sr=1-2/107-9340777-3410903" target=_blank>'
	+ 'Astronomical Algorithms, 2nd ed. ISBN 0-943396-61-1</a>'

var	VSOP87D
	= 'P.Bretagnon + G.Francou: <a href="http://cdsweb.u-strasbg.fr/htbin/Cat?VI/81" target=_blank>'
	+ 'Variations Seculaires des Orbites Planetaires</a>'
	+ ' (used subset of <a href="ftp://cdsarc.u-strasbg.fr/cats/VI/81" target=_blank>VSOP87D files</a>)'

var	disclaimertext
	= '<p align=justify>'
	+ '<b><u>Disclaimer:</u></b> '
	+ 'This package is provided "as is", for demonstrating purposes only, '
	+ 'and without any guarantee for accuracy or correctness. '
	+ 'For planning activities of any kind, one should not rely on the results of this package, '
	+ 'but always verify them by consulting other references as well. The author(s) cannot be held '
	+ 'responsible for any consequences of (typing or programming) errors or miscalculations.'
	+ '<br>'
	+ '<b><u>Copyright:</u></b> '
	+ 'Using or copying someone else\'s product or parts of it is restricted by copyright laws in most countries. '
	+ 'If you copy (parts of) this site you should include the following link clearly visible and prefix it with a text '
	+ 'that unambiguously defines it as the source reference:'
	+ '<br><nobr><center><font color=red>&lt;a href="http://henk-reints.nl/astro">'
	+ '<a href="http://henk-reints.nl/astro" style="color:blue"'
	+ ' onclick="top.location=this.href;event.cancelBubble=true;return false"'
	+ '>Astronomical Computations by Henk Reints</a>'
	+ '&lt;/a></font></center></nobr>'


	// the "home" link assumes this script is called from within a subdirectory of the astro root:
var	homelink = '<a target=_top href="../index.htm"><font face=Arial color=blue style="font-size:10pt">home</font></a>'

var	disclaimerSmall		= 7
var	disclaimerLarge		= 10
var	disclaimerSize		= disclaimerSmall	// initial display setting
var	disclaimerTimer		= null

function showDisclaimer (m)
{	disclaimerSize = (m ? disclaimerLarge : disclaimerSmall)
	var h0 = document.all.disclaimerobject.scrollHeight
	document.all.disclaimerobject.style.fontSize = '' + disclaimerSize + 'pt'
	document.all.disclaimerobject.style.backgroundColor = (m ? 'lightyellow' : 'cyan')
	var h1 = document.all.disclaimerobject.scrollHeight
	if (h1 > h0) window.scrollBy (0, h1 - h0)	// keep bottom of disclaimer at same vertical position
}

var	disclaimer
	= '<table align=center width=80%><tr>'
	+ '<td id=disclaimerobject style="font-family:Arial;font-size:'+disclaimerSize+'pt"'
	+ ' onmouseover="clearTimeout(disclaimerTimer);disclaimerTimer=setTimeout(\'showDisclaimer(1)\',500)"'
	+  ' onmouseout="clearTimeout(disclaimerTimer);disclaimerTimer=setTimeout(\'showDisclaimer(0)\',500)"'
	+ '>'
	+ disclaimertext
	+ '</td></tr></table>'
	+ '<br><center>'
	+ homelink
	+ '</center>'

var	ref_HR
	= '<table align=center><tr><td><nobr>'
	+ '<font face=Arial style="font-size:10pt">'		+ HenkReints	+ '</font><br>'
	+ '</nobr></td></tr></table>'

var	ref_HR_JM
	= '<table align=center><tr><td><nobr>'
	+ '<font face=Arial style="font-size:10pt">'		+ HenkReints	+ '</font><br>'
	+ '<font face=Arial style="font-size:8pt">Reference: '	+ JeanMeeus	+ '</font>'
	+ '</nobr></td></tr></table>'
	+ disclaimer

var	ref_HR_JM_VSOP
	= '<table align=center><tr><td><nobr>'
	+ '<font face=Arial style="font-size:10pt">'		+ HenkReints	+ '</font><br>'
	+ '<font face=Arial style="font-size:8pt">References: '	+ JeanMeeus	+ '<br>'
								+ VSOP87D	+ '</font>'
	+ '</nobr></td></tr></table>'
	+ disclaimer

// ====================================================================================================
// end of file; Copyright (c) 2000 Henk Reints
