/*
 * タグ JavaScript
 *
 *
 * Copyright (c) 2003 DRECOM CO.,LTD. All rights reserved.
 * 
 * info@drecom.co.jp
 * http://www.drecom.co.jp/
 */


/**
 * String scanner
 * 
 * @param aString     文字列
 * @param packNewline getc() で改行 (CR, CRLF, LF) をすべて LF に変換するか
 */
function StringPointer(aString, packNewline)
{
	this.string = aString;
	this.location = 0;
	
	if (this.string == null) {
		this.string = '';
	}
	
	this.packNewline = packNewline;
}
StringPointer.prototype.getString = function() { return this.string; }
StringPointer.prototype.getLocation = function() { return this.location; }
StringPointer.prototype.setLocation = function(anIndex)
{
	if (anIndex > this.string.length) {
		throw ASSERT_EXCEPTION + 'attempt to set bounding over location.';
	}
	this.location = anIndex;
}
StringPointer.prototype.isAtEnd = function() { return this.string.length <= this.location; }

StringPointer.prototype._getc = function() 
{
	return this.isAtEnd() ? null : this.string.charCodeAt(this.location++);
}
StringPointer.prototype.getc = function() 
{
	var c = this._getc();
	
	if (c == null) {
		return null;
	}
	
	if (this.packNewline && c == XBSCType.CR) {
		var nextc = this._getc();
		
		if (nextc != XBSCType.LF && nextc != null) {
			this.pushback();
		}
		c = XBSCType.LF;
	}
	return c;
}
StringPointer.prototype.pushback = function()
{
	this.location--;
	if (this.location < 0) this.location = 0;
}

StringPointer.prototype.readSpaces = function()
{
	var ret = false;
	var c;
	
	while (c = this.getc()) {
		if (!XBSCType.isspace(c)) {
			this.pushback();
			break;
		}
		ret = true;
	}
	return ret;
}
StringPointer.prototype.readUpToString = function(/* String */ stopString)
{
	var i = this.string.indexOf(stopString, this.location);
	if (i == -1) {
		return false;
	}
	this.location = i + stopString.length;
	return true;
}
StringPointer.prototype.readChar = function(aCharacter)
{
	if (this.isAtEnd()) {
		return false;
	}
	var c = this.getc();
	
	if (c == aCharacter) {
		return true;
	} else {
		this.pushback();
		return false;
	}
	return false;
}
XBSUtil.indexOfCharacter = function(aString, c)
{
	var i;
	var len = aString.length;
	
	for (i = 0; i < len; i++) {
		if (c == aString.charCodeAt(i)) {
			return i;
		}
	}
	return -1;
}
StringPointer.prototype.scanUpToCharactersIn = function(/* String */ stopChars)
{	
	var fromIndex = this.getLocation();
	var toIndex   = fromIndex;
	
	if (stopChars == null) {
		stopChars = '';
	}
	while (c = this.getc()) {
		if (XBSUtil.indexOfCharacter(stopChars, c) != -1) {
			this.pushback();
			break;
		}
		toIndex++;
	}
	// end 
	if (toIndex == this.string.length) {
		this.location = fromIndex;
		return null;
	}
	
	if (fromIndex == toIndex) {
		return '';
	}
	
	return this.string.substring(fromIndex, toIndex);
}
// substring stuffs
StringPointer.prototype.substring = function(/* Integer */ fromIndex, toIndex)
{
	return this.string.substring(fromIndex, toIndex);
}
StringPointer.prototype.substringFrom = function(/* Integer */ fromIndex)
{
	return this.substring(fromIndex, this.location);
}

//---------------------------------------------------------------------------------
// Tag
//---------------------------------------------------------------------------------
/**
 * Tag:
 * タグオブジェクト。<A hoge="foo"> と </A> は別々のインスタンスになる。
 * オブジェクト自体にはタグ関連の機能をまとめてある
 * 
 * @param aTagName タグ名
 * @param aSource テキスト
 * @param isEndTag 閉じタグか
 * @author  Takanori Ishikawa
 * @version 1.0
 */
