var mouse_x; var mouse_y; var window_mouse_x; var window_mouse_y; var window_move=false; var window_id=''; var window_zindex=10; function mouseposition(e) { mouse_x = pointeurX(e);//(navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft; mouse_y = pointeurY(e);//(navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop; } function pointeurX(e) { if (window.event) return (window.event.clientX); else return(e.pageX); } // fin pointeurX(e) // retourne la position verticale sur la page du pointeur de la souris function pointeurY(e) { if (window.event) return (window.event.clientY); else return(e.pageY); } // fin pointeurY(e) if (document.layers) { if(window.Event) { document.captureEvents(Event.MOUSEMOVE); } } function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } } document.onmousemove = mouseposition; function move_window(tmp_window_id) { if(window_move==false) { window_id=tmp_window_id; //alert(window_id); window_mouse_y=mouse_y-document.getElementById(window_id).offsetTop; window_mouse_x=mouse_x-document.getElementById(window_id).offsetLeft; window_move=true; document.getElementById(window_id).style.zIndex=window_zindex; window_zindex++; document.onmousedown=return_false; document.onclick=return_true; document.onmouseup=drop_window; if(typeof document.onselectstart!="undefined") { document.onselectstart=return_false; } drag_window(); } } function return_false() { return false; } function return_true() { return true; } function drag_window() { if(window_move) { new_y=mouse_y-window_mouse_y; new_x=mouse_x-window_mouse_x; document.getElementById(window_id).style.top=new_y + 'px'; document.getElementById(window_id).style.left=new_x + 'px'; setTimeout('drag_window()', 2); } } function drop_window() { document.onmousedown=return_true; window_move=false; if(typeof document.onselectstart!="undefined") { document.onselectstart=return_true; } document.onmouseup=return_true; } function window_on_top(tmp_window_id) { //if(window_id!=tmp_window_id) //{ window_id=tmp_window_id; document.getElementById(window_id).style.zIndex=window_zindex; window_zindex++; //} } // // INITIALISER AJAX // var xhr = null; function dev__init_ajax(){ if(window.XMLHttpRequest) // Firefox et autres xhr = new XMLHttpRequest(); else if(window.ActiveXObject){ // Internet Explorer try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } } else { alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); xhr = false; } } // // TELECARGER CONTENUS POUR UN ELEMENT // function dev__download(element_qui_change, url) { dev__init_ajax(); xhr.onreadystatechange = function() { if (navigator.appName!="Microsoft Internet Explorer") { if (xhr.readyState == 3) // accessible en partie { //var tailletelechargee = Math.round(xhr.responseText.length / 1024 *10)/10; //en ko } } if(xhr.readyState == 4 && xhr.status == 200) { if(element_qui_change!='') { document.getElementById(element_qui_change).innerHTML = xhr.responseText; } } } xhr.open("GET",url,true); xhr.send(null); }