/*********************************************************************************************************
*
* Copyleft Peter Crute 2008
* pcrute@une.edu.au
* The scripts which appear on this page were developed by Peter Crute for the Central West Astronomical Society 
* of NSW, Australia (http://www.cwas.org.au).
* The scripts which appear on this page are subject to the General Public Licience version 3 or greater. Therefore they
* may be used and modified free of charge with the understanding that:
*   		- There is no warrenty on any of the scripts and no responsiblity will be taken for they way the scripts behave
* 		- This noticed remains unchanged and intact. 
* Any modification that you make should be noted below under the Modifications heading.
*
* Modifications:
*
*********************************************************************************************************/


function email(person, domain){
    domain=domain.replace("|",".");
    domain=domain.replace("|",".");
    var address="mailto:"+person+"@"+domain;

    return address;
}

function julianDay(thisDay){
    if(thisDay=="today"){
	var date= new Date();
    }
    else{
	var date= new Date(thisDay);
    }
    var year=date.getFullYear();
    var month=date.getMonth() + 1;
    var day=date.getDate();
    var hour=date.getHours();
    var min=date.getMinutes();
    var sec=date.getSeconds();
    
    var a=Math.floor((14-month)/12);
    var y=year+4800-a;
    var m=month+(12*a)-3;
    
    var JDN=day+Math.floor(((153*m)+2)/5)+365*y+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400)-32045;
    
    var JD=JDN+(hour-12)/24+min/1440+sec/86400;
    
    return JD;
}