fixing IE7 Bug

type = type[0].toUpperCase() + type.substr(1); caused an error in IE7

so i changed this to type = type.substr(0,1).toUpperCase() + type.substr(1);