jQuery.fn.picframe = function(){
  i = randomid;
  return this.each(function(){
	randomid++;
     i = i + 1;
	var id = this;
	var width = $(this).width();
	var height = $(this).height();
	var float = $(this).css('float');
	//$(this).wrap('<div id="'+id+'" class="frameWrap"></div>');
	//*/
	//$(this).css("width", width+"px");
	//$(this).css("height", height+"px");
	//$(this).css("float", float);
	
	var pre = '<div class="frameT"></div><div class="frameTL"></div><div class="frameTR"></div><div class="frameB"></div><div class="frameBL"></div><div class="frameBR"></div><div class="frameL"></div><div class="frameR"></div>';
	
	var html = $(this).html();
	$(this).html(pre + html);
	var nwd = width+10 ;
	var nhd = height+10;
	$(this).children('div.frameT').css("width", nwd+"px");
	$(this).children('div.frameB').css("width", nwd+"px");
	$(this).children('div.frameL').css("height", nhd+"px");
	$(this).children('div.frameR').css("height", nhd+"px");
  });
};
	
	
var randomid = 1000;
	
$(document).ready(function(){
	$('#bigWrap').picframe();
	
});
