﻿$(function() {
    $("#accordion").accordion({ active: 1000, fillSpace: false, collapsible: true, autoHeight: false });
	var zIndexNumber = 1000;
	
   
});

function isIE()
{
 if(navigator.userAgent.match(/MSIE \d\.\d+/))
       return true;
  return false;
}

$(function() {
	var zIndexNumber = 20000;
	$('div').each(function() {
	    if(isIE())
	    {
		    $(this).css('zIndex', zIndexNumber);
		    zIndexNumber -= 10;
		}
	});
});


var timeout = 500;
var closetimer = 0;
var ddmenuitem = 0;

function jsddm_open()
{  jsddm_canceltimer();
   jsddm_close();
   ddmenuitem = $(this).find('ul').css('visibility', 'visible');}

function jsddm_close()
{  if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');}

function jsddm_timer()
{  closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{  if(closetimer)
   {  window.clearTimeout(closetimer);
      closetimer = null;}}

$(document).ready(function()
{  $('ul.tw-menuLevel1 > li').bind('mouseover', jsddm_open)
   $('ul.tw-menuLevel1 > li').bind('mouseout',  jsddm_timer)});

document.onclick = jsddm_close;



/*
function isIE()
{
 if(navigator.userAgent.match(/MSIE \d\.\d+/))
       return true;
  return false;
}
function zIndexWorkaround()
{
    if(isIE())
    {

        $(".box-popup").parents().each(function() {
            var p = $(this);
            var pos = p.css("position");

            if(pos == "relative" ||
               pos == "absolute" ||
               pos == "fixed")
            {
                p.hover(function() {
                        $(this).addClass("on-top");
                    },
                    function() {
                        $(this).removeClass("on-top");
                    });
            }
        });
    }
}
jQuery(zIndexWorkaround);
*/

