Project

General

Profile

Feature #12023 ยป custom_javascript.js

bmbmnb - Kevin Saliou, 2012-10-04 21:49

 
1
$(document).ready(function()
2
{
3
	// Record mouseovers on the banner ad.
4
	var bnadmoused = false;
5
	$('#bannerTop').bind('mouseover', function( event )
6
	{
7
		if( !bnadmoused )
8
		{
9
			bnadmoused = true;
10
			$.post( 'modules.php',
11
				{
12
					name: "Video",
13
					op: "ad_click",
14
					ad_id: "bannerTop",
15
					video_id: "",
16
					campaign: $.cookie('campaign')
17
				}
18
			);
19
		}
20
	});
21
	// Record mouseovers on the banner ad.
22
	var bnadmoused = false;
23
	$('#bnad980x120 iframe').bind('mouseover', function( event )
24
	{
25
		if( !bnadmoused )
26
		{
27
			bnadmoused = true;
28
			$.post( 'modules.php',
29
				{
30
					name: "Video",
31
					op: "ad_click",
32
					ad_id: "bnad980x120",
33
					video_id: "",
34
					campaign: $.cookie('campaign')
35
				}
36
			);
37
		}
38
	});
39
});
40

    
41
function showOnlineFriends()
42
{
43
    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" );
44
}
45

    
46

    
47
// Fix for FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=388714
48
var checkIframes = function()
49
{
50
	for (i=0; i<window.frames.length; i++)
51
	{
52
		try
53
		{
54
			if (window.frames[i].document.location.href !=
55
			window.frames[i].frameElement.src &&
56
			!(window.frames[i].document.location.href == document.location.href &&
57
			window.frames[i].frameElement.src == 'about:blank'))
58
			{
59
			window.frames[i].frameElement.src = window.frames[i].frameElement.src;
60
			}
61
		} catch(e) {}
62
	}
63
};
64

    
65
var userAgent = navigator.userAgent.toLowerCase();
66
if (userAgent)
67
{
68
	var browserFirefox = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );
69
	if (browserFirefox)
70
	{
71
		//$(document).ready(checkIframes);
72
	}
73
}
    (1-1/1)