// <![CDATA[

//////////////////////////////////////////////////////
// REZEPTE CAROUSSELL
//////////////////////////////////////////////////////

function rezept(direction){
	switch(direction){
	case 'next' :
		var active_elem = $('#rezept li:visible');
		if ((active_elem.length != 1) || ($(active_elem).next('li').length == 0)){
		active_elem = $('#rezept li:first');
		}else{
		active_elem = $(active_elem).next('li');
		}
		$('#rezept li:visible').hide();
		$(active_elem).fadeIn('slow');
		//window.setTimeout('rezept('+seconds+')', seconds);
	break;
	case 'prev' :
		var active_elem = $('#rezept li:visible');
		if ((active_elem.length != 1) || ($(active_elem).prev('li').length == 0)){
		active_elem = $('#rezept li:last');
		}else{
		active_elem = $(active_elem).prev('li');
		}
		$('#rezept li:visible').hide();
		$(active_elem).fadeIn('slow');
		//window.setTimeout('rezept('+seconds+')', seconds);
	break;
	}
}
$(function(){
rezept('next');
});

//////////////////////////////////////////////////////
// A FOCUS BLUR FIX
//////////////////////////////////////////////////////

onload = function() {
	a_tags=document.getElementsByTagName('a')
	for (i=0;i<a_tags.length;i++) {
		a_tags[i].onfocus=blur_links
	}
}
function blur_links() {
	this.blur()
}

//////////////////////////////////////////////////////
// FORM VALUE
//////////////////////////////////////////////////////

function FormValue(Typ,FormName,FeldName,Wert){
	switch(Typ){
	case 'onfocus' :
		var formular = document.forms[FormName].elements[FeldName];
		if(formular.value == Wert){
		formular.value = '';
		}
	break;
	case 'onblur' :
		var formular = document.forms[FormName].elements[FeldName];
		if(formular.value == ''){
		formular.value = Wert;
		}
	break;
	}
}

//////////////////////////////////////////////////////
// TOGGLE BOX
//////////////////////////////////////////////////////

function toggle(DivID) {
	var ToggleObj = document.getElementById(DivID);
	if (ToggleObj.style.display == 'block') {
		ToggleObj.style.display = "none";
	} else {
		ToggleObj.style.display = "block";
	}
}

//////////////////////////////////////////////////////
// BOOKMARK
//////////////////////////////////////////////////////

function bookmark(title,url)
{
	// firefox
	if (window.sidebar){
	window.sidebar.addPanel(title, url, "");
	}
	// opera
	else if(window.opera && window.print){
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
	}
	// ie
	else if(document.all){
	window.external.AddFavorite(url, title);
	}
}

// ]]>
