window.addEvent('domready', function() {
	var elements = new Array();
	elements[0] = "headInjury";
	elements[1] = "earInjury";
	elements[2] = "neckInjury";
	elements[3] = "shoulderInjury";
	elements[4] = "armInjury";
	elements[5] = "backInjury";
	elements[6] = "wristInjury";
	elements[7] = "handInjury";
	elements[8] = "legInjury";
	elements[9] = "footInjury";
	elements[10] = "startInjury";

  function setup() {
    if (document.body.clientWidth >= 1240) {
      newWidth = 330;
    } else {
      if (document.body.clientWidth < 1240) ratio = 0.3;
      if (document.body.clientWidth < 1190) ratio = 0.29;
      if (document.body.clientWidth < 1140) ratio = 0.28;
      if (document.body.clientWidth < 1090) ratio = 0.26;
      if (document.body.clientWidth < 1040) ratio = 0.24;
      if (document.body.clientWidth < 990) ratio = 0.22;
      if (document.body.clientWidth < 940) ratio = 0.18;
      if (document.body.clientWidth < 890) ratio = 0.14;
      if (document.body.clientWidth < 840) ratio = 0.1;
      if (document.body.clientWidth < 840) ratio = 0.08;
    
      newWidth = Math.round(document.body.clientWidth * ratio);
    }
  
  	for (i = 0; i < elements.length; i++) {
  		var div = document.getElementById(elements[i]);
  		div.style.position = "absolute";
  		div.style.height = "380px";
  		div.style.width = newWidth + "px";
  	}
  	
  	setTimeout(setup, 100);
	}
	
	setup();
	
	var displayTop = '0';
	var displayLeft = '220px';
	
	var headInjury = new Fx.Styles('headInjury', {duration: 0, transition: Fx.Transitions.linear});
	var earInjury = new Fx.Styles('earInjury', {duration: 0, transition: Fx.Transitions.linear});
	var neckInjury = new Fx.Styles('neckInjury', {duration: 0, transition: Fx.Transitions.linear});
	var shoulderInjury = new Fx.Styles('shoulderInjury', {duration: 0, transition: Fx.Transitions.linear});
	var armInjury = new Fx.Styles('armInjury', {duration: 0, transition: Fx.Transitions.linear});
	var backInjury = new Fx.Styles('backInjury', {duration: 0, transition: Fx.Transitions.linear});
	var wristInjury = new Fx.Styles('wristInjury', {duration: 0, transition: Fx.Transitions.linear});
	var handInjury = new Fx.Styles('handInjury', {duration: 0, transition: Fx.Transitions.linear});
	var legInjury = new Fx.Styles('legInjury', {duration: 0, transition: Fx.Transitions.linear});
	var footInjury = new Fx.Styles('footInjury', {duration: 0, transition: Fx.Transitions.linear});
	var startInjury = new Fx.Styles('startInjury', {duration: 0, transition: Fx.Transitions.linear});

	startInjury.start({
	    'top': displayTop,
	    'left': displayLeft
	});
	
	function show(what) {
		if (what != 'start') {	
			startInjury.start({
			    'left': '-9999px'
			});
		}
		if (what != 'head') {
			headInjury.start({
			    'left': '-9999px'
			});		
		}
		if (what != 'ear') {
			earInjury.start({
			    'left': '-9999px'
			});
		}
		if (what != 'neck') {	
			neckInjury.start({
			    'left': '-9999px'
			});	
		}
		if (what != 'shoulder') {	
			shoulderInjury.start({
			    'left': '-9999px'
			});
		}		
		if (what != 'arm') {
			armInjury.start({
			    'left': '-9999px'
			});
		}
		if (what != 'back') {		
			backInjury.start({
			    'left': '-9999px'
			});	
		}
		if (what != 'wrist') {	
			wristInjury.start({
			    'left': '-9999px'
			});
		}
		if (what != 'hand') {
			handInjury.start({
			    'left': '-9999px'
			});	
		}
		if (what != 'leg') {	
			legInjury.start({
			    'left': '-9999px'
			});	
		}
		if (what != 'foot') {	
			footInjury.start({
			    'left': '-9999px'
			});
		}
	}
	
	show('start');
	
	$('headToggle').addEvent('mouseenter', function(e){
		show('head');
		headInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('earToggle').addEvent('mouseenter', function(e){
		show('ear');		
		earInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('neckToggle').addEvent('mouseenter', function(e){
		show('neck');	
		neckInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('shoulderToggle').addEvent('mouseenter', function(e){
		show('shoulder');		
		shoulderInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('armToggle').addEvent('mouseenter', function(e){
		show('arm');		
		armInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('backToggle').addEvent('mouseenter', function(e){
		show('back');		
		backInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('wristToggle').addEvent('mouseenter', function(e){
		show('wrist');		
		wristInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('handToggle').addEvent('mouseenter', function(e){
		show('hand');		
		handInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('legToggle').addEvent('mouseenter', function(e){
		show('leg');		
		legInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
	
	$('footToggle').addEvent('mouseenter', function(e){
		show('foot');		
		footInjury.start({
		    'top': displayTop,
		    'left': displayLeft
		});
	});
});