function floatInWider( setName ) {
	
	this.name = setName;
        
        this.delay = 30000;
        
        this.icontime = 0;
	
	this.url = "http://www.theworldsbestwebcam.com/survey/survey1.html";
	
	this.icon = "http://www.x10.com/images/lgo4.gif";
	
	this.documentHeight=0;
	
	this.documentWidth=0;
        
        this.move = 0;
        
        this.X = 0;
        
        this.Y = 0;
        
        this.Height = 500;
        
        this.Width = 550;
}

floatInWider.prototype.init = function(){
	
	var ns=(document.layers);
	
	var ie=(document.all);
	
	var w3=(document.getElementById && !ie);
        
	if (ie){
	
		this.documentWidth = this.truebody().offsetWidth;
	
		this.documentHeight = this.truebody().offsetHeight;
	
	} else if (ns){
	
		this.documentWidth = window.innerWidth;
	
		this.documentHeight = window.innerHeight;
	
	} else if (w3){
	
		this.documentWidth = self.innerWidth;
	
		this.documentHeight = self.innerHeight;

	} 
	
	this.buildWindow();

	setTimeout( this.name+'.slideWindow()', this.delay );
	
        if( this.icontime > 0 ) {
                
                setTimeout( this.name+'.iconify()', ( this.delay + this.icontime ) );
                
        }

        
}
floatInWider.prototype.showBody = function(){
                
        document.getElementById("TextBody").style.visibility = "visible";
        
}
floatInWider.prototype.buildWindow = function(){
	
	document.writeln("<div id=\"fIcon\" style=\"position:absolute;top:0;left:0;width:72;height:62;display:none\"><a href=\"javascript:"+this.name+".deiconify();\"><img src=\""+this.icon+"\" border=\"0\" width=\"72\" height=\"62\"></a></div>\n");
	
        document.writeln("<div id=\"fWin\" style=\"position:absolute;top:0;left:0;width:"+this.Width+";height:"+this.Height+";z-index:80\"><table cellpadding=1 cellspacing=0 border=2><tr><td align=\"right\" onmousedown=\""+this.name+".MoveWinOn(event);\" onmouseup=\""+this.name+".MoveWinOff(event);\" bgcolor=\"#5372a9\"><a href=\"javascript:"+this.name+".iconify();\"><img src=\"https://www.x10.com/images/floating_window_min_button.gif\" border=0></a><a href=\"javascript:"+this.name+".close();\"><img src=\"https://www.x10.com/images/floating_window_exit_button.gif\" border=0></a></td></tr><tr><td bgcolor=\"#000000\"><iframe name=\"IFWN\" id=\"IFWN\" src=\""+this.url+"\" frameborder=\"0\" scrolling=\"yes\" width=\""+this.Width+"\" height=\""+this.Height+"\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\"></iframe></td></tr></table></div>\n");
        
	document.getElementById("fWin").style.top = ( ( this.documentHeight - this.Height ) / 2 )+"px";
	
	document.getElementById("fWin").style.left =  0 - ( this.Width + 20 )+"px";
	
}
floatInWider.prototype.slideWindow = function(){
	
	var position = 0-this.Width;
	
	var position2 = ( position + 6 );
	
	var pause = 0;
	
	var i = 0;
	
	var movement = ( ( this.documentWidth / 2 ) + ( this.Width / 2 ) ) / 80;
	
	document.getElementById("fWin").style.top = ( document.documentElement.scrollTop > 0 )?( document.documentElement.scrollTop + 20 )+"px":( document.body.scrollTop + 20 )+"px";

	for ( i=0; i < 80; i++ ){
		
		pause=i*15;
		
		position = ( position + movement );
		
		position2 = ( position + 6 );
                
                setTimeout('document.getElementById("fWin").style.left='+position2+'+"px";', pause);
	}

	setTimeout( this.name+".MoveWinDown();", 500 );

}
floatInWider.prototype.close = function(){
	
	document.getElementById("fWin").style.display = "none";
			
}
floatInWider.prototype.iconify = function(){
	
	document.getElementById("fWin").style.display = "none";
	
	document.getElementById("fIcon").style.top = ( this.documentHeight - 72 );
	
	document.getElementById("fIcon").style.display = "block";

}
floatInWider.prototype.deiconify = function(){
	
	document.getElementById("fWin").style.display = "block";

	document.getElementById("fIcon").style.display = "none";
	
}
floatInWider.prototype.truebody = function(){
	
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
	
}
floatInWider.prototype.MoveWinOn = function(e){
        
        this.move = 1
        
        this.X = e.clientX - parseInt( document.getElementById("fWin").style.left );
        
        this.Y = e.clientY - parseInt( document.getElementById("fWin").style.top );

        return false;
	
}
floatInWider.prototype.MoveWinOff = function(e){
	
        this.move = 0;
        
        return false;
        
}
floatInWider.prototype.MoveWin = function(e){
        
        var ie=(document.all);
        
        if( floater.move ) {
                        
                if( document.getElementById && !ie) {
        
                        document.getElementById("fWin").style.top = ( e.clientY - floater.Y )+"px"; 
	
                        document.getElementById("fWin").style.left = ( e.clientX - floater.X )+"px";
                 
                } else { 

                        document.getElementById("fWin").style.top = ( event.clientY - floater.Y )+"px"; 
	
                        document.getElementById("fWin").style.left = ( event.clientX - floater.X )+"px";
                        
                }
                
        }
        
}
floatInWider.prototype.MoveWinDown = function() {

	document.getElementById("fWin").style.top = ( document.documentElement.scrollTop > 0 )?( document.documentElement.scrollTop + 20 )+"px":( document.body.scrollTop  + 20 )+"px";

	setTimeout( this.name+".MoveWinDown();", 500 );
	
}
