function checkBrowser()
{       
        this.ver=navigator.appVersion;
        this.dom=document.getElementById?1:0;
        this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
        this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;
        this.ie5=((this.ver.indexOf("MSIE 5")>-1 || this.ie5 || this.ie6) && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.ie4plus=(this.ie6 || this.ie5 || this.ie4);
        this.ie5plus=(this.ie6 || this.ie5)
        this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5);
        return this;
}
                        
bw = new checkBrowser();
                        
if (!document.getElementById) 
{
document.getElementById = getObjectById;
}
                        
function getObjectById(ID) 
{
        var obj;
        if (bw.dom)
                return document.getElementById(ID);
        else if (bw.ie4)
                return document.all(ID);
        else if (bw.ns4)
                return eval('document.' + ID);
}
                        
function getObjectByIdParent(ID) 
{
        var obj;
        if (bw.dom)
                return parent.document.getElementById(ID);
        else if (bw.ie4)
                return parent.document.all(ID);
        else if (bw.ns4)
                return eval('parent.document.' + ID);
}

function cancelBubble(netEvent) 
{
    if (document.all) 
    {
        window.event.cancelBubble = true;
    } 
    else 
    {
        netEvent.cancelBubble = true;
    }
}

// ########################
// NEW VERSION using jQuery
// ########################
$(document).ready( function() {

	$('.hide').hover( function() {
		$(this).show('fast');
	}, function() {
		$(this).hide('fast');
	} );
	
	$('.over > li').hover( function() {
		$('> ul ', this).show( 'fast' );
	
	}, function() {
		$('> ul ', this).hide( 'fast' );
	} );

	$('#lecture').hover( function() {
		$('#service').show('slow');
	}, function() {
		$('#service').hide('slow');
	} );
	
	$('.draggable').draggable(  {
		helper : 'clone',
		opacity: 0.7,
		handle : '> h3',
		start : function( e, ui ) {
			$(this).addClass( 'ui-dragging-source' );
		},
		stop : function( e, ui ) {
			$(this).removeClass( 'ui-dragging-source' );
		}
	} );
	
	$('.draggable').droppable( {
		accept: '.draggable',
		over : function() {
			$(this).before($( '.ui-dragging-source' ));
			}
		} );
	
	$('#left').droppable( {
		accept: function( draggable ) {
			return $(draggable).hasClass( 'draggable' )
				&& !$(this).hasClass( 'ui-dragging-source' );
		},
		activeClass: 'droppable-active',
		hoverClass: 'droppable-hover',
		drop : function( ev, ui ) {
			$(ui.helper).remove();
		}

	} );
	
	$('#right').droppable( {
		accept: '.draggable',
		activeClass: 'droppable-active',
		hoverClass: 'droppable-hover',
		drop : function( ev, ui ) {
			$(ui.helper).remove();
		}

	} );

} );
