var TobJobs = {
	showContent: function(tab_id) {
		$$('#service ul.tab li').each(function(el) {
			var cnt_id = el.readAttribute('id');
			if (cnt_id != tab_id) {
				$('cnt' + cnt_id).hide();
				el.removeClassName('active');
			} else {
				$('cnt' + cnt_id).show();
				el.addClassName('active');
			}
		});
	}
}

myrules = {
	'#service ul.tab li': function(elmt) {
		Event.observe(elmt, 'click', 
			function(e) {
				var tab_id = elmt.readAttribute('id');
				if (tab_id) {
					TobJobs.showContent(tab_id);
				}
			}
		)}
};

addLoadEvent(function() {Behaviour.register(myrules);});

var theImages = new Array() 
theImages[0] = 'http://www.righthead.de/fileadmin/v1/img/Spruch1.jpg'
theImages[1] = 'http://www.righthead.de/fileadmin/v1/img/Spruch2.jpg'
theImages[2] = 'http://www.righthead.de/fileadmin/v1/img/Spruch3.jpg'
theImages[3] = 'http://www.righthead.de/fileadmin/v1/img/Spruch1.jpg'
theImages[4] = 'http://www.righthead.de/fileadmin/v1/img/Spruch2.jpg'
theImages[5] = 'http://www.righthead.de/fileadmin/v1/img/Spruch3.jpg'
theImages[6] = 'http://www.righthead.de/fileadmin/v1/img/Spruch1.jpg'
theImages[7] = 'http://www.righthead.de/fileadmin/v1/img/Spruch2.jpg'
theImages[8] = 'http://www.righthead.de/fileadmin/v1/img/Spruch3.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
