jQuery.noConflict();

jQuery(document).ready(function() {
   var temp;
   var temp2;
   var temp3;
   var $temp;

   function hideAll() {
      jQuery('#info-front-container .content div').each(function(){
         jQuery(this).hide()
      });
   }
   if(jQuery('body').hasClass('frontpage')){
      jQuery('#info-front-container div').each(function(){
         jQuery(this).hide()
      });
      jQuery.getScript('fileadmin/ed24.tpl/js/jquery.timers.js');
      if((jQuery.support.opacity) || (jQuery.browser.msie && jQuery.browser.version >= 6) || (jQuery.browser.opera && jQuery.browser.version >=9)){
         jQuery('#menu-front a').each(function(){
            var elementId;
            jQuery('#'+this.id).hover(
               function(){
                  $temp=jQuery(this);
                  elementId = this.id;
                  $temp.oneTime(12000, "click", function() {
                     window.location = jQuery(this).attr('href');
                  });
                  temp= $temp.attr('title');
                  $temp.attr('title','');
                  hideAll();
                  jQuery('img.logo-front').stop(true);
                  elementId = elementId.substring(elementId.lastIndexOf('_'),elementId.length);
                  jQuery('img.logo-front').fadeTo('normal',0.3,function(){
                     jQuery('#content'+elementId).fadeIn(100);
                  });
               },
               function(){
                  jQuery('img.logo-front').stop(true);
                  jQuery(this).stopTime('click').attr('title', temp);
                  jQuery('#content'+elementId).hide();
                  jQuery('img.logo-front').fadeTo('fast',1,hideAll());
                  elementId=''
               }
               );
         })
      }
   } else {
      if((jQuery.support.opacity) || (jQuery.browser.msie && jQuery.browser.version >= 6) || (jQuery.browser.opera && jQuery.browser.version >=9)){
         jQuery('#logo a').hover(
            function(){
               temp = jQuery(this).attr('title');
               jQuery(this).attr('title','');
               jQuery('img.logo-eD24').fadeTo('fast',0.3, function(){
                  temp2 = jQuery(this).attr('title');
                  temp3 = jQuery(this).attr('alt');
                  jQuery(this).attr('title','');
                  jQuery(this).attr('alt','');
                  jQuery('#logo span').show();
               });
            },
            function(){
               jQuery('img.logo-eD24').stop(true);
               jQuery('#logo span').hide();
               jQuery('img.logo-eD24').fadeTo('fast',1, function(){
                  jQuery(this).attr('title',temp2);
                  jQuery(this).attr('alt',temp3);
               });
               jQuery(this).attr('title', temp);

            }
            )
      }
   }
   if(jQuery('body').attr('id')=='nonsupported'){
      var warningIcon = '<img src="fileadmin/ed24.tpl/images/warning.png" alt="" title="" />';
      var closeIcon ='<a href="#" title="close advise" class="close"><img src="fileadmin/ed24.tpl/images/cross.png" alt="close advise" title="close advise"/></a>';
      //text += advise;
      //text+= 'You are using an old browser. We recommend you update to a newer version to improve the security, performance and usability. <br />';
      //text+= 'We recomend you to try the <a href="http://www.mozilla.com/?from=sfx&amp;uid=0&amp;t=434" target="_blank" title="Get Firefox 3.5">new Firefox 3.5</a> <a href="#" title="close advise" class="close"><img src="fileadmin/ed24.tpl/images/cross.png" alt="close advise" title="close advise"/></a>';
      if (jQuery('body').hasClass('frontpage')){
         jQuery('body').prepend('<div id="update" style="margin:-10px 0 10px 0;">'+warningIcon+adviceText+closeIcon+'</div>');
      } else {
         jQuery('body').prepend('<div id="update">'+text+'</div>');
      }
      jQuery.getScript('fileadmin/ed24.tpl/js/jquery.cookie.js', function(){
         if (jQuery.cookie("disableAdvise")!='1'){
            jQuery('#update').slideDown('normal');
         }
         jQuery('#update .close').click(function(){
            jQuery.cookie("disableAdvise", '1');
            jQuery('#update').slideUp('fast');
            return false;
         })
      });
   }
});


function decryptCharcode(n,start,end,offset){
   n=n+offset;
   if(offset>0&&n>end){
      n=start+(n-end-1);
   }else if(offset<0&&n<start){
      n=end-(start-n-1);
   }
   return String.fromCharCode(n);
}

function decryptString(enc,offset){
   var dec="";
   var len=enc.length;
   for(var i=0;i<len;i++){
      var n=enc.charCodeAt(i);
      if(n>=0x2B&&n<=0x3A){
         dec+=decryptCharcode(n,0x2B,0x3A,offset);
      }else if(n>=0x40&&n<=0x5A){
         dec+=decryptCharcode(n,0x40,0x5A,offset);
      }else if(n>=0x61&&n<=0x7A){
         dec+=decryptCharcode(n,0x61,0x7A,offset);
      }else{
         dec+=enc.charAt(i);
      }
   }
   return dec;
}

function linkTo_UnCryptMailto(s){
   location.href=decryptString(s,-2);
}
