// Recall Form
function recallcheckvalues(val0, val1)
{

	value0 = document.getElementById(val0).value;
	value1 = document.getElementById(val1).value;

	if (value0 == "Ihr Name")
	{
		alert('Bitte geben Sie Ihren Namen an.');
		return false;
	}
	if (value1 == "Ihre Telefonnummer")
	{
		alert('Bitte geben Sie Ihre Telefonnummer an.');

		return false;
	}

}

// alte function, mit overs fuer die teaserboxen
function activatearea()
{
	// unterstützt ie nicht
	var elements = $$("#home div#content", "#home #inner-secondary-content div.teaser");
	if (Prototype.Browser.IE){
		if ($("home"))
			elements = $$("#content, #inner-secondary-content div.teaser");
	}
	elements.each(function(el_area)
	{
		var anchors = $(el_area).select("a[href]");
		if (anchors.size() == 1)
		{
			var href = anchors[0].getAttribute("href");
			Event.observe(el_area, "mouseover", function()
			{
				el_area.addClassName("teaserover");
			});
			Event.observe(el_area, "mouseout", function()
			{
				el_area.removeClassName("teaserover");
			});
			Event.observe(el_area, "mousedown", function()
			{
				if (href.startsWith("javascript:"))
				{
					func = href.gsub("javascript:", "");
					eval(func);
				}
				else
				{
					
					anchors.each(function (el) {
						el.onclick = function() {
							return false; 
						}
					});

					/* external links */
					if (anchors[0].hasAttribute('target')) {
						var x = anchors[0].readAttribute('target');
						if ( x = '_blank' ) {
							window.open(href);
							return false;
						}
					}
					else {
						location.href = href;
					}

					//$('foo').observe('click', function(event) { event.stop(); });
					//location.href = href;
					
				}
			});
			
		}
	});
}

Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt( navigator.userAgent.substring( navigator.userAgent.indexOf( "MSIE" ) + 5 ) ) === 6;
Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt( navigator.userAgent.substring( navigator.userAgent.indexOf( "MSIE" ) + 5 ) ) === 7;
Prototype.Browser.IE8 = Prototype.Browser.IE && !Prototype.Browser.IE6 && !Prototype.Browser.IE7;

function activatearea()
{
	// unterstützt ie nicht
	var elements = $$("#home div#content");
	if (Prototype.Browser.IE){
		if ($("home"))
			elements = $$("#content");
	}
	elements.each(function(el_area)
	{
		var anchors = $(el_area).select("a[href]");
		if (anchors.size() == 1)
		{
			var href = anchors[0].getAttribute("href");
			Event.observe(el_area, "mouseover", function()
			{
				el_area.addClassName("teaserover");
			});
			Event.observe(el_area, "mouseout", function()
			{
				el_area.removeClassName("teaserover");
			});
			Event.observe(el_area, "mousedown", function()
			{
				if (href.startsWith("javascript:"))
				{
					func = href.gsub("javascript:", "");
					eval(func);
				}
				else
				{
					if ( Prototype.Browser.IE8) {
						location.href = "/" + href;
					}
					else {
						location.href = href;
					}
				}
			});
			
		}
	});
}



function searchbutton()
{
	var search_button = $('searchbutton') ? $('searchbutton') : false;
	if (search_button)
	{
		Event.observe(search_button, "mouseover", function()
		{
			search_button.addClassName("butover");
		});
		Event.observe(search_button, "mouseout", function()
		{
			search_button.removeClassName("butover");
		});
	}
}

Event.observe(window, 'load', function()
{
	//  var param = getQueryParams();
	//	if (param["debug"])
	activatearea();
	searchbutton();
});


