  
  function ajax(objID, task) {
    $.get(baseURL + '/ajax.php?ajax=' + task, function(c) {
      $('#' + objID).html(c);
    });
  }  
  
  function ajaxInput(objID, task, l) {
    $.get(baseURL + '/ajax.php?ajax=' + task, function(c) {
      $(objID).val(c).html(c);
      if(l) inputLength(objID);
    });
  }
  
  function inputLength(objID) {
    $(objID).css('width', ($(objID).val().length * 7.2) + 'px');
  }
  
  function setConsumption(val) {		
		$('#totalconsumption_short').val(val + ' kWh');
    if($('#zipcode_short').val().length != 5) $('#zipcode_short').focus();
    else $('form#kurzrechner').submit();
	}  
  
  $(document).ready(function() {
    $('a.blank').attr('target', '_blank');
    $('input[name="s"]').val(99);
    if($.browser.msie) { $('head').append('<link rel="stylesheet" type="text/css" href="' + baseURL + '/_css/ie.css" media="screen" />'); }
    
  // remove input onclick
    var c = new Array();
    $('input.click').each(function() {
      c[$(this).attr('id')] = $(this).val();
      $(this).focus(function() {
        if($(this).val() == c[$(this).attr('id')]) $(this).val('');
      });
      $(this).blur(function() {
        if($(this).val() == '') $(this).val(c[$(this).attr('id')]);
      });
    });
    
  // text shadow for non CSS3 Browsers
    $('h1[class!="noshadow"], h2[class!="noshadow"], .shadow').textShadow();   
    
  // check required fields 
    var fields;
    if(fields && fields.length > 0) {    
      $.each(fields.split(','), function(a, b) {
        if(b.length > 0) {
          $('label[for=' + b + ']').addClass('red');
        }
      });
    }
    
  // read more 
    $('div.readmore a').click(function() {    
      $('div.' + $(this).parent().attr('id')).slideDown();
      $(this).parent().slideUp();
    });
  });
