1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| var alreadyClicked = 0;
var pu = function(url,link) {
pop_width = 1100;
pop_height = 800;
pop_url = url;
alreadyClicked = 1;
var screenTop = (window.screenTop != undefined) ? window.screenTop : window.screenY;
var screenLeft = (window.screenLeft != undefined) ? window.screenLeft : window.screenX;
var screenW = 0;
var screenH = 0;
if (typeof window.innerWidth == "number") {
screenW = window.innerWidth;
screenH = window.innerHeight;
} else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
screenW = document.documentElement.clientWidth;
screenH = document.documentElement.clientHeight;
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
screenW = document.body.clientWidth;
screenH = document.body.clientHeight;
}
var pxLeft = (screenLeft + (screenW / 2) - (pop_width / 2));
var pxTop = (screenTop + (screenH / 2) - (pop_height / 2));
var win = window.open(pop_url, "", "width=" + pop_width + ", height=" + pop_height + ", scrollbars=yes,resizable=yes,toolbar=no, menubar=no,status=no,location=no,left=" + pxLeft + ",top=" + pxTop);
win.blur();
window.focus();
if (typeof win.window.mozPaintCount != "undefined") {
win.window.open("about:blank").close();
window.focus();
}
}
var waiting = function (url,link) {
if (window.chrome) {
link.addEventListener("mousedown", function (e) {
pu(url,link);
});
link.addEventListener("click", function (e) {
if (alreadyClicked == 1) {
alreadyClicked = 2;
window.open("about:blank").close();
}
});
} else {
link.addEventListener("click", pu);
}
}
$(document).ready(function(){
if (top = self) {
$(".link_black_grey_bold,.link_black_blue_b_u").click(function() {
var a=$(this).attr('href');
pu(a,this);
});
}else{
$(".link_black_grey_bold_search,.link_black_blue_b_u_search").click(function() {_gaq.push(['_trackEvent', 'clic-search', 'sortie ' + jQuery(this).attr('href')]); });
}
}); |
Partager