var x_pos = 0;
var y_pos = 0; 
var y_on = 0;
var x_on = 0;

var x_pos2 = 800;
var y_pos2 = 20; 
var y_on2 = 0;
var x_on2 = 0;

	function changePos(id,i) {		
		var step =1;
		var Hoffset = 10;
		var Woffset = 10;
		var width = document.body.clientWidth;
		var height = document.body.clientHeight;
		Hoffset = $(id).offsetHeight;
		Woffset = $(id).offsetWidth;
		if(i=='1'){
			$(id).style.top =y_pos+'px';
			$(id).style.left = x_pos+document.body.scrollLeft+'px';
			if (y_on){
				y_pos = y_pos + step;
				}
			else {
				y_pos = y_pos - step;
				}
			if (y_pos < 0){
				y_on = 1;
				y_pos = 0;
				}
			if (y_pos >= (height - Hoffset)) {
				y_on = 0;
				y_pos = (height - Hoffset);
				}
			if (x_on) {
				x_pos = x_pos + step;
				}
			else {
				x_pos = x_pos - step;
				}
			if (x_pos < 0) {
				x_on = 1;
				x_pos = 0;
				}
			if (x_pos >= (width - Woffset))	{
				x_on = 0;
				x_pos = (width - Woffset);
				}
			}
		else if(i=='2'){
			$(id).style.top =y_pos2+'px';
			$(id).style.left = x_pos2+document.body.scrollLeft+'px';
			if (y_on2){
				y_pos2 = y_pos2 + step;
				}
			else {
				y_pos2 = y_pos2 - step;
				}
			if (y_pos2 < 0){
				y_on2 = 1;
				y_pos2 = 0;
				}
			if (y_pos2 >= (height - Hoffset)) {
				y_on2 = 0;
				y_pos2 = (height - Hoffset);
				}
			if (x_on2) {
				x_pos2 = x_pos2 + step;
				}
			else {
				x_pos2 = x_pos2 - step;
				}
			if (x_pos2 < 0) {
				x_on2 = 1;
				x_pos2 = 0;
				}
			if (x_pos2 >= (width - Woffset))	{
				x_on2 = 0;
				x_pos2 = (width - Woffset);
				}
			}		
		}

	function floatAD001Start(id,i) {	
$(id).visibility = 'visible';
		var interval = setInterval("changePos('"+id+"','"+i+"')", 30);
		}
	
	function closeFloatAD(id){
		$(id).style.display="none";
	}
