$(document).ready( function()
{
	$("#q").focus(function()
        {
        	if (this.value == 'Suche') this.value ='';
			$(this).addClass("searchfield-entry");
			$("#qfield").addClass("search-btn-entry");
		});

        $("#q").blur(function()
        {
        	if (this.value == '') this.value ='Suche';
			$(this).removeClass("searchfield-entry");
			$("#qfield").removeClass("search-btn-entry");
		});	
});

$(document).ready(function(){
	$("#news-feed").hover(function() {
		$(this).attr("src","/_layout/images/icon_news_feed_1.jpg");
			}, function() {
		$(this).attr("src","/_layout/images/icon_news_feed.jpg");
	});
});

$(document).ready(function(){
	$("#xing").hover(function() {
		$(this).attr("src","/_layout/images/icon_xing_1.jpg");
			}, function() {
		$(this).attr("src","/_layout/images/icon_xing.jpg");
	});
});

$(document).ready(function(){
	$("#twitter").hover(function() {
		$(this).attr("src","/_layout/images/icon_twitter_1.jpg");
			}, function() {
		$(this).attr("src","/_layout/images/icon_twitter.jpg");
	});
});

$(document).ready(function(){
	$("#facebook").hover(function() {
		$(this).attr("src","/_layout/images/icon_facebook_1.jpg");
			}, function() {
		$(this).attr("src","/_layout/images/icon_facebook.jpg");
	});
});

$(document).ready( function(){
	$("#Name").focus(function()
        {
        	if (this.value == 'Name*') this.value ='';
		});
        $("#Name").blur(function()
        {
        	if (this.value == '') this.value ='Name*';
		});	
});

$(document).ready( function(){
	$("#Firma").focus(function()
        {
        	if (this.value == 'Firma') this.value ='';
		});
        $("#Firma").blur(function()
        {
        	if (this.value == '') this.value ='Firma';
		});	
});

$(document).ready( function(){
	$("#Telefon").focus(function()
        {
        	if (this.value == 'Telefon') this.value ='';
		});
        $("#Telefon").blur(function()
        {
        	if (this.value == '') this.value ='Telefon';
		});	
});

$(document).ready( function(){
	$("#from").focus(function()
        {
        	if (this.value == 'E-Mail*') this.value ='';
		});
        $("#from").blur(function()
        {
        	if (this.value == '') this.value ='E-Mail*';
		});	
});

$(document).ready( function(){
	$("#Nachricht").focus(function()
        {
        	if (this.value == 'Nachricht') this.value ='';
		});
        $("#Nachricht").blur(function()
        {
        	if (this.value == '') this.value ='Nachricht';
		});	
});

function dialogSubmit() {
	var Teststring = $("#from").val();
	var check1 = Teststring.indexOf ('@',0);
	var check2 = Teststring.indexOf ('.',0);
	
	if ($("#Name").val() == "" || $("#Name").val() == "Name*") {
		alert("Bitte geben Sie Ihren Namen ein!");
		$("#Name").focus();
	} else if ($("#from").val() == "" || check1 == "-1" || check2 == "-1" || $("#from").val() == "E-Mail*") {
		alert("Bitte geben Sie Ihre E-Mail Adresse!");
		$("#from").focus();
	} else {
		document.forms.dialog.submit();
	}
}



$(function() {
    $("#back")
        .mouseover(function() { 
            var src = $(this).attr("src").match(/[^\.]+/) + "_over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("_over", "");
            $(this).attr("src", src);
        });
});

$(function() {
    $("#forward")
        .mouseover(function() { 
            var src = $(this).attr("src").match(/[^\.]+/) + "_over.png";
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).attr("src").replace("_over", "");
            $(this).attr("src", src);
        });
});

