window.onload = externalLinks;

function externalLinks()
{
	if( !document.getElementsByTagName )
		return false;
	
	var links, a, i;
	links = document.getElementsByTagName( 'a' );
	
	for( i=0; i<links.length; i++ )
	{
		a = links[ i ];
		if( a.getAttribute('rel') && a.getAttribute('rel').indexOf('external') > -1 )
		{
			a.className = 'external '+a.className;
			a.onclick = function()
			{
				window.open(this.href);
				return false;
			}
		}
	}
}

function getElement( targetId )
{

	if(document.getElementById)
	{
		target = document.getElementById( targetId );
	}
	else if(document.all)
	{
		target = document.all[ targetId ];
	}
	else if(document.layers)
	{
		target = document.layers[ targetId ];
	}
	
	return target;
	
}

function toggleList( targetId )
{
	
	//alert( targetId+' | '+targetId.parentNode.parentNode.id );
	target = getElement( targetId.parentNode.parentNode.id );
	target.className = target.className == '' ? 'act' : '';

	//return false;
	
}

function ctrlForm()
{

	vorname = getElement( 'vorname' );
	name = getElement( 'name' );
	email = getElement( 'email' );

	if( vorname.value == '' )
	{
		vorname.focus();
		return false;
	}

	if( name.value == '' )
	{
		name.focus();
		return false;
	}

	if( email.value == '' )
	{
		email.focus();
		return false;
	}

	//alert( '__END__' );
	return true;

}
