var showTimer = null;
var hideTimer = null;
var dropdownObj = null;
var dropdownIsActive = false;
$(document).ready(function(){
    $('.dropdown_wrapper').mouseover(function(){
    	$(this).css('cursor', 'pointer');
    }).click(function(){
        
		if (dropdownObj != this || !dropdownIsActive) {
		    $('.dropdown_content_wrapper').hide();
		    //$('.dropdown_content_wrapper:animated').stop();
		    //console.debug('hiding');
		    dropdownIsActive = true;
		    dropdownObj = this;
		                    
		    if ($.browser.msie && $.browser.version.substr(0,1) == '7') {   // Fix for ugly black bug when fading the png
		        $(dropdownObj).children('.dropdown_content_wrapper').show();
		    } else {
		        $(dropdownObj).children('.dropdown_content_wrapper').fadeIn('fast', function(){
		            //console.debug($('.dropdown_content_wrapper:visible').length);
		        });
		    }
		} else {
		
			if ($.browser.msie && $.browser.version.substr(0,1) == '7') {   // Fix for ugly black bug when fading the png
			    $(dropdownObj).children('.dropdown_content_wrapper').hide();
			} else {
			    $(dropdownObj).children('.dropdown_content_wrapper').fadeOut('fast');
			}
			dropdownIsActive = false;
		
		}
            
	}).mouseout(function(){
	
		/*if ($.browser.msie && $.browser.version.substr(0,1) == '7') {   // Fix for ugly black bug when fading the png
		    $(dropdownObj).children('.dropdown_content_wrapper').hide();
		} else {
		    $(dropdownObj).children('.dropdown_content_wrapper').fadeOut('fast');
		}
		dropdownIsActive = false;*/
		
	});
	
	
	
	
});

// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at http://www.jottings.com/obfuscator/
function obfuscate(coded, key)
{
    shift=coded.length
    link=""
    for (i=0; i<coded.length; i++)
    {
        if (key.indexOf(coded.charAt(i))==-1)
        {
            ltr = coded.charAt(i)
            link += (ltr)
        }
        else
        {
            ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
            link += (key.charAt(ltr))
        }
    }
    return link;
}