
	var iFrame = document;
	var jQuery = null;
	var $ = null;	

	function fctShowAuthor (strAuthor)
	{
		if (strAuthor != '')
			strAuthor += ' - Pixelio.de';
		
		$('#author_text').html( strAuthor );
	}
	
	window.onload=function()
	{	
		
		
		if (top && top.parent && top.parent.jQuery )
		{
			jQuery = top.parent.jQuery;
			$ = jQuery;
			//fctShowAuthor('');
			//top.parent.fctSwitchHeaderLogo('standard');
		}
		else
		{
			
			var actUrl = window.location.href;
			var aActUrl = actUrl.split('/');
			var page = aActUrl[ (aActUrl.length-1) ];
			window.location.href="index.html?page="+page;
		}
		
		
		if ( $ != null)
		{
			$(iFrame).find('.leistung_wrapper')
				.mouseover(function(i){
					$(this)
						.css('background-color','#c7d6db')
						.find('.leistung_header')
							.css('font-size','13px');
					$(this).find('img')
							.css('opacity','1')
							.css('filter','alpha(opacity=100)')			
					;
				})
				.mouseout(function(i){
					$(this)
						.css('background-color','white')
						.find('.leistung_header')
							.css('font-size','11px');
					$(this).find('img')
							.css('opacity','0.5')
							.css('filter','alpha(opacity=50)')
						;
				})
				.click(function(i){
					hrefLink = $(this).find('a').attr('href');
					$('#contentframe').attr('src', hrefLink);
				})
			;
			
			fctWriteEMail ();
			fctWriteTelephone ();
			
			$(iFrame).find('.praktikant_ausklappbox').hide();
		}
	}
	

	
	function fctShowIframeText(mitarbeitername)
	{
      $(iFrame).find("."+mitarbeitername).slideToggle("slow");

	}
	function fctWriteEMail ()
	{
		var mailInfo = "info";
		var mailUser = "c.schumacher";
		var mailDomain = "optimale-seite";
		var mailTopLevel = "de";
		var mailCSchumacherLink = mailUser + "@" + mailDomain + "." +mailTopLevel;
		var mailInfoLink = mailInfo + "@" + mailDomain + "." +mailTopLevel;
		$(iFrame).find('.emailCSchumacherLink').html ('<a href="mailto:'+mailCSchumacherLink+'" class="linktext textbrown">Claudia&nbsp;Schumacher</a>');
		$(iFrame).find('.emailInfoLink').html ('<a href="mailto:'+mailInfoLink+'" class="linktext textbrown">E-Mail</a>');
	}

	function fctWriteTelephone ()
	{
		var telpart1="0931/";
		var telpart2="3580169";
		$(iFrame).find('.teleNR').html (telpart1+telpart2);
	}

	
function fctSendKontaktFormular()
{
	failcount = 0;
	if (document.getElementById('name').value == "")
	{
		alert ('Bitte geben Sie einen Namen ein.');
		failcount++;
	}
	if (failcount == 0 && ( document.getElementById('email').value == "") || ! emailcheck('email') )
	{
		alert ('Bitte geben Sie Ihre E-Mailadresse ein.');
		failcount++;
	}
	if (failcount == 0 && document.getElementById('text').value == "")
	{
		alert ('Bitte geben Sie einen Text ein.');
		failcount++;
	}	
	
	if (failcount == 0)
	{
		$.post("kontakt_abschicken.html",
			 $(iFrame).find("#kontaktform").serialize() ,
			 function(data){
				alert ("Ihre Nachricht wurde verschickt.\n\nWir melden uns bei Ihnen.");
				$(iFrame).find('.emptyaftersendmail').val('');
			  }, "html");
	}


}

function emailcheck(feld_id) {
  if(document.getElementById(feld_id).value=="" || document.getElementById(feld_id).value.match(/^[a-zA-Z0-9_\.-]{2,}@[a-z0-9-]{3,}\.[a-z]{2,4}|museum$/)) {
    //document.getElementById('hinweis').innerHTML="&nbsp;";
    return true;
  }else{
    alert ("Die E-Mailadresse ist nicht g&uuml;ltig.");
    document.getElementById(feld_id).value="";
    document.getElementById(feld_id).focus();
    return false;
  }
}