Tag = function(aTagName, aSource, isEndTag) 
{
	this.name = aTagName;
	this.source = aSource;
	this.value = '';
	this.isEnd = !(!isEndTag);
	this.isComment = false;
}
Tag.prototype.getName   = function() { return this.name; }
Tag.prototype.getSource = function() { return this.source; }
Tag.prototype.getValue  = function() { return this.value; }

// タグ定義
TagDefs = new Object();
TagDefs['斜'] 		= ['span', 'style="font-style: italic;"'];
TagDefs['太'] 		= ['span', 'style="font-weight: bold;"'];
TagDefs['大']   	= ['span', 'style="font-size: 125%;"'];
TagDefs['特大']		= ['span', 'style="font-size: 150%;"'];
TagDefs['小']     	= ['span', 'style="font-size: 75%;"'];
TagDefs['下線']   	= ['span', 'style="text-decoration: underline;"'];
TagDefs['打消線'] 	= ['span', 'style="text-decoration: line-through;"'];
// @see /WEB-INF/src/mlparser/tag/mlparser-tag.xml
TagDefs['引用'] 	= ['div,blockquote', 'class="tag_quote"'];
TagDefs['コード'] 	= ['pre', 'class="tag_code"'];
TagDefs['左']		= ['div', 'style="text-align: left;"'];
TagDefs['中']		= ['div', 'style="text-align: center;"'];
TagDefs['右']		= ['div', 'style="text-align: right;"'];
TagDefs['リンク']		= ['a', 'href="', '" target="_blank"'];
TagDefs['色']		= ['span', 'style="color: ', ';"'];

/**
 * 絵文字
 */
//絵文字はいったんJAVAで出力するようにした　WEB-INF\view\entry\entry_write_edit_js.jspを見てください

//タグの種類
Tag.TYPE_CSS = 0;
Tag.TYPE_DEPRECATED_HTML = 1;
Tag.TYPE_JP = 2;
Tag.getDefaultType = function() { return Tag.TYPE_JP; }

// shortcut
gTagType = Tag.getDefaultType();

// 絵文字のURLパス
Tag.VIEW_EMOJI_PATH = '/image/emoji/';
Tag.MEMBERS_EMOJI_PATH = '/image/emoji/';

/**
 * 改行をタグに変換するときのテキスト
 */
Tag.BR_TEXT  = '<br>' + OEMBlogGlobal.lineSeparator;
Tag.LT_TEXT  = '&lt;';
Tag.GT_TEXT  = '&gt;';
Tag.AMP_TEXT = '&amp;';

/**
 * 検索オプションを指定するための定数
 * 
 * <ul>
 * <li>BackwardSearch - 後方検索</li>
 * <li>AnchoredSearch - 文字列の先頭、または終端のみで一致</li>
 */
Tag.BackwardSearch = 1;
Tag.AnchoredSearch = 1 << 1;


Tag.findCustomTag = function(aText, option, start)
{
	var tag = Tag.findTag(aText, option, start);
	
	return (tag == null || tag.isCustomTag() == false) ? null : tag;
}

/**
 * text の中からタグを検索する。
 * 
 * @param aText 　検索対象の文字列
 * @param option 検索オプション定数を OR したもの
 * @param start　 検索開始位置（オプション）
 * @return 　　　　　Tag オブジェクト
 */
Tag.findTag = function(aText, option, start)
{
	var anchor  = null;    // AnchoredSearch 設定時の開始文字
	var sp      = null;
	
	if (null == aText || 0 == aText.length) {
		return null;
	}
	sp = new StringPointer(aText);
	
	if (start == null) {
		start = (option & Tag.BackwardSearch) ? aText.length -1 : 0;
	}
	
	//
	// Anchor オプションの処理
	// 検索開始位置 == タグ開始位置
	//
	if (option & Tag.AnchoredSearch) {
		var LR1 = (option & Tag.BackwardSearch) ? XBSCType.GT : XBSCType.LT;
		var LR2 = (option & Tag.BackwardSearch) ? XBSCType.RBRACE : XBSCType.LBRACE;
		c = aText.charCodeAt(start);
		
		switch (c) {
		case LR1:
			anchor = '<';
			break;
		case LR2:
			anchor = '{';
			break;
		default:
			return null;
			break;
		}
	}
	
	var idx    = -1;
	var fnName = (option & Tag.BackwardSearch) ? "lastIndexOf" : "indexOf";
	
	if (anchor != null) {
		// 前方検索なら start が使えるが、
		// 後方検索の場合、改めて検索する必要がある。
		// 面倒なのでどちらの場合でも検索
		idx = aText[fnName](anchor, start);
		
		// 以下のケースに対応
		// <B>hogehoge>hoge
		if (idx != -1 && option & Tag.BackwardSearch) {
			if (idx < aText.lastIndexOf('>', start-1)) {
				return null;
			}
		}
	} else {
		idx = aText[fnName]('<', start);
		if (-1 == idx) {
			idx = aText[fnName]('{', start);
		}
	}
	if (-1 == idx) {
		return null;
	}
	
	// StringPointer の位置をタグの先頭位置にして
	// scanTag() に委譲
	sp.setLocation(idx);
	return this.scanTag(sp);
}

