var bdate = new Date()
var thisyear=bdate.getYear(); thisyear=((thisyear<1000)?((thisyear<70)?2000:1900):0)+thisyear;
// Patrick & Gareth - February
if ((bdate.getMonth() == 1 && bdate.getDate() < 27) || (bdate.getMonth() == 0 && bdate.getDate() > 16)) {
		// span of 20 days either side
		//years (born 6/2/1922)
		years = suffixyears(thisyear - 1922);
		document.write('<span class="dsc">6 February : Happy '+years+' Birthday, Patrick Macnee')
		//Gareth Hunt		
		//years = suffixyears(thisyear - 1943);
		//document.write('<br>7 February : Happy '+years+' Birthday, Gareth</span><br>');
}
// Joanna - May
if ((bdate.getMonth() == 3 && bdate.getDate()> 10) || (bdate.getMonth() == 4 && bdate.getDate()< 22)) { 
		// 4 = May, span of 20 days either side
		//years (born 1/5/1946)
		years = suffixyears(thisyear - 1946);
		document.write('<span class="dsc">1 May : Happy '+years+' Birthday, Joanna Lumley</span><br>')
}
// Linda - June
if (bdate.getMonth() == 5 || (bdate.getMonth() == 6 && bdate.getDate()< 9) || (bdate.getMonth() == 4 && bdate.getDate()> 28)) { 
		// 5 = June, span of 20 days either side
		//years (born 18/6/47)
		years = suffixyears(thisyear - 1947);
		document.write('<span class="dsc">18 June : Happy '+years+' Birthday, Linda Thorson</span><br>')
}
// Diana - July
if ((bdate.getMonth() == 6 && bdate.getDate()> 0) || (bdate.getMonth() == 7 && bdate.getDate()< 10)) { 
		// 6 = July, span of 20 days either side
		//years (born 20/7/1938)
		years = suffixyears(thisyear - 1938);
		document.write('<span class="dsc">20 July : Happy '+years+' Birthday, Diana Rigg</span><br>')
}
// Honor + Julie - December
if (bdate.getMonth() == 11 || (bdate.getMonth() == 0 && bdate.getDate()< 2) || (bdate.getMonth() == 10 && bdate.getDate()> 21)) { 
		// 11 = December, span of 20 days either side
		//years (born 12/12/27)
		years = suffixyears(thisyear - 1947);
		document.write('<span class="dsc">12 December : Happy '+years+' Birthday, Honor Blackman');
		years = suffixyears(thisyear - 1936);
		document.write(' &amp; 20 December : Happy '+years+' Birthday, Julie Stevens</span><br>')
}

function suffixyears (years) {
		if (years%10 == 1) { 
			years = years+'<sup>st</sup>' 
		} else if (years%10 == 2) { 
			years = years+'<sup>nd</sup>'
		} else if (years%10 == 3) { 
			years = years+'<sup>rd</sup>'
		} else { 
			years = years+'<sup>th</sup>'
		}			
		return years;
}

