// JavaScript Document
var CostypeWidget = function(init){
	this.type 		= init.type 		|| 'new';
	this.userid 	= init.userid 		|| '0';
	this.width 		= init.width 		|| '170';
	this.height 	= init.height 		|| '202';
};

CostypeWidget.prototype = {
	
  _version		:	1			,
  _type			:	'new'		, // OR album
  _userid		:	0			,
  _width 		:	170		,
  _height 		: 	202		,
  _iframehtml	:	''			,
  
  makeHtml : function(){
	  var iframeurl;
		if(this.type == 'user' && isFinite(this.userid)){
			iframeurl = 'http://costype.net/resources/blogparts/' + this.userid;
		}else{
			iframeurl = 'http://costype.net/resources/blogparts/new';
		}
		this._iframehtml = '<iframe frameborder="0" src="' + iframeurl + '" style="width:' + this.width + 'px;height:' + this.height + 'px;overfllow:hidden;border: none;"></iframe>';
		return this;
  },
  
   writeHtml : function(){
		document.write(this._iframehtml);
	},
				
	bufHtml : function(){
		return this._iframehtml;
	}
};

