if( document.createElement && ( document.styleSheets || ( window.opera && document.childNodes ) || ( window.ScriptEngine && ScriptEngine().indexOf('InScript') + 1 ) ) && !navigator.__ice_version ) {

	window.onload = function () {

		var frm = document.createElement('form'),
			  par = document.createElement('p'),
			  bol = document.createElement('b'),
			  sel = document.createElement('select'),
			  eList = document.getElementsByTagName('script');
		eList = eList[eList.length-1].nextSibling;

		frm.appendChild(par);
		par.appendChild(bol);
		bol.appendChild(document.createTextNode('Style:'));
		par.appendChild(document.createTextNode(' '));
		par.appendChild(sel);
		bol.onclick = function () {
			var subLoc = location.href.replace(/^(https?:\/\/[^\/]*\/(cycling\/)?).*/,'$1');
			subLoc = window.open(subLoc+'styles\/','styleWindow','resizable=1,location=0,menubar=0,scrollbars=1,status=0,toolbar=0');
			subLoc.focus();
		}
		//set once as an attribute to be nice to Opera Mini - it needs to see it as an attribute to realise it has to do something
		try { sel.setAttribute('onchange','var tmpVal = this.selectedIndex;eval(this.options[tmpVal].value);this.options[tmpVal].selected = true;'); } catch(e) {}
		//set once as a function to be nice to lame old IE, with its lousy DOM support
		sel.onchange = function () {
			var tmpVal = this.selectedIndex;
			eval(this.options[tmpVal].value);
			this.options[tmpVal].selected = true;
		};
		frm.setAttribute('method','get');
		frm.setAttribute('action','.\/');
		frm.onsubmit = function () { return false; };

		var aS = ['Cool Blue','Bloodshot','Burning','Forest','Bike Trail','Floating'];
		for( var i = 0, theCurCol = aS[0].replace(/\s/g,''); aS[i]; i++ ) { aS[aS[i].replace(/\s/g,'')] = i; }
		for( var x = 0; x < document.cookie.split( "; " ).length; x++ ) {
			var oneCookie = document.cookie.split( "; " )[x].split( "=" );
			if( oneCookie[0] == 'styleChoice' ) { theCurCol = unescape( oneCookie[1] ).replace(/ MWJ .*/,''); break;
		} } theCurCol = ( theCurCol && typeof( aS[theCurCol] ) != 'undefined' ) ? aS[theCurCol] : aS.length;

		aS[aS.length] = 'Print route';
		for( var i = 0, newOp; aS[i]; i++ ) {
			newOp = document.createElement('option');
			newOp.text = aS[i];
			newOp.value = 'changeStyle(\''+aS[i].replace(/\s/g,'')+'\');';
			try { sel.add(newOp,null); } catch(e) { try { sel.add(newOp,sel.options.length); } catch(f) { sel.appendChild(newOp); } }
		}
		newOp = document.createElement('option');
		newOp.text = 'Unstyled';
		newOp.value = 'changeStyle();';
		try { sel.add(newOp,null); } catch(e) { try { sel.add(newOp,sel.options.length); } catch(f) { sel.appendChild(newOp); } }

		eList.parentNode.insertBefore(frm,eList);
		useStyleAgain('styleChoice');
		setTimeout(function () { sel.options[theCurCol].selected = true; },10);
		bol.style.cursor = 'help';

	};

	window.onunload = function () { rememberStyle('styleChoice',365); };
}