Moved tje main object out of the jqeury plugin function.