idOld = idOld2 = null;

var rules = {
	'div#noJS' : function(element){
		element.style.display='none';
	},		
	'input#dateBirthday' : function(element){
		element.calender=Calender.initialize(element,0,0,'D.M.Y','begin');
	},
	'input#dateAnreise' : function(element){
		if (element.id!='dateAnreise')
			return false;

		
		element.calender=Calender.initialize(element,0,0,'D.M.Y','begin');
	},
	'a#verbindlichBuchen' : function(element){
		element.style.display='inline';
	},	
	'button#verbindlichBuchen' : function(element){
		element.style.display='inline';
	},		
	'#leftcolumn a' : function(element){
		element.onmouseover = function(){
			//this.style.backgroundImage='url(templates/kita/images/arrow_small_over.png)';
			this.className = 'over';
		}
		element.onmouseout = function(){
			//this.style.backgroundImage='url(templates/kita/images/arrow_small.png)';
			this.className = '';
		}		
	},	
/*
	'div#maincolumn td.homeItem a' : function(element){
		element.onmouseover = function(){	
			this.style.backgroundImage='url(templates/kita/images/arrow_big_over.png)';
		}
		element.onmouseout = function(){
			this.style.backgroundImage='url(templates/kita/images/arrow_big.png)';
		}		
	},	*/
	'div#maincolumnStart td.homeItem a' : function(element){

		element.onmouseover = function(){
			var tmp = this.getElementsByTagName('DIV')[0];
			
			tmp.style.backgroundImage='url(templates/vorschule/images/arrow_big_over.png)';
		}
		element.onmouseout = function(){
			//this.style.backgroundImage='url(templates/kita/images/arrow_big.png)';
			var tmp = this.getElementsByTagName('DIV')[0];		
			tmp.style.backgroundImage='url(templates/vorschule/images/arrow_big.png)';			
		}		
	},	
	'#homeMap area.kitaArea' : function(element){
		element.onmouseover = function(){		
			if (idOld2) 
				document.getElementById('map_'+idOld2).style.display='none';
			if (idOld) 
				document.getElementById('map_'+idOld).style.display='none';				
			id = this.id.split('_')[1];
			document.getElementById('map_'+id).style.display='block';
			idOld2 = id;
			if (!idOld || idOld2!=idOld)
				document.getElementById('map_'+id).className = document.getElementById('map_'+id).className+' kitaOver';

						
		}
		element.onclick = function(){		
			if (idOld)
				document.getElementById('map_'+idOld).style.display='none';
			id = this.id.split('_')[1];
			document.getElementById('map_'+id).style.display='block';
			document.getElementById('map_'+id).className = document.getElementById('map_'+id).className.replace(/kitaOver/,'');	
			coords = this.getAttribute('coords').split(',');
			document.getElementById('dot').style.top = coords[1]-9+'px';
			document.getElementById('dot').style.left = coords[0]-9+'px';
			document.getElementById('dot').style.display = 'block';			
			idOld = id;
			return false;
		}
		element.onmouseout = function(){
			if (idOld2) 
				document.getElementById('map_'+idOld2).style.display='none';	
			if (idOld) 
				document.getElementById('map_'+idOld).style.display='block';
			document.getElementById('map_'+id).className = document.getElementById('map_'+id).className.replace(/kitaOver/,'');	
		}		
	}	
};
Behaviour.register(rules);
