$(document).ready(function()
{
    if(NiftyCheck())
	{
		for( var i = 0; i <= 13; i++ )
		{
			Rounded("a#activeNav" + i, "tl tr", "#ffffff", "#b5baf7", "border #666666");
			Rounded("a#inactiveNav" + i, "tl tr", "#ffffff", "#ffffff", "border #666666");
			Rounded("a#activeSubNav" + i, "tl tr", "#b5baf7", "#ffffff", "border #666666");
			Rounded("a#inactiveSubNav" + i, "tl tr", "#b5baf7", "#b5baf7", "border #666666");
		}

        Rounded("a#GalleryInactiveNav", "tl tr", "#ffffff", "#f3a72c", "border #666666");
        Rounded("a#CamsInactiveNav", "tl tr", "#ffffff", "#f3a72c", "border #666666");
        Rounded("a#DatingInactiveNav", "tl tr", "#ffffff", "#A867CF", "border #666666");

        Rounded("a#AFFActiveNav", "tl tr", "#ffffff", "#f3a72c", "border #666666");
        Rounded("a#AFFInactiveNav", "tl tr", "#ffffff", "#f3a72c", "border #666666");

		Rounded("a.btn", "tl tr bl br", "#ffffff", "#b5baf7", "border #666666");
		Rounded("a.yggasdryl", "tl tr bl br", "#ffffff", "#0000a8", "border #666666");
		
		Rounded("a.channelActive","tl tr bl br","#b5baf7","#ffffff","border #666666");
		Rounded("a.channelInactive","tl tr bl br","#b5baf7","#b5baf7","border #666666");
        
        Rounded("div.FeaturedVideos","tl tr bl br","#ffffff","#ffffff","border #666666");
    }

    // Make buttons look like buttons.
    $('a.btn').each(function()
    {
        $(this).html('<i></i><span><span></span><i></i>'+ $(this).html() +'</span>')
    });

});

function showOnlineFriends()
{
    window.open( "modules.php?name=YuPeople&action=list_online_friends", "OnlineFriends", "width=400,height=397,toolbar=0,directories=0,menubar=0,status=0,location=0,scrollbars=0,resizable=1" );
}


// Fix for FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=388714
var checkIframes = function()
{
	for (i=0; i<window.frames.length; i++)
	{
		try
		{
			if (window.frames[i].document.location.href !=
			window.frames[i].frameElement.src &&
			!(window.frames[i].document.location.href == document.location.href &&
			window.frames[i].frameElement.src == 'about:blank'))
			{
			window.frames[i].frameElement.src = window.frames[i].frameElement.src;
			}
		} catch(e) {}
	}
};

var userAgent = navigator.userAgent.toLowerCase();
if (userAgent)
{
	var browserFirefox = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );
	if (browserFirefox)
	{
		$(document).ready(checkIframes);
	}
}
