function cDate(s) {
	var d = null;
	if (s.indexOf("-")>0) {
		var dp = s.split("-");
		if (dp.length==3) {
			if (dp[2].length==4) {
				d = new Date(dp[2], dp[1]-1, dp[0], 0, 0, 0); 	
			} else if (dp[0].length==4) {
				d = new Date(dp[0], dp[1]-1, dp[2], 0, 0, 0);				
			}
		}
	}
	return d;
}
