var Framed = function(rounded) {
	this.box = $('.framed').clone()[0];
	if(rounded)
		$(this.box).addClass('rounded');
	document.body.appendChild(this.box);
	this.box_inner = $(this.box).find('.framed_inner')[0];
	this.box_is_show = false;
	this.box_hide_timer = false;	
	this.box_inner_size = {width: false, height: false}
	var self = this;
	
	this.show = function() {		
		this.box_is_show = true;
		this.box.style.display = 'block';
	}
	
	this.hide = function() {
		this.box.style.display = 'none';		
	}
	
	
	this.setPosition = function(e) {
		if(e.pageX == null) {
			e.pageX = e.clientX + document.documentElement.scrollLeft;
			e.pageY = e.clientY + document.documentElement.scrollTop;
		}
		var size = windowSize();
		
			
		this.box.style.left = e.pageX + 20 + 'px';
		if($.browser.msie && /6/.test($.browser.version)) 
			this.box.style.bottom = size.vh - e.pageY + 15 + 'px';		
		else
			this.box.style.bottom = size.ch - e.pageY + 15 + 'px';		
	}
	
	this.setCenter = function(width, height) {
		var size = windowSize();
		this.box.style.left = size.vw / 2 - width / 2 + 'px';
		this.box.style.top = size.ch / 2 - height / 2 + size.st + 'px';
	}
	
	this.size = function(elem) {		
		var div = document.createElement('div');	
		div.style.width = '2000px';
		div.style.height = '2000px';
		div.style.overflow = 'scroll';
		div.style.position = 'absolute';
		div.style.top = '-10000px';				
		
		div.appendChild(elem);
		document.body.appendChild(div);
		var width = elem.offsetWidth, height = elem.offsetHeight;
		document.body.removeChild(div);
		//alert(height+' '+width);
		this.box_inner_size.width = width;
		this.box_inner_size.height = height;
	}
	
	
	
}