function appendStyleElement (ruleSet) {
	if (document.createElement) {
		var styleElement = document.createElement( 'style' );
		var def = ruleSet
		if( styleElement ) {
			//styleElement.type = 'text/css';

			styleElement.setAttribute("id", "wheriz");

			styleElement.setAttribute("type", "text/css");

			if (styleElement.styleSheet) { // IE
				styleElement.styleSheet.cssText = def;
			} else { // the world
				var tt1 = document.createTextNode(def);
				styleElement.appendChild(tt1);
			}
			var headElement = document.getElementsByTagName( 'head' )[0];
			headElement.appendChild( styleElement );
		}
	}
}

function appendStyleRule (ruleSet) {
	if (document.styleSheets) {
		appendStyleElement(ruleSet);
	}

}

function wInit() {
	appendStyleRule( '#wheriz-widget-484 { border: 1px solid green; padding: .5em 1em .5em 1em;  }' );
	appendStyleRule( '#wheriz-widget-484 *{ margin: 0; padding: 0; font-family: tahoma, sans-serif; font-size: 10px }' );
	appendStyleRule( '#wheriz-widget-484 ul{ list-style-type: none; margin-left: 1em }' );
	appendStyleRule( '#wheriz-widget-484 p{ margin: .5em 0;  }' );
	appendStyleRule( '#wheriz-widget-484 img.av{ background-repeat: no-repeat; border: 4px solid white; margin: 0 }' );
	appendStyleRule( '#wheriz-widget-484 img.small_av{ width: 32px; height: 32px; background-image: url( images/genav.gif ); border-width: 3px }' );
	appendStyleRule( '#wheriz-widget-484 *.raised{ border-top: 1px solid #ebebeb; border-left: 1px solid #ebebeb; border-right: 1px solid #bababa; border-bottom: 1px solid #bababa }' );
	 appendStyleRule( '#wheriz-widget-484 a{ color: # }' );
	var e = document.getElementById( 'wheriz-widget-484' );
	if( !e ) return;
	e.innerHTML = '<a href="http://www.wheriz.es/" target="_blank"><img src="http://www.wheriz.es/images/minilogo.png"  width="102" height="32" /></a><p>No plans ahead :(</p><p><b><a href="http://www.wheriz.es/user/484/all" target="_blank">View Kilian Jornet\'s profile in wheriz</a> | <a href="http://www.wheriz.es/user/484/map" target="_blank">View all plans of Kilian Jornet</a></b></p>';
}

wInit();


