<!--
charHouseImgSrc = "/chat/img/chat/house.gif";
charHouseImg = "<img class=char_o src='"+charHouseImgSrc+"' width=11 height=11>";
u_line_dec = "ONMOUSEOVER=\"this.style.textDecoration='underline';\" ONMOUSEOUT=\"this.style.textDecoration='none';\"";
function NULLFUNCTION() {
	return;
}
function effectUnderLineOn() {
	effectUnderLine(this, true);
}
function effectUnderLineOff() {
	effectUnderLine(this, false);
}
function effectUnderLine(targObj, bOver) {
	targObj.style.textDecoration= ( bOver ? 'underline' : 'none' );
}
// DOM °ü·Ã
function MOUEffect(targObj, bRemove) {
	if ( bRemove ) {
		targObj.onmouseover = NULLFUNCTION;
		targObj.onmouseout = NULLFUNCTION;
	}
	else {
		targObj.onmouseover = effectUnderLineOn;
		targObj.onmouseout = effectUnderLineOff;
	}
}
function makeTagNode(tagName, className) {
	var retTagNode = document.createElement(tagName)
	if ( className ) 
		retTagNode.className = className;
	return retTagNode;
}
function makeImgNode(src, width, height, hspace, vspace) {
	var node = makeTagNode("IMG"), arrImgAttr = new Array("src","width","height","hspace", "vSpace"), i;
	for(i = 0; i < arguments.length ; i++ ) 
		node[arrImgAttr[i]] = arguments[i];
	node.galleryImg = "no"
	return node;
}
function makeTableNode() {
	var tBodyNode = makeTagNode("TBODY"), trNode, i, j;
	for ( i = 0 ; i < arguments.length ; i++ ) 
		for(trNode = tBodyNode.appendChild(makeTagNode("TR")), j = 0 ; j < arguments[i]; j++ )
			trNode.appendChild(makeTagNode("TD"));
	trNode = makeTagNode("TABLE");
	trNode.cellSpacing = 0;
	trNode.cellPadding = 0;
	trNode.border = 0;
	trNode.appendChild(tBodyNode);
	return trNode;
}
function getChNode(tbnode, rows, cols) {
	var node; 
	if  ( typeof( node = tbnode.firstChild) == "object" 
				&& !isNaN(rows)
				&& typeof(node = node.childNodes[rows]) == "object"
				&& !isNaN(cols)
				&& typeof(node = node.childNodes[cols]) == "object" );
	return node;
}
// Ä³¸¯ÅÍ °ü·Ã
function findOpMark(topDiv) {
	var i, ret = false, aNode;
	for(aNode = topDiv.lastChild; aNode && !ret; aNode = aNode.previousSibling)
		if ( aNode && stricmp(removeHost(aNode.src),charHouseImgSrc) == 0 )
			ret = aNode;
	return ret;
}
function addOrRemOpMark(topDiv, bOp) {
	var opObj  = findOpMark(topDiv);
	if ( bOp ) 
			topDiv.appendChild(( opObj ? opObj : makeNodeOpMark()));
	else if ( opObj )
		opObj.removeNode(true);
}
function makeNodeOpMark() {
	var div_obj = makeImgNode(charHouseImgSrc, 11, 11); 
	div_obj.className = "char_o";
	return div_obj;
}
function makeLayerIdx(Flag1, Flag2, Flag3) {
	var arrRet;
	if ( Flag1 ) 
		arrRet = new Array(4,6,14,16);
	else if ( Flag2 ) 
		arrRet = new Array(0,1,2,3,4,6,14,22,23,24,25);
	else if ( Flag3 )
		arrRet = new Array(0,1,2,3,4,5,6,7,8,10,13,15,16,17,18,19,20,21,22,23,24,25);
	else 
		arrRet = new Array(0,1,2,3,4,5,6,7,8,9,10,11,12,15,16,17,18,19,20,21,22,23,24,25);
	return arrRet;
}
// ÀÛÀº ¸Ó¸®Åë ¸¸µé±â
function adjustLargeAvata(arrLChar, arrSChar) {
	var arrIdx = makeLayerIdx(true), i;
	for(i=0;i<arrIdx.length;i++) 
		arrLChar[arrIdx[i]] = arrSChar[i];
}
function get_small_head(arrUserChar) {
	var arrIdx = makeLayerIdx(true), i, arrRet;
	if ( arrUserChar.length > arrIdx.length ) {
		arrRet = new Array(arrIdx.length), i;
		for (i=0;i<arrIdx.length;i++) 
			arrRet[i] = arrUserChar[arrIdx[i]];
	}
	else 
		arrRet = arrUserChar;
	return arrRet;
}
function ConvAll2SmallInfo(arrAllInfo) {
	var arrIdx = makeLayerIdx(true), ret = new Array(), i;
	for(i=0;i<arrIdx.length;i++) 
		ret[i] = arrAllInfo[arrIdx[i]];
	return ret;
}
function makeCharImgSrc(bSmall, Layer, Code) {
	return "http://image2.sina.com.cn/igame/ava_image/item_img/"+(bSmall ? "small_images" : "images" )+"/Layer"+Layer+"/L"+Layer+"_"+Code+".gif";
}
function make_all_char_html(user_char) {
	var html = "", layIdx = makeLayerIdx(false, ( user_char[14] != "0" ) , ( user_char[13] != "0" ) );
	for( i=0 ; i<layIdx.length ; i++ ) 
		if ( user_char[layIdx[i]] != 0 )
			html+="<img class='char_all' src='"+makeCharImgSrc(false, layIdx[i], user_char[layIdx[i]])+"' width=75 height=125>";
	return html;
}
function make_small_char_html(user_char,Isoper) {
	var char_type= ( Isoper == -1 ? 1: 2 ), html, layIdx = makeLayerIdx(true), i;;
	if ( user_char[2] != "0" )
		user_char[3] = "0";
	html = "<div class=char_b_"+char_type+">";
	for(i=0;i<layIdx.length;i++) 
		if ( user_char[i] != "0" ) 
			html +="<img class=char_e_"+char_type+" src='"+makeCharImgSrc(true, layIdx[i], user_char[i])+"' width=25 height=25>";
	html += ( Isoper == 1 ? charHouseImg : "" ) +"</div>";
	return html;
}
function makeNodeAllChar(charInfo, topDiv) {
	var layIdx = makeLayerIdx(false, ( charInfo[14] != "0" ) , ( charInfo[13] != "0" ) ), i;
	if ( !topDiv ) {
		topDiv = makeTagNode("DIV","char_all_body");
		topDiv.style.width = 75;
		topDiv.style.height = 125;
		topDiv.style.overflow = "hidden";
	}
	
	for(i=0;i<layIdx.length;i++) 
		if ( charInfo[layIdx[i]] != "0" ) 
			topDiv.appendChild(makeImgNode(makeCharImgSrc(false,layIdx[i],charInfo[layIdx[i]]), 75, 125)).className = "char_all";
	return topDiv;
}
function makeNodeSmallChar(charInfo,Isoper) {
	var char_type= ( Isoper == -1 ? 1: 2 ), topDiv, layIdx = makeLayerIdx(true), i, clsName = "char_e_"+char_type;
	topDiv = makeTagNode("DIV","char_b_"+char_type);
	if ( charInfo[2] != "0" )
		charInfo[3] = "0";
	for(i=0;i<layIdx.length;i++) 
		if ( charInfo[i] != "0" ) 
			topDiv.appendChild(makeImgNode(makeCharImgSrc(true,layIdx[i],charInfo[i]), 25, 25)).className = clsName;
	if ( Isoper == 1 ) 
		addOrRemOpMark(topDiv, true);
	return topDiv;
}
function removeHost(strSrc) {
	return strSrc.replace(/^http:\/\/[^/]*/gi,"");
}
function updateSmallCharNode(targDiv, charInfo, bOp) {
	var layIdx = makeLayerIdx(true), i, targObj, n, strSrc;
	if ( charInfo[2] != "0" )
		charInfo[3] = "0";
	for(i=0, n=0;i<layIdx.length && n < targDiv.childNodes.length;i++) {
		if ( charInfo[i] == "0" );
		else if ( typeof(targObj = targDiv.childNodes[n++]) != "object" || strcmp(targObj.className,"char_o") == 0 )
			break;
		else if ( stricmp((strSrc=makeCharImgSrc(true,layIdx[i],charInfo[i])),targObj.src) != 0 ) 
			targObj.src = strSrc;
	}	
	if ( typeof(bOp) != "undefined" )
		addOrRemOpMark(targDiv, bOp);
}
function removeHost(strUrl) {
	return strUrl.replace(/^http:\/\/[^\/]*/,"");
}
function updateAllChar(topDiv,charInfo) {
	var layIdx = makeLayerIdx(false, ( charInfo[14] != "0" ) , ( charInfo[13] != "0" ) )
	var i, n, tmpDivNode, strSrc;
	for(i=0, n=0;i < layIdx.length && n<topDiv.childNodes.length ;i++) {
		if ( charInfo[layIdx[i]] == "0" ) 
			continue;
		tmpImgNode = topDiv.childNodes[n++];
		strSrc=makeCharImgSrc(false,layIdx[i],charInfo[layIdx[i]]);
		if ( stricmp(tmpImgNode.src,strSrc) != 0 )
			tmpImgNode.src = strSrc;
	}
	if ( n < topDiv.childNodes.length ) {
		while(n < topDiv.childNodes.length )
			topDiv.lastChild.removeNode(true);
	}
	else {
		for(;i < layIdx.length;i++)  
			if ( charInfo[layIdx[i]] != "0" ) {
				tmpImgNode = makeImgNode(makeCharImgSrc(false,layIdx[i],charInfo[layIdx[i]]), 75, 125);
				tmpImgNode.className = "char_all";
				topDiv.appendChild(tmpImgNode);
				n++;
			}
	}
	return topDiv;
}
//-->