jQuery.noConflict();
jQuery(document).ready(function(){

   jQuery("li.menuitem").mouseenter(function() {
     show(this);
   }).mouseleave(function(){
      hide(this);
    });

   jQuery("#contactmail").append("<a href='mai"+"lto:office"+"@"+"abixmedia."+"at'>office@"+"abixmedia"+".at</a>");
   jQuery("#footer-mail").append("<a href='mai"+"lto:office"+"@"+"abixmedia."+"at'>office@"+"abixmedia"+".at</a>");
   
  jQuery.each(jQuery.browser, function(i) {
    if(jQuery.browser.msie ){

      jQuery("li.menuitem").one("mouseenter",function(){
        var button_width = jQuery(this).width();
        var jQuerychild = jQuery(this).children("div.submenu-header");
        var margin = jQuerychild.css("margin-left").split("p")[0];
        if (margin>=0)
        {
          jQuerychild.css({'margin-left': margin - button_width + 'px'});
          jQuerychild = jQuery(this).children("div.submenu-icon");
          jQuerychild.css({'margin-left': jQuerychild.css("margin-left").split("p")[0] - button_width + 'px'});
          
          jQuerychild = jQuery(this).children("ul.submenu");
          if (jQuerychild.size()!=0)
            jQuerychild.css({'margin-left': jQuerychild.css("margin-left").split("p")[0] - button_width + 'px'});
        }
      });
    }
  });
  

}); //document ready





var open_menu_element=0;

function show(element)
{
  if(open_menu_element==0)
  {
    var child=element.firstChild;
    child=child.nextSibling;
    while(child!=null)
    {
        child.style.display="block";
        child.style.opacity="0.3"; 
        child.style.filter="alpha(opacity=30)" ;
        child=child.nextSibling;
    }
    open_menu_element=element;
    fademenu(0.3,0.05);
  } 

}



function hide(element)
{
  if(open_menu_element!=0)
  {
    //fademenu(1.0,-0.1);
        var child=open_menu_element.firstChild;
        child.style.opacity="1.0"; 
        child.style.filter="alpha(opacity=100)" ;
        child=child.nextSibling;
        while(child!=null)
        {
            child.style.display="none";
            child=child.nextSibling;
        }
        open_menu_element=0;
  }
}

    

function fademenu(opacity,step)
{
    
    if(open_menu_element!=0)
    {
      var child=open_menu_element.firstChild;
      child.style.opacity=1.3-opacity; 
      child.style.filter="alpha(opacity="+130 - opacity*100+")" ;
      child=child.nextSibling;
      while(child!=null)
      {
          child.style.display="block";
          child.style.opacity=opacity; 
          child.style.filter="alpha(opacity="+opacity*100+")" ;
          child=child.nextSibling;
      }
      opacity+=step;
      if(opacity<=1.0 && opacity>=0.30)
      {
         window.setTimeout("fademenu("+opacity+","+step+")",50);
      }
      
    }
}

function checkOrderForm()
{
  if ( document.getElementById("orderlastname").value=="" || document.getElementById("orderfirstname").value=="" ) 
  {
    alert("Bitte geben Sie Ihren Namen an");
    return false;
  }
  else if ( document.getElementById("orderstreet").value=="" || document.getElementById("orderpostal").value=="" || document.getElementById("ordercity").value=="" || document.getElementById("ordercountry").value=="" )
  {
    alert("Bitte geben Sie Ihre Adresse an.");
    return false;
  }
  var mail=document.getElementById("ordermail").value;
  if (mail.search(/\s/) != -1 || mail.search(/@*\./)==-1)
  {
    alert("Bitte geben Sie eine gueltige Email-Adresse an.");
    return false;
  }
 
}

function checkAGBForm()
{
   if(document.getElementById("orderagb").checked==false)
   {
     alert("Bitte akzeptieren Sie unsere AGBs");
   }
   else
   {
     jQuery.post("typo3conf/ext/abixmedia_hosting_registration/captcha/checkCaptcha.php", { captcha: document.getElementById("captcha").value },
     function(data)
     {
       if(data!="1")
       {
         alert("Bitte pruefen Sie nochmals den eingegebenen Code!");
       }
       else
         document.getElementById("agbform").submit();
     });
   }
}
