﻿    $(function () {
        if ($.browser.msie && $.browser.version < 7) return;
        
        $('#navigation li')
            .removeClass('highlight')
            .find('a')
            .append('<span class="hover" />').each(function () {
                    var $span = $('> span.hover', this).css('opacity', 0);
                    $(this).hover(function () {
                        // on hover
                        $span.stop().fadeTo(700, 1);
                    }, function () {
                        // off hover
                        $span.stop().fadeTo(900, 0);
                    });
                });
                
    });
    
    function __RP_Callback_Helper(str, strCallbackEvent, splitSize, func)
    {
        var event = null;
        if (strCallbackEvent)
        {
            event = document.createEvent('Events');
            event.initEvent(strCallbackEvent, true, true);
        }
        if (str && str.length > 0)
        {
            var splitList = str.split('|');
            var strCompare = str;
            if (splitList.length == splitSize)
                strCompare = splitList[splitSize-1];
            var pluginList = document.plugins;
            for (var count = 0; count < pluginList.length; count++)
            {
                var sSrc = '';
                if (pluginList[count] && pluginList[count].src)
                    sSrc = pluginList[count].src;
                if (strCompare.length >= sSrc.length)
                {
                    if (strCompare.indexOf(sSrc) != -1)
                    {
                        func(str, count, pluginList, splitList);
                        break;
                    }
                }
            }
        }
        if (strCallbackEvent)
            document.body.dispatchEvent(event);
    }
    
    function __RP_Coord_Callback(str)
    {
        var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Coord_Callback = str;pluginList[index].__RP_Coord_Callback_Left = splitList[0];pluginList[index].__RP_Coord_Callback_Top = splitList[1];pluginList[index].__RP_Coord_Callback_Right = splitList[2];pluginList[index].__RP_Coord_Callback_Bottom = splitList[3];};__RP_Callback_Helper(str, 'rp-js-coord-callback', 5, func);}function __RP_Url_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Url_Callback = str;pluginList[index].__RP_Url_Callback_Vid = splitList[0];pluginList[index].__RP_Url_Callback_Parent = splitList[1];};__RP_Callback_Helper(str, 'rp-js-url-callback', 3, func);}function __RP_TotalBytes_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_TotalBytes_Callback = str;pluginList[index].__RP_TotalBytes_Callback_Bytes = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}function __RP_Connection_Callback(str){var func = function(str, index, pluginList, splitList){pluginList[index].__RP_Connection_Callback = str;pluginList[index].__RP_Connection_Callback_Url = splitList[0];};__RP_Callback_Helper(str, null, 2, func);}
