/*
* File : javascripts/js_general.php
* Date : July 2009
* Authors : M. LATARD
* Project : Peritec Site Web
*/
var x = navigator;
function anim() {
$(".qtip").fadeTo("fast", 0, function() {
$(".qtip").fadeTo("fast", 1);
});
}
function animIE() {
$(".qtip").animate({opacity:'hide'},100, function() {
$(".qtip").animate({opacity:'show'},100);
});
}
function closebulle() {
$.cookies.set("PeritecWebsite", "1");
$(".qtip").hide();
}
//$(document).ready(function() {
$(function() {
var showqtip = true;
if ($.cookies.get("PeritecWebsite")== "1") {
showqtip = false;
$(".qtip").hide();
}
$('#header').qtip(
{
content: 'Actualités
Inspection Bac et cuvette',
position: {
corner: {
tooltip: 'bottomLeft', // Use the corner...
target: 'bottomMiddle' // ...and opposite corner
}
},
show: {
when: false, // Don't specify a show event
ready: showqtip, // Show the tooltip when ready
effect: {
type: 'fade',
length: 100
}
},
hide: false, // Don't specify a hide event
style: {
border: {
radius: 3
},
name: 'green', // Inherit from preset style
tip: 'bottomLeft',
height: 40,
width: 175
}
});
if (x.appName=='Microsoft Internet Explorer') {
$('.qtip').css('margin-top','-42px');
$('.qtip').css('background-color','#EFEFEF');
setInterval('anim();',3000);
}
else {
setInterval('anim();',3000);
}
var calcul = $(window).height()-$('#header').height()-$('#footer').height()-6;
$('#global').css("min-height",calcul);
$('.img_menu_change').hover(function() {
$(this).stop().fadeTo(400,0);
}, function() {
$(this).stop().fadeTo(400,1);
});
/*$('area').hover(function() {
link_zone_lieu(this);
}, function() {
unlink_zone_lieu(this);
});*/
$('#tableau_environnement').click(function() {
var url = "index.php?page=5";
window.location.href= url;
});
$('#tableau_risquesetsecurite').click(function() {
var url = "index.php?page=6";
window.location.href= url;
});
$('#tableau_inspection').click(function() {
var url = "index.php?page=7";
window.location.href= url;
});
$('#tableau_procede').click(function() {
var url = "index.php?page=8";
window.location.href= url;
});
$('#tableau_inspection, #tableau_environnement, #tableau_risquesetsecurite, #tableau_procede').hover(function() {
$(this).stop().animate({backgroundColor: "#CCE69A"},"fast");
}, function() {
$(this).stop().animate({backgroundColor: "#EFEFEF"},"fast");
});
});
function link_zone_lieu(zone) {
alert(zone.id);
var myzone = zone.id;
var mylieu = myzone.substr(myzone.lastIndexOf('_'),3);
$('#lieu'+mylieu).css("color","red");
}
function unlink_zone_lieu(zone) {
var myzone = zone.id;
var mylieu = myzone.substr(myzone.lastIndexOf('_'),3);
$('#lieu'+mylieu).css("color","#98C012");
}