function yearDiff(strDateFrom, strDateTo) {
//return = differents in years between strDateFrom & strDateTo
//when positive return strDateFrom is n years more than strDateTo
//when negative return strDateFrom is n years less than strDateTo
//strDateFrom = "yyyy,mm,dd" (valid delimiters: ,./-) || Date();
//strDateTo = "yyyy,mm,dd" (valid delimiters: ,./-) || Date();


	//see if strDateFrom is a dateObject or (FireFox) we are able to create one from it.
	if(new Date(strDateFrom).getFullYear())
	{
		objDateFrom = new Date(strDateFrom);
	}
	else
	{
		//split strDateFrom into yyyy,mm,dd array elements 
		var aryDateFrom = new Array();
		aryDateFrom = strDateFrom.split(/[\.\,\/\-]/);
		aryDateFrom[1]--;
		
		//create date objects
		var objDateFrom = new Date(aryDateFrom[0],aryDateFrom[1],aryDateFrom[2]);
	}

	//see if strDateTo is a dateObject or (FireFox) we are able to create one from it.
	if(new Date(strDateTo).getFullYear())
	{
		objDateTo = new Date(strDateTo);
	}
	else
	{
		var aryDateTo = new Array();
		aryDateTo = strDateTo.split(/[\.\,\/\-]/);
		aryDateTo[1]--;

		//create date objects
		var objDateTo = new Date(aryDateTo[0],aryDateTo[1],aryDateTo[2]);
	}
	
	var intYearFrom = objDateFrom.getFullYear();
	var intYearTo = objDateTo.getFullYear();

	var intMonthFrom = objDateFrom.getMonth();
	var intMonthTo = objDateTo.getMonth();

	var intDayFrom = objDateFrom.getDate();
	var intDayTo = objDateTo.getDate();
	
	//work out the difference in years
	var intYearDiff = intYearFrom - intYearTo;
	
	//see if year correction is needed due to month 
	if (intMonthFrom < intMonthTo) 
	{ 
		//correction needed, return
		return intYearDiff-1;
	}

	//see if no correction is needed month.
	if (intMonthFrom > intMonthTo) 
	{
		//no correction needed, return
		return intYearDiff;
	}
	
	//see if we need to check at day level for correction
	if (intMonthFrom == intMonthTo) 
	{
		//see if year correction is needed due to day
		if (intDayFrom < intDayTo) 
		{
			//correction needed, return
			return intYearDiff-1;
		}

		//see if no correction is needed
		if (intDayFrom >= intDayTo)
		{
			//no correction needed, return
			return intYearDiff;
		}
		//at this point, something went wrong
	}
	
	//at this point, something went wrong
}