Tag.TAG_NAME_STOP_CHARACTER = "/\"<{:";


/**
 * 空白文字を含まないテキストをスキャン
 * 
 * @param aStrPtr     StringPointer
 * @param stopChars   この文字列に含まれる文字でとまる
 * @param tagStopChar この文字でとまる
 */
Tag.scanText = function(aStrPtr, stopChars, tagStopChar)
{
	var fromIndex = aStrPtr.getLocation();
	var toIndex   = fromIndex;
	
	if (stopChars == null) {
		stopChars = '';
	}
	while (c = aStrPtr.getc()) {
		if (c == tagStopChar || 
			XBSUtil.indexOfCharacter("\r\n\t ", c) != -1 ||
			XBSUtil.indexOfCharacter(stopChars, c) != -1 ) 
		{
			aStrPtr.pushback();
			break;
		}
		toIndex++;
	}
	// end 
	if (toIndex == aStrPtr.string.length) {
		aStrPtr.location = fromIndex;
		return null;
	}
	
	if (fromIndex == toIndex) {
		return '';
	}
	
	return aStrPtr.string.substring(fromIndex, toIndex);
}
Tag.scanParameter = function(aStrPtr, tagStopChar)
{
	var idx = aStrPtr.getLocation();

	// 2004-05-06  Takanori Ishikawa 
	// ------------------------------------------------------------------------
	// ':' の周囲に空白を許す場合はふたつの readSpaces() の
	// コメントアウトを外してください。
	
	// aStrPtr.readSpaces();
	if (false == aStrPtr.readChar(XBSCType.COLON)) {
		aStrPtr.setLocation(idx);
		return "";
	}
	// aStrPtr.readSpaces();
	return Tag.scanText(aStrPtr, "", tagStopChar);
}

/**
 * タグをスキャン。
 * 
 * @param aStrPtr      タグの先頭位置を指す StringPointer
 * @return Tag オブジェクト、
 */
Tag.scanTag = function(aStrPtr)
{
	var sp = aStrPtr;
	var i, c;
	var tagName     = '';
	var isCustomTag = false;
	var tag         = null;
	var isEndTag    = false;
	var param       = null;
	
	if (null == sp || sp.isAtEnd()) {
		return null;
	}
	i = sp.getLocation();
	c = sp.getc();  // 先頭文字
	
	if (null == c) {
		return null;
	}
	
	//
	// <...> タグの場合、閉じタグも考慮する。
	// タグ名とタグの開始文字からカスタムタグかどうかを判別
	//
	var tagStopChar = (c == XBSCType.LT) ? XBSCType.GT : XBSCType.RBRACE;
	
	isEndTag    = (c == XBSCType.LT) ? sp.readChar(XBSCType.SLASH) : false;
	tagName     = Tag.scanText(sp, Tag.TAG_NAME_STOP_CHARACTER, tagStopChar);
	isCustomTag = (TagDefs[tagName] != null || c == XBSCType.LBRACE);
	
	if (tagName == null || tagName.length == 0) {
		return null;
	}
	if (!isEndTag && isCustomTag) {
		param = Tag.scanParameter(sp, tagStopChar);
		if (param == null) param = '';
	}
	
	if (isCustomTag) {
		var ch = sp.getc();
		var stop = (c == XBSCType.LT) ? XBSCType.GT : XBSCType.RBRACE;
		//画像の幅タッグへの対応
		if(ch == XBSCType.SPACE){
			idx = sp.string.indexOf('}', sp.getLocation());
			if(idx == -1) return null;
			sp.setLocation(idx+1);
		}
		if (ch != XBSCType.SPACE && ch != stop) {
			return null;
		}
	} else {
		var QT1 = '\''.charCodeAt(0);
		var QT2 = '"'.charCodeAt(0);
		
		var ch   = -1;
		var quot = -1;
	
		while (ch = sp.getc()) {
			if (ch == QT1 || ch == QT2) {
				if (quot == ch) {
					quot = -1;
				} else if (quot != -1) {
					;
				} else {
					quot = c;
				}
			} else if (c == XBSCType.LT && quot == -1) {
				// nested tag: invalid
				return null;
			}
			if (ch == XBSCType.GT) {
				break;
			}
		}
	}

	tag = sp.substringFrom(i);
	tag = new Tag(tagName, tag, isEndTag);
	tag.value = param;
	
	return tag;
}



