
//
// THIS OVERRIDES THE OOTB SHAREPOINT FUNCTION WHICH CAUSES ACTIVEX INSTALL ISSUES
//
// Essentially it overrides the ootb sharepoint function which calls the activex object
// See http://support.microsoft.com/default.aspx/kb/931509 for info on the issue
//
// To use in masterpage use this syntax in the <head>:
//  	<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
//   	<script type="text/javascript" src="/_catalogs/masterpage/custom_activex_override.js"></script>


function ProcessDefaultOnLoad(onLoadFunctionNames) {
    //** Uncomment this to see when this runs
    //alert('Fixing the Issue');

    ProcessPNGImages();
    UpdateAccessibilityUI();

    //** We comment out the offending ootb function
    //** and leave the rest of the functions as they were
    //ProcessImn();
    for (var i = 0; i < onLoadFunctionNames.length; i++) {
        var expr = "if(typeof(" + onLoadFunctionNames[i] + ")=='function'){" + onLoadFunctionNames[i] + "();}";
        eval(expr);
    }
    if (typeof (_spUseDefaultFocus) != "undefined")
        DefaultFocus();
}	



/* To get webpart zones work with XHTML, MatsL override from IE55UP.JS */
function MSOLayout_GetRealOffset(StartingObject, OffsetType, EndParent)
            {
                var realValue=0;
                if (!EndParent) EndParent=document.body;
                for (var currentObject=StartingObject; currentObject && currentObject !=EndParent && currentObject != document.body; currentObject=currentObject.offsetParent)
                {
                    var offset = eval('currentObject.offset'+OffsetType);
                    if (offset) realValue+=offset;
                }
                return realValue;
            }
       

jQuery.fn.tooptip = function(options){
	var options = jQuery.extend({
		duration:100
	},options);
	return this.each(function() {
	var _tooltip = $('<div id="tooltip"></div>');
	$('body').append(_tooltip);
	$('.row-holder').mouseenter(function(e){
		var _this = this;
		setTimeout(function(){
			_tooltip.html('<div class="'+$(_this).attr('rel')+'">' + $(_this).attr('title') + '</div>');
			_tooltip.css({
				top: e.pageY - _tooltip.height(),
				left: e.pageX
			}).show();
		}, 40);
	}).mousemove(function(e){
		_tooltip.css({
			top: e.pageY - _tooltip.height(),
			left: e.pageX 
		});
	}).mouseleave(function(){
		_tooltip.hide(10, function(){
			$(this).hide();
		});
	});
});
};
function initNav(){
	$('.row').hover(function() {
		$(this).addClass("hover");
	}, function(){
		$(this).removeClass("hover");
	});
	$('.sidebar li').hover(function() {
		$(this).addClass("hover");
	}, function(){
		$(this).removeClass("hover");
	});
}
if (window.attachEvent){
	window.attachEvent("onload", initNav);
}