$(document).ready(function() {
	$('#tabs-container > ul').tabs();
//	$('#tabs-container').tabs({ fxAutoHeight: true });

	$('#mailform').validate({
		rules: {
			'tx_mscrcontact_m[contactRequest][name]': {
				required: true								
			},
			'tx_mscrcontact_m[contactRequest][street]': {
				required: true
			},																
			'tx_mscrcontact_m[contactRequest][city]': {
				required: true
			},
			'tx_mscrcontact_m[contactRequest][country]': {
				required: true
			},	
			'tx_mscrcontact_m[contactRequest][email]': {
				required: true,
				email: true
			},											
			'tx_mscrcontact_m[contactRequest][message]': {
				required: true								
			}										
		},
		messages: {
			'tx_mscrcontact_m[contactRequest][company]': '',
			'tx_mscrcontact_m[contactRequest][name]': 'Bitte füllen Sie dieses Feld aus!',							
			'tx_mscrcontact_m[contactRequest][street]': 'Bitte füllen Sie dieses Feld aus!',							
			'tx_mscrcontact_m[contactRequest][city]': 'Bitte füllen Sie dieses Feld aus!',							
			'tx_mscrcontact_m[contactRequest][country]': 'Bitte füllen Sie dieses Feld aus!',							
			'tx_mscrcontact_m[contactRequest][telephone]': '',							
			'tx_mscrcontact_m[contactRequest][email]': 'Bitte geben Sie eine gültige Email-Adresse ein!',							
			'tx_mscrcontact_m[contactRequest][message]': 'Bitte füllen Sie dieses Feld aus!'						
		}
	});

    // hover for social links
    $(".facebook-link, .twitter-link").hover(function() {
        var src = $(this).find('img').attr('src').match(/[^\.]+/)[0].replace('-hl', '') + '-hl.png';
        $(this).find('img').attr('src', src);
    }, function () {
        var src = $(this).find('img').attr('src').replace('-hl', '');
        $(this).find('img').attr('src', src);
    });
    $(".facebook-link, .twitter-link").focus(function() {
        var src = $(this).find('img').attr('src').match(/[^\.]+/)[0].replace('-hl', '')  + '-hl.png';
        $(this).find('img').attr('src', src);
    });
    $(".facebook-link, .twitter-link").blur(function() {
        var src = $(this).find('img').attr('src').replace('-hl', '');
        $(this).find('img').attr('src', src);
    });

	$('.colorbox').colorbox({maxWidth:"650",maxHeight:"650"});
});