Tag.prototype.charCodeAt = function(idx)
{
	var s = this.source;
	return (s == null || s.length <= idx) ? null : s.charCodeAt(idx);
}

/**
 * 拡張タグかどうか
 */
Tag.prototype.isCustomTag = function() 
{
	return (this.isCustomTag1() || this.isCustomTag2());
}
Tag.prototype.isCustomTag1 = function()
{
	return (this.charCodeAt(0) == XBSCType.LT && TagDefs[this.name] != null);
}
Tag.prototype.isCustomTag2 = function() 
{
	return (this.charCodeAt(0) == XBSCType.LBRACE);
}

/**
 * HTML 表現の文字列
 */
Tag.prototype.toHTMLString = function()
{
	return this.isCustomTag1() ? this.toHTMLString1() : this.toHTMLString2();
}
Tag.prototype.toHTMLString1 = function()
{
	if (this.isComment && (this.name == "大" || this.name == "特大")) {
		var ret = "&lt;";
		
		if (this.isEnd) {
			ret += "/";
		}
		
		return ret + this.name + "&gt;";
	}
	
	var defs = TagDefs[this.name];
	if (defs == null || 0 == defs.length) {
		return this.source;
	}
	var tag_arr = defs[0].split(',');
	if (this.isEnd) {
			if (tag_arr.length == 2) {
				return '</' + tag_arr[1] + '>' + '</' + tag_arr[0] + '>';
			} else if (tag_arr.length == 3) {
				return '</' + tag_arr[2] + '>' + '</' + tag_arr[1] + '>' + '</' + tag_arr[0] + '>';
			} else {
				return '</' + defs[0] + '>';
			}
	}

	if (defs.length == 2) {
		if (tag_arr.length == 2) {
			return '<' + tag_arr[0] + ' ' + defs[1] + '><' + tag_arr[1] + '>';
		} else if (tag_arr.length == 3) {
			return '<' + tag_arr[0] + ' ' + defs[1] + '><' + tag_arr[1] + '><' + tag_arr[2] + '>';
		} else {
			return '<' + defs[0] + ' ' + defs[1] + '>';
		}
	} else if (defs.length == 3) {
		var v = this.value;
		if (v == '' || v == null) {
			return '';
		}
		// 念のためサニタイジング
		v = v.replace(/</g, Tag.LT_TEXT);
		v = v.replace(/>/g, Tag.GT_TEXT);			
		return '<' + defs[0] + ' ' + defs[1] + v + defs[2] + '>';
	}

	return this.source;
}
Tag.prototype.toHTMLString2 = function()
{
	if (!this.isCustomTag2()) {
		return this.source;
	}
	
	var code = Tag.EmojiNameTable[this.name];
	var text = '';
	
	if (code != null) {	// 絵文字
		text = Tag.buildEmojiImageTag(code, this.isComment);
	} else {	// 画像 or ZAQ動画
		text = this.buildZaqMovieTag();	// ZAQ動画
		if (null == text) {
			text = this.buildUploadImageTag();	// 画像
			if (null == text) {
				text = this.source;
			}
		}
	}
	return text;
}

/**
 * インスタンスの説明的な文字列
 */
