function travStyleSwitcher(ss){
	var wl = window.location;
	var whost = wl.hostname.toLowerCase(); //host excluding port number
	var wport = wl.port.toLowerCase(); //port number
	var wpath = wl.pathname.toLowerCase(); //path relative to host
	var wprot = wl.protocol.toLowerCase(); //http or https
	var wsearch = wl.search.toLowerCase(); //everything after the '?' (including the '?')
	var whash = wl.hash.toLowerCase(); //anything after the #
	for(k in ss){
		var u = ss[k];
		var globvar = makeBlank(u['globalvar']);
		var globname = makeBlank(globvar['name']);
		var globval =makeBlank(globvar['value']);
		if(
			(whost.indexOf( makeBlank(u['domain']) )!=-1) &&
			(wport.indexOf( makeBlank(u['port']) )!=-1) &&
			(wpath.indexOf( makeBlank(u['pathname']) )!=-1) &&
			(wprot.indexOf( makeBlank(u['protocol']) )!=-1) &&
			(wsearch.indexOf( makeBlank(u['search']) )!=-1) &&
			(whash.indexOf( makeBlank(u['hash']) )!=-1) &&
			( makeBlank(window[globname]).indexOf(globval)!=-1 )
		){
			if(makeBlank(u['css'])!=""){
			var csslink = document.createElement("link");
			csslink.setAttribute("rel","stylesheet");
			csslink.setAttribute("href",u['css']);
			var mediatype = makeBlank(u['media'])==""?"screen":u['media'];
			csslink.setAttribute("media",mediatype);
			// Append this stylesheet link to the document
			(document.getElementsByTagName("head")[0]).appendChild(csslink);
			//see if we're removing any css files as well
			if(makeBlank(u['remove'])!=""){
				var removecss = document.getElementsByTagName("link");
				for(l in removecss){
					if(removecss[l].href && (removecss[l].href).indexOf( u['remove'])!=-1){
						(document.getElementsByTagName("head")[0]).removeChild(removecss[l]);
						break;
					}
				}
			}
				break;
			}
		}	
	}
}
function makeBlank(e){
	return typeof(e)=='undefined'?"":e;
}