/* -------------------------------- ** FUNCTION: ** fnRemoveProtocolFromURLString ** DESCRIPTION: ** This function removes the url protocol string ** from the beginning of a url, such as 'http://' etc ** it also removes somewhat invalid protocol strings ** such as 'gg://' or 'why:/' etc ** The function returns as a string the url without ** the protocol string. ** DEPENDENCIES: ** fnStripLeadingSpaceFromString ** none ** SEE ALSO: ** DATE: ** -------------------------------- */ function fnRemoveProtocolFromURLString(sURLString) { //-- Verify parameters if (sURLString == null) { //-->-->-->-->-->-->-->-->-->-->-->--> //-- write out some nasty error message //-- somewhere, mortally insulting the programmer //-- for such a ridiculous error return -1; } var sReturn = sURLString; sReturn = sReturn.toLowerCase(); sReturn = fnStripLeadingSpaceFromString(sReturn); var rxProtocol = new RegExp("^[a-z]{1,7}:[/]{0,2}", "gi"); sReturn = sReturn.replace(rxProtocol, "") return sReturn; } //-- fnRemoveProtocolFromURLString()