
/*  Mega Menu */
$.fn.dropdown = function() {
  $(this).hover(function(){
    $(this).addClass("hover");
    $('> .dir',this).addClass("open");
    $('ul:first',this).css('visibility', 'visible');
  },function(){
    $(this).removeClass("hover");
    $('.open',this).removeClass("open");
    $('ul:first',this).css('visibility', 'hidden');
  });
}

/*  Tagcloud */

$(function(){
  $('form[name=newsletter-reg]').submit(function() {
    if( $('#iwagbaccepted').attr('checked') == true){
      return true;
    }
    else {      
      alert('Bitten stimmen Sie den Datenschutzbestimmungen zu.');
      return false;
    }
  });
    $('#tagcloud').tagcloud({
    zoom:120,
    min_zoom:50,
      centrex:120,
      centrey:120,
      foreground_colour:'#444',
      background_colour:'#fff'
      });
	//fix tagcloud-bug "text behind the linktag"
	$('div.point','#tagcloud').each(function(){
    	if(!$('a',this).text())$(this).contents().filter(function(){return this.nodeType==3;}).appendTo($('a',this));
	});
});



$(document).ready(function() {
  /* news box */
  $(".news-latest-item").corner("45px tl");
  /* footer background */
  $("#footer").corner("90px tl");  
  
  //Fragenpool
  currentID = 0;
  $('#questions div:eq(' + currentID + ')').fadeIn(1000);
  setInterval(function() {
    $('#questions div').fadeOut(1000);
    setTimeout(function() {
      $('#questions div:eq(' + currentID + ')').fadeIn(1000);      
    }, 1000)
    if(currentID+1 == $('#questions div').length) {
      currentID = 0;
    } else {
      currentID++;
    }          
  }, 5000)
  
  //services img clickable
  var path = window.location.hostname;
  jQuery('#content #services  #analyse').attr('url', '/solutions/geschaeftsprozessanalyse/');
  jQuery('#content #services  #analyse').click(function(){
    window.location = $(this).attr('url');
  });
  jQuery('#content #services  #erp').attr('url', '/solutions/erp-loesungen/');
  jQuery('#content #services  #erp').click(function(){
    window.location = $(this).attr('url');
  });
  jQuery('#content #services  #sap').attr('url', '/solutions/sap/');
  jQuery('#content #services  #sap').click(function(){
    window.location = $(this).attr('url');
  });
  jQuery('#content #services  #oracle').attr('url', '/solutions/oracle-e-business-suite/');
  jQuery('#content #services  #oracle').click(function(){
    window.location = $(this).attr('url');
  });
  
  //conttributionLink toggle
  jQuery('.contributionLinkFirst p').click(function(){
    jQuery('#content #c3018').toggle();
  });
  
  jQuery('.contributionLinkSec p').click(function(){
    jQuery('#content #c3019').toggle();
  });
  //contributionLink close
  jQuery('.contributionCloseFirst p').click(function(){
    jQuery('#content #c3019').hide();
  });
  
  jQuery('.contributionCloseSec p').click(function(){
    jQuery('#content #c3019').hide();
  });
  
  
  
  
});
