<html>
<head>
<style>
.widget{
width: 300;
min-height: 50px;
border: 1px solid #CACACA;
background-color: #FFFFEA;
}
</style>
<script language="JavaScript">
<!--
var x,y;
var tx, ty;
var isDrag=false;
var firefox=document.getElementById&&!document.all;
document.onmousemove=mouseMove;
document.onmousedown=selectMouse;
document.onmouseup=function(){
isDrag=false;
}
function selectMouse(e)
{
if (firefox){
//verify that user clicked the 'titlebar' element
var p=e.target;
if (p.attributes['id'] && p.attributes['id'].value=="titlebar"){
isDrag=true;
x=e.clientX;
y=e.clientY;
//get the widget coordinates from the root, 'widget1' element
tx=parseInt(document.getElementById('widget1').style.left);
ty=parseInt(document.getElementById('widget1').style.top);
}
}
else{ //IE
//verify that user clicked the 'titlebar' element
var p=event.srcElement;
if (p.attributes['id'] && p.attributes['id'].value=="titlebar"){
isDrag=true;
x=event.clientX;
y=event.clientY;
//get the widget coordinates from the root, 'widget1' element
tx=parseInt(document.getElementById('widget1').style.left);
ty=parseInt(document.getElementById('widget1').style.top);
}
}
}
function mouseMove(e)
{
if (isDrag) //only move the box if the user is dragging it
{
var box=document.getElementById("widget1");
if (firefox){
box.style.left = e.clientX + (tx - x);
box.style.top = e.clientY + (ty - y);
}
else{ //IE
box.style.left = event.clientX + (tx - x);
box.style.top = event.clientY + (ty - y);
}
}
}
//-->
</script>
</head>
<body>
<br>
<h3>Test</h3>
<div id='widget1' class='widget' style='position: absolute; left: 150;top: 150; width: 250;'>
<div style='cursor: move; width: 100%; height: 16; background-color: #CCCCFF; border-bottom: 1px solid #CACACA; '>
<table style='font-family: arial; font-size: 8pt;' width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td ALIGN=left id='titlebar' style='padding-left: 5px;'>Chat se Sefem</td>
<td align=right style='padding-right: 5px;'> <a href='#' style='text-decoration:none;'><b>X</b></a></td>
</tr>
</table>
</div>
<div id='' style='padding: 5px; font-family: arial; font-size: 8pt; width: 100%'>
<iframe style="border: 2px solid rgb(255, 221, 170);" src="http://live.jabbim.cz/brebentitko/brebex.html?jid=sef@njs.netlab.cz" height="450" width="250"></iframe>
</div>
</div>
</body>
</html>