$(document).ready(function() {
   $('.reference').click(function() {
      var Status   = $(this).html();
	  var Category = $(this).attr('title').substring(20, 21);

      if(-1 < Status.indexOf('+')) {
         $(this).html('[-]');
         $('.'+Category).show(600);
      } else if(-1 < Status.indexOf('-')) {
         $('.'+Category).hide(600);	  
         $(this).html('[+]');
      }
      return false;
   });
   $('#contact').submit(function() {
      var Fields = new Array('company', 'contact_person', 'email', 'phone', 'subject', 'message');
      var f = 0;
      var c = 0;
      for(f=0;f<Fields.length;f++) {
         Value = $('#'+Fields[f]).attr('value');   	  
         if(!Value || Value < 1) {
            $('#'+Fields[f]).css('border', '1px #ff0000 solid');
            $('#info').html('Sie m&uuml;ssen alle rot marktierten Felder ausf&uuml;llen, um das Kontaktforumlar abzusenden.');
            c++;
         } else {
            $('#'+Fields[f]).css('border', '1px #92d553 solid');
         }
      }
      return (c) ? false : true;
   });
   
   
   $('.show').click(function(){
      var Status = $(this).html();
      if(0 < Status.indexOf('+')) {
         $(this).html('[-]');
         $('#' + $(this).attr('title') + '_text').css('text-decoration', 'underline');
         $('#' + $(this).attr('title')).show(500);
      } else if(0 < Status.indexOf('-')) {
         $('#' + $(this).attr('title')).hide(500);
         $('#' + $(this).attr('title') + '_text').css('text-decoration', 'none');         
         $(this).html('[+]');
      }
      return false;
   });
   
   
   
});
