function guessServiceType(url) {
				// Conditions array has the same length as serviceTypes array. Each entry is a collections of regular expressions.
				//	Each expression in a set has to validate in order for a URL to be identified as a particular service type -- no ORs.
				var conditions = [ [/getcapabilities/i, /wms/i], [/getcapabilities/i, /wfs/i], [/getcapabilities/i, /wcs/i], [/\/services\//i, /\/mapserver\/?$/i], [/\.dds$/] ];
				
				// Loop through all the service types
				for (var i = 0; i < serviceTypes.length; i++) {
					// Grab the conditions for this service type
					thisCondition = conditions[i];
					
					// Setup a boolean for whether or not the URL satisfies the conditions. If there are no conditions given,
					//	then the URL fails to satisfy
					satisfiesCondition = true;
					if (thisCondition.length == 0) { satisfiesCondition = false; }
					
					// Loop through the regular expressions in this condition. If any of them fail then the condition is not satisfied.
					for (var k = 0; k < thisCondition.length; k++) {
						if (url.search(thisCondition[k]) == -1) { satisfiesCondition = false; }
					}
					
					// If the condition was satisfied, then we've found our service type
					if (satisfiesCondition) { return serviceTypes[i]; }
				}
				
				// No conditions were satisfied -- we don't know the service type or perhaps it is not a service at all
				return null;
			}
// Function to guess if URL is one serviceType or another
Function to guess if URL is one serviceType or another
Function to guess if URL is one serviceType or another
function guessServiceType(url) {
				var conditions = [ [/getcapabilities/i, /wms/i], [/getcapabilities/i, /wfs/i], [/getcapabilities/i, /wcs/i], [/\/services\//i, /\/mapserver\/?$/i], [/\.dds$/] ];
				for (var i = 0; i < serviceTypes.length; i++) {
					thisCondition = conditions[i];
					satisfiesCondition = true;
					if (thisCondition.length == 0) { satisfiesCondition = false; }
					for (var k = 0; k < thisCondition.length; k++) {
						if (url.search(thisCondition[k]) == -1) { satisfiesCondition = false; }
					}
					if (satisfiesCondition) { return serviceTypes[i]; }
				}
				return null;
			}
function guessServiceType ( url ) { var conditions = [ [ / getcapabilities / i , / wms / i ] , [ / getcapabilities / i , / wfs / i ] , [ / getcapabilities / i , / wcs / i ] , [ / \/services\/ / i , / \/mapserver\/?$ / i ] , [ / \.dds$ / ] ] ; for ( var i = 0 ; i < serviceTypes . length ; i ++ ) { thisCondition = conditions [ i ] ; satisfiesCondition = true ; if ( thisCondition . length == 0 ) { satisfiesCondition = false ; } for ( var k = 0 ; k < thisCondition . length ; k ++ ) { if ( url . search ( thisCondition [ k ] ) == - 1 ) { satisfiesCondition = false ; } } if ( satisfiesCondition ) { return serviceTypes [ i ] ; } } return null ; }
Function to guess if URL is one serviceType or another
Function to guess if URL is one serviceType or another
// Conditions array has the same length as serviceTypes array. Each entry is a collections of regular expressions. //	Each expression in a set has to validate in order for a URL to be identified as a particular service type -- no ORs. // Loop through all the service types // Grab the conditions for this service type // Setup a boolean for whether or not the URL satisfies the conditions. If there are no conditions given, //	then the URL fails to satisfy // Loop through the regular expressions in this condition. If any of them fail then the condition is not satisfied. // If the condition was satisfied, then we've found our service type // No conditions were satisfied -- we don't know the service type or perhaps it is not a service at all