/* -----------------------------------------------------------------------------

	BEHAVIOUR.STYLE.JS
	Event registration für job-online.ch aufgeteilt in zwei Gruppen (Load- und
	Apply Events.

	Autor:				UC
	Erstellungsdatum:	15.11.2006
	
	Index:				addLoadEvent
						loadEvents
						applyEvents
							
----------------------------------------------------------------------------- */

// OnLoad Events
Behaviour.addLoadEvent(function() {
	// Wenn eine Site als preview betrachtet wird
	if(mks_config.showPreview) {
		var allLinks = document.getElementsByTagName('a');
		for(var i=0; i<allLinks.length; i++) {
			allLinks[i].setAttribute('href', 'javascript:void(0)');
		}
	}
});

// Events welche nur beim onload initialisiert werden
var loadEvents = {
	
		// Intro: Seite weiterleiten
			'body.intro': function() {
					nextPage();
			},
		// Intro: Bildwechsel
			'div.intro-text span a': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/intro/arrow-hi.gif";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/intro/arrow.gif";
				}
			},
			
		//Link
			//link top
			'a.link-up': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-up-hi.gif";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-up-lo.gif";
				}
			},
			//link right
			'a.link-right': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-right-hi.gif";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-right-lo.gif";
				}
			},
			//link down
			'a.link-down': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-down-hi.gif";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-down-lo.gif";
				}
			},
			//link left
			'a.link-left': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-left-hi.gif";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/arrow-left-lo.gif";
				}
			},
			
			// Bildung und Wissen: Pfeile+Pfeile-last, mouse over
			'li.pfeil a': function(elm) {
				elm.onmouseover = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/kurse-hi.jpg";
				}
				elm.onmouseout = function() {
					var img = cssQuery("img", this);
					img[0].src= mks_config.websiteUrl + "/images/ico/kurse-lo.jpg";
				}
			}
			
};

// Events welche bei jedem Request neu initialisiert werden
var applyEvents = {

};

// Events registrieren
Behaviour.register(applyEvents);
Behaviour.register(loadEvents);