Tag.prototype.toString = function()
{
	return '[Tag:'+this.name+'] ' + this.value + '\n' + this.source;
}



 
// 絵文字タグ種類
var EMOJI_HTML 		= 0;
var EMOJI_REF_JP	= 1;
var emoji_type = EMOJI_REF_JP;

// アップ画像タグ種類
var UPIMAGE_HTML 		= 0;
var UPIMAGE_REF			= 1;
var upimage_type = UPIMAGE_REF;



//---------------------------------------------------------------------------------
// Interface
//---------------------------------------------------------------------------------
/**
 * 絵文字のコード （e.g. '01', '64'） から名前を得る。
 * 
 * @param aCode コード文字列
 */
function getEmojiNameFromCode(aCode)
{
	var code = '';
	var name = '';
	
	if (aCode != null) {
		// 空文字に連結することで無理やり文字列に変換する
		code += aCode;
	}
	name = Tag.emojiTable[aCode];
	if (name == null) {
		name = '';
	}
	return name;
}

/**
 * 絵文字のコード （e.g. '01', '64'） からファイル名を得る。
 * 
 * @param aCode コード文字列
 */
function getEmojiFileNameFromCode(aCode)
{
	var code = '';
	var name = '';
	
	if (aCode != null) {
		// 空文字に連結することで無理やり文字列に変換する
		code += aCode;
	}
	name = Tag.emojiFileName[aCode];
	if (name == null) {
		name = '';
	}
	return name;
}

/**
 * 絵文字タグ生成
 * 
 * @param code 絵文字 id
 */
Tag.buildEmojiImageTag = function(code, isComment)
{
	var srcPath;

	if (!isComment) {
		srcPath = Tag.MEMBERS_EMOJI_PATH;
	} else {
		srcPath = Tag.VIEW_EMOJI_PATH;
	}

	return '<img sr' + 'c="' + srcPath + getEmojiFileNameFromCode(code) + '.gif" border="0">';
}

/**
 * アップロード画像へのパスを含む img タグ文字列を生成
 * 
 * @param filename      ファイル名
 * @param optional_attr 追加属性
 * @param dir           ディレクトリ
 * 
 * @return img タグ文字列
 */
Tag.buildUploadImageTag = function(filename, optional_attr, width_tag, islink, dir)
{
	var path;
	var linkPath;

	if (dir) {
		path = dir;
	} else if (Tag.isViewableFile(filename)) {
		path = OEMBlogGlobal.uploadImageDirectory;
		linkPath = OEMBlogGlobal.linkUploadImageDirectory
	} else {
		path = OEMBlogGlobal.uploadPreviewImageDirectory;
	}	
	if (null == path || filename == '') {
		return '';
	}
	if (optional_attr == null) {
		optional_attr = '';
	}
	if(width_tag == null){
		width_tag = '';
	}
	path = path + escape(filename);
	linkPath = linkPath + escape(filename);
	url = linkPath;
	if (Tag.isFlashFile(filename)) {
		path = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
			+ ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'
			+ ' ' + optional_attr + '>'
			+ '<PARAM name=movie value="' + path + '">'
			+ '<PARAM name=quality value=high>'
			+ '<EMBED sr' + 'c="' + path + '" quality=high type="application/x-shockwave-flash"'
			+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" ' + optional_attr +'></EMBED>'
			+ '</OBJECT>';
	} else if (Tag.isViewableFile(filename)) {
		path = '<img sr' + 'c="' + path + '" border="0" ' + optional_attr + '' + width_tag + '>';
	} else {
		path = '<table border="0" ' + optional_attr + '><tr><td align="center"><img sr' + 'c="' + path + '" border="0" ' + width_tag + '><br>' + filename + '</td></tr></table>';		
	}
	if(islink){
		path = '<a href="' + url + '" target=_blank>' + path + '</a>';
	}
	return path;
}

/**
 * 表示可能ファイル（画像）かどうかを得る。
 * 
 * @param fileName ファイル名
 */
Tag.viewableFileExtensions = [
  'jpg', 'jpeg', 
  'gif',
  'png',
  'bmp',
  'xbm',
  'swf'
];

