// Initialisierung von allen Elementen auf der Seite
$(document).ready(function(){
	//Verhalten	
	$('a.mail').each( function(element) {
		element.innerHTML = element.innerHTML.replace(/\(at\)/,'@'); 
		element.href = 'mailto:'+element.innerHTML.replace(/\(at\)/,'@');
	});
	
	$('img[align=left]').each( function(element) {
		$(element).addClass('left');
	});	

	$('img[align=right]').each( function(element) {
		$(element).addClass('right');
	});

	$('input.clear').focus(function () {if(this.value==this.defaultValue) this.value=''; this.removeClass('clear'); return false;});
	$('input.clear').blur(function () {if(this.value=='') this.value = this.defaultValue; this.addClass('clear'); return false;});
	
	//submenu einblenden
	$('#submenu').css("height","0px");
	
	if(!jQuery.browser.msie && $.cookie('cookie') != 'page:visited')
	{
		$('#submenu').animate({ 
			height: "38px"
	    }, 500 );
		$.cookie('cookie','page:visited');
	}		
	else
	{
		$('#submenu').css("height","38px");
	}
/***************** Unable to Fix *****************************
	$('table').each(function(element){
		var trs = element.getElementsBySelector('tr');
		for(i=0; i<trs.length; i++)
		{
			if(i % 2 == 0)
			{
				trs[i].addClass('even');
			}
			else
			{
				trs[i].addClass('odd');
			}
			
			markCellType = function (cellType, row) {
				var cells = row.getElementsBySelector(cellType);
				for(j=0; j<cells.length; j++)
				{
					cells[j].column = j+1;
					cells[j].addClass('column'+(j+1));

					if(j % 2 == 0)
					{
						cells[j].addClass('even');
					}
					else
					{
						cells[j].addClass('odd');
					}
				}
			}
			
			//markCellType('td', trs[i]);
			//markCellType('th', trs[i]);	
		}
	});
********************************************************/	
});


