  function hm(title) {
  	name = 'nh';
	domain = 'starworks.dk';
	subject = 'Starworks Observatory';
	if ((title=='') || (!title) ) title = 'Contact';
  	document.write('<a href="mailto:'+name+'@'+domain+'?subject='+subject+'" target="_self">'+title+'</a>');
  }
  function wt_hm(title) {
  	name = 'info';
	domain = 'worldtracking.org';
	subject = 'WORLD TRACKING . ORG';
	if ((title=='') || (!title) ) title = 'Contact';
  	document.write('<a href="mailto:'+name+'@'+domain+'?subject='+subject+'" target="_self">'+title+'</a>');
  }
  function doprint() {
  	alert('printing');
  }
	function hideHelp() {
		var elm = document.getElementById("helpdiv");
		elm.style.display = 'none';	
	}
	
	function showHelp( keyword ) {
		params = 'width=500, height=500'; 

		newwin=window.open('/help.php?keyword='+keyword, 'helpwindow', params);
		if (window.focus) {newwin.focus()}
 		return false;
 
/*		var elm = document.getElementById("helpdiv");
		elm.style.display = 'block';
		elm.innerHTML = '<div style="background-color: #999999; width: 400px; text-align: left;"><div align="right" style="background-color: #DDDDDD; color: #222222; font-weight: bold; cursor: pointer" onclick="hideHelp()">Luk</div>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br>sdfdsfdfsf<br></div>';*/
	}
	
	function checkform() {
		if (document.form1.checkbox.checked) return true;
		else {
			alert('Du har ikke accepteret betingelserne!');
			return false;
		}		
	}
	
	function unixtimetodate( unixtime ) {
		var theDate = new Date( ((unixtime- 3600)*1000) );
		date = theDate.getDate();
		month = theDate.getMonth()+1;
		hours = theDate.getHours();
		minutes = theDate.getMinutes();
		seconds = theDate.getSeconds();
		
		if (date<10) date = '0'+date;
		if (month<10) month = '0'+month;
		if (hours<10) hours = '0'+hours;
		if (minutes<10) minutes = '0'+minutes;
		if (seconds<10) seconds = '0'+seconds;
		
		dateString = date + '-' + month + '-' + theDate.getYear() + ' ' + hours + ':' + minutes + ':' + seconds;
		
		return dateString;
	}

	function nozeros(input) {
		return input;
		if((input.length > 1) && (input.substr(0,1) == "0")) {
			return input.substr(1);
		} else {
			return input;
		}
	}

	function datetounixtime(yyyy, mm, dd, hh, tmin, tsec) {
		var humDate = new Date(Date.UTC(yyyy, (nozeros(mm)-1), nozeros(dd), nozeros(hh), nozeros(tmin), nozeros(tsec)));
		return ((humDate.getTime()/1000.0));
	}
	
	function parseDateToUnixtime(v) {
	    try {
	    	if (v.length==16) { // 19 med sec 
	    		dd = v.substr(0,2);
				mm = v.substr(3,2);
				yyyy = v.substr(6,4);
	
				hh = v.substr(11,2);
				tmin = v.substr(14,2);
				tsec = '00';//tsec = v.substr(17,2);
				
				if ( (dd.indexOf('-', 0)==-1) && (mm.indexOf('-', 0)==-1) && (yyyy.indexOf('-', 0)==-1) && (hh.indexOf(':', 0)==-1) && (tmin.indexOf(':', 0)==-1) && (tsec.indexOf(':', 0)==-1) )
					return datetounixtime( yyyy, mm, dd, hh, tmin, tsec );
			}
			if (v.length==10) { 
	    		dd = v.substr(0,2);
				mm = v.substr(3,2);
				yyyy = v.substr(6,4);
	
				hh = '00';
				tmin = '00';
				tsec = '00';
				
				if ( (dd.indexOf('-', 0)==-1) && (mm.indexOf('-', 0)==-1) && (yyyy.indexOf('-', 0)==-1) && (hh.indexOf(':', 0)==-1) && (tmin.indexOf(':', 0)==-1) && (tsec.indexOf(':', 0)==-1) )
					return datetounixtime( yyyy, mm, dd, hh, tmin, tsec );
			}
		}
		catch(ex) {
		}
		return 0;
	}

	function parseOnlyDateToUnixtime(v, full) {
	    //alert( v + ' -- ' + full );
	    try {
			if (v.length==10) {
				dd = v.substr(0,2);
				mm = v.substr(3,2);
				yyyy = v.substr(6,4);
	
				if (full) {
					hh = '23';
					tmin = '59';
					tsec = '59';
				} else {
					hh = '00';
					tmin = '00';
					tsec = '00';
				}
				
				if ( (dd.indexOf('-', 0)==-1) && (mm.indexOf('-', 0)==-1) && (yyyy.indexOf('-', 0)==-1) && (hh.indexOf(':', 0)==-1) && (tmin.indexOf(':', 0)==-1) && (tsec.indexOf(':', 0)==-1) )
					return datetounixtime( yyyy, mm, dd, hh, tmin, tsec );
			}
		}
		catch(ex) {
		}
		return 0;
	}

	function setCookie(c_name,value,expiredays) {
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}
	
	function getCookie(c_name) {
		if (document.cookie.length>0) {
  			c_start=document.cookie.indexOf(c_name + "=");
  			if (c_start!=-1) { 
    			c_start=c_start + c_name.length+1; 
    			c_end=document.cookie.indexOf(";",c_start);
			    if (c_end==-1) c_end=document.cookie.length;
    			return unescape(document.cookie.substring(c_start,c_end));
    		} 
  		}
		return "";
	}