Tag.isViewableFile = function(filename)
{
	var pos = filename.lastIndexOf(".");
	if (pos == -1 || pos == (filename.length -1)) {
		return false;
	}

	var extension = filename.substring(pos +1, filename.length).toLowerCase();
	var tests = Tag.viewableFileExtensions;
	for (var i = 0; i < tests.length; i++) {
	    if (extension == tests[i]) {
	        return true;
	    }
	}
	return false;
}
Tag.isFlashFile = function(filename)
{
	var extension;
	var pos = filename.lastIndexOf(".");
	if (pos == -1) {
		return false;
	}
	extension = filename.substring(pos, filename.length);
	return (extension=='.swf');
}

Tag.buildUploadImageTagFromText = function(tagText)
{
	var r;
	
	//注意：ここでタッグを全部小文字にする
	tagText = tagText.toLowerCase();
	
	r = tagText.match(OEMBlogGlobal.IMAGE_FILE_PATTERN);
	if (null == r || 0 == r.length) {
		return null;
	}
	var fileName = r[2];
	var option   = '';
	
	if (r.length == 8 && r[1] != null && r[1].length != 0) {
		option = (r[1] == '左:') ? 'align="left"' : 'align="right"';
	}
	

	//{左:img20060221.gif 幅:220px}は下のを得る
	//0: {左:img20060221.gif 幅:220px} 1: 左: 2: img20060221.gif 3: 横:220px 4: 220 5: px 

	var width_tag = null;
	if (r[4].length != 0 && r[5].length !=0){
		width_tag = ' width="' + r[4] + r[5] + '"';
	}

	islink = false;
	if(r[6].length != 0){
		islink = (r[7].toLowerCase() == 'on' ? true : false);
	}
	return Tag.buildUploadImageTag(fileName, option, width_tag, islink);
}
Tag.prototype.buildUploadImageTag = function()
{
	return Tag.buildUploadImageTagFromText(this.source);
}

/** ZAQ動画用 */
Tag.prototype.buildZaqMovieTag = function()
{
	return Tag.buildZaqMovieTagFromText(this.source, this.isComment);
}
Tag.buildZaqMovieTagFromText = function(tagText, isComment)
{
	var r;
	var ZAQ_MOVIE_TAG_PATTERN =  /{ZAQ動画:([^\/]+)\/([a-zA-Z0-9]+)( 幅:([0-9]+)(px|PX))?( 高さ:([0-9]+)(px|PX))?}/;
	
	r = tagText.match(ZAQ_MOVIE_TAG_PATTERN);
	if (null == r || 0 == r.length) {
		return null;
	}
	
	if ( isComment ) return '';
	
	var usernumber = r[1];
	var contentnumber = r[2];
	
	var width = 372;
	if (r[4] != null && r[5] != null && r[4].length != 0 && r[5].length !=0){
		width = r[4];
	}
	var height = 330;
	if (r[7] != null && r[8] != null && r[7].length != 0 && r[8].length !=0){
		height = r[7];
	}

/*
	var html = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"';
	html += ' width="' + width + '" height="' + height + '" id="pluginplayer" align="middle">';
	html += '<param name="allowScriptAccess" value="sameDomain" />';
	html += '<param name="movie" value="http://douga.zaq.ne.jp/pluginplayerv3.swf?';
	html += 'video_id='+usernumber+'/'+usernumber+'peevee'+contentnumber+'.flv&l=186&u=douga.zaq.ne.jp/viewvideo.jspx?Movie='+usernumber+'/'+usernumber+'peevee'+contentnumber+'.flv" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<embed src="http://douga.zaq.ne.jp/pluginplayerv3.swf?video_id='+usernumber+'/'+usernumber+'peevee'+contentnumber+'.flv&l=186';
	html += '&u=douga.zaq.ne.jp/viewvideo.jspx?Movie='+usernumber+'/'+usernumber+'peevee'+contentnumber+'.flv" quality="high"  wmode="transparent"';
	html += ' width="' + width + '" height="' + height + '" name="pluginplayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer"></embed>';
	html += '</object>';

*/
	var html = '<img src="/dz/img/userimg/' + usernumber + 'peevee' + contentnumber + '_1.jpg"';
	html += ' width="' + width + '" height="' + height + '" border="0">';
	
	return html;
}

