Janelinha Móvel
Autor: Vânia Diniz | Publicado: 2008-04-19T20:24:00-07:00

Janelinha Móvelfunction protegercodigo() {if (event.button==2event.button==3) {alert('Não copie!');}}document.onmousedown=protegercodigo  var dragswitch=0  var nsx  var nsy  var nstemp  function drag_dropns(name){  temp=eval(name)  temp.captureEvents(Event.MOUSEDOWN  Event.MOUSEUP)  temp.onmousedown=gons  temp.onmousemove=dragns  temp.onmouseup=stopns  }  function gons(e){  temp.captureEvents(Event.MOUSEMOVE)  nsx=e.x  nsy=e.y  }  function dragns(e){  if (dragswitch==1){  temp.moveBy(e.x-nsx,e.y-nsy)  return false  }  }  function stopns(){  temp.releaseEvents(Event.MOUSEMOVE)  }  var dragapproved=false  function drag_dropie(){  if (dragapproved==true){  document.all.showimage.style.pixelLeft=tempx+event.clientX-iex  document.all.showimage.style.pixelTop=tempy+event.clientY-iey  return false  }  }  function initializedragie(){  iex=event.clientX  iey=event.clientY  tempx=showimage.style.pixelLeft  tempy=showimage.style.pixelTop  dragapproved=true  document.onmousemove=drag_dropie  }  if (document.all){  document.onmouseup=new Function("dragapproved=false")  }  function hidebox(){  if (document.all)  showimage.style.visibility="hidden"  else if (document.layers)  document.showimage.visibility="hide"  }  Para usar esta janelinha, copie ocódigo abaixo e cole esse código antes da tag &lt;body&gt; no código fonte dasua página.&lt;SCRIPT language=JavaScript&gt;  var dragswitch=0   var nsx  var nsy  var nstemp  function drag_dropns(name){  temp=eval(name)  temp.captureEvents(Event.MOUSEDOWN  Event.MOUSEUP)  temp.onmousedown=gons  temp.onmousemove=dragns  temp.onmouseup=stopns   }  function gons(e){  temp.captureEvents(Event.MOUSEMOVE)  nsx=e.x  nsy=e.y  }  function dragns(e){  if (dragswitch==1){  temp.moveBy(e.x-nsx,e.y-nsy)  return false   }  }  function stopns(){  temp.releaseEvents(Event.MOUSEMOVE)  }  var dragapproved=false  function drag_dropie(){  if (dragapproved==true){  document.all.showimage.style.pixelLeft=tempx+event.clientX-iex  document.all.showimage.style.pixelTop=tempy+event.clientY-iey  return false  }  }  function initializedragie(){  iex=event.clientX  iey=event.clientY  tempx=showimage.style.pixelLeft  tempy=showimage.style.pixelTop  dragapproved=true  document.onmousemove=drag_dropie  }  if (document.all){  document.onmouseup=new Function("dragapproved=false")   }  function hidebox(){  if (document.all)  showimage.style.visibility="hidden"  else if (document.layers)  document.showimage.visibility="hide"  }  &lt;/SCRIPT&gt;Depois é só copiar ocódigo abaixo e colar depois da tag &lt;BODY&gt; no código fonte da suapágina&lt;div id=showimage style="LEFT: 418px; WIDTH: 217px; POSITION: absolute; TOP: 9px; HEIGHT: 83px;"&gt;   &lt;table height=36 cellspacing=1 cellpadding=2 width=200 border=0 bgcolor=#000000&gt;    &lt;tbody&gt;     &lt;tr&gt;                             &lt;td onMouseDown=initializedragie() style="CURSOR: hand"             width="95%" height=15 bgcolor=#000000&gt;               &lt;ilayer width=100%&gt;               &lt;layer             onMouseOver=dragswitch=1;drag_dropns(showimage)             onMouseOut=dragswitch=0 width="100%" left="2" top="5"&gt;               &lt;font face=Verdana             color=#ffffff&gt;&lt;strong&gt;&lt;small&gt;Nome da Janela&lt;/small&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/layer&gt;&lt;/ilayer&gt;&lt;/td&gt;&lt;td style="CURSOR: hand" width=5% bgcolor=#000000&gt;&lt;a             onClick="hidebox();return false" href="http:///"&gt;&lt;img height=11             src="fechar.gif" width=11           border=0 align="absmiddle"&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;                        &lt;tr&gt;                   &lt;td           style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px"           width=200 colspan=2 bgcolor="#ffffff"&gt;         &lt;p align="center"&gt;&lt;small&gt;Escreva o que quiser aqui.&lt;/small&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;            &lt;/tbody&gt;          &lt;/table&gt;&lt;/div&gt;