Function to check if two intervals overlap with each other
function checkOverlapping ( a , b ) { if ( a [ 0 ] < b [ 0 ] ) { var temp = a [ 0 ] ; a [ 0 ] = b [ 0 ] ; b [ 0 ] = temp ; temp = a [ 1 ] ; a [ 1 ] = b [ 1 ] ; b [ 1 ] = temp ; }