var focus_popup = null; var bdown = false; var x, y; function changeInt(num){ var temp = parseInt(num); if(isNaN(temp)){ temp = 0; } return temp; } function popup_set(p){ focus_popup = eval("document.all."+p); } function popup_move(){ if(bdown) { var distX = event.clientX - x; var distY = event.clientY - y; focus_popup.style.left =changeInt(focus_popup.style.left) + distX; focus_popup.style.top = changeInt(focus_popup.style.top) + distY; x = event.clientX; y = event.clientY; return false; } } function popup_down(){ if(event.srcElement.className == "drag") { bdown = true; x = event.clientX; y = event.clientY; } } function popup_up(){ focus_popup = null; bdown =false; } function popup_close(p,val){ focus_popup = null; bdown =false; eval("document.all." + p + ".style.display='none';"); if(val == 'c') { setCookie(p, 'done' , 1); } } function setCookie( name, value, expiredays ){ var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + expiredays ); document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" } function getCookie( name ){ var nameOfCookie = name + "="; var x = 0; while ( x <= document.cookie.length ) { var y = (x+nameOfCookie.length); if ( document.cookie.substring( x, y ) == nameOfCookie ) { if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length; return unescape( document.cookie.substring( y, endOfCookie ) ); } x = document.cookie.indexOf( " ", x ) + 1; if ( x == 0 ) break; } return ""; } document.onmousedown = popup_down; document.onmouseup = popup_up; document.onmousemove =popup_move;