function movefloat(){
	
	var thediv = get('floatingwindow');
	
	if (!thediv){ return; }
	
	var thewidth = thediv.offsetWidth;
	var theheight = thediv.offsetHeight;
	
	var bodywidth = document.body.offsetWidth;
	var bodyheight = document.body.offsetHeight;
	
	var currentx = getmouse('x');
	var currenty = getmouse('y');
	
	var offsetx = 250;
	var offsety = 44;
	
	if (currentx <= offsetx){		offsetx = -50;									}
	
	if (currentx - offsetx > 0){	thediv.style.left = (currentx-offsetx)+'px';	}
	else {							thediv.style.left = '0px';						}
	
	if (currenty - offsety > 0){	thediv.style.top = (currenty-offsety)+'px';		}
	else {							thediv.style.top = '0px';						}
	
	return true;
	
}

function showfloat(image, event){
	
	if (get('floatingwindow')){ kill('floatingwindow'); }
	
	var thediv = document.createElement('div');
		
	thediv.className = 'floatingwindow';
	thediv.setAttribute('id', 'floatingwindow');
	thediv.style.backgroundImage = 'url('+image+')';
	

	if (get('windows')){		
		document.getElementById('windows').appendChild(thediv);	
		if (movefloat()){
			thediv.style.display = 'block';	
		}
	}
	
	
}

function killfloat(){
	
	kill('floatingwindow');
	
}
