function showMsgBox(params){	
	this.keyWord = "";//需要帮助的关键字	
	this.msgShowContainer = null;
	if(!params)var params = {};
	this.oneDiv = this.createDivObj(0,10,-(params.height*2),null,null,900);	
	var tempObj ,childTempObj;
	var tempMainObj = this;
	for(var i = 0 ; i < 7 ; i++){
		tempObj = this.createDivObj(0,0,0,10,10);
		this.oneDiv.appendChild(tempObj);
		tempObj.style.overflow = "hidden";
		childTempObj = this.createDivObj(0,0,0,690,786,900+(i*5));		
		if(i == 5){
			var closeTempObj = childTempObj;
			closeTempObj["onmouseover"] = function (){
				this.style.top = "-690px";
				this.style.cursor ="pointer";				
			}
			closeTempObj["onmouseout"] = function (){
				this.style.top ="-703px";
			}
			closeTempObj["onclick"] = function (){
				showOrHide(tempMainObj.oneDiv,"none");
			}
		}
		if(i!=6){
			if(document.all){
				childTempObj.style.wordBreak = "normal";					
				childTempObj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop,src='"+params.image+"')";
			}else{
				childTempObj.style.background = "url('"+params.image+"')";
			}
		}		
		tempObj.appendChild(childTempObj);		
	}		
	this.setPosition(this.oneDiv,params.width,params.height,true);	
	this.setText();
}

showMsgBox.prototype.setPosition = function(m_oBaseMsgBox,w,h,m){
	var padding = 15;	//定义用户显示区域和对话框间的间距
	var tw = w + padding*2;	//对话框总长
	var th = h + padding*2+10;	//对话框总高
	var aw = m?40:98;		//98 大箭头的长度，40小箭头的长度;
	var ah = m?50:95;		//箭头高度
	var ap = m?370:0;		//箭头在图片的位置left
	var x = parseInt((tw-aw)*0.4 + 0.99);	//下面3块的左边块长度
	var y = parseInt((tw-aw)*0.6 - 0.99);	//下面3快的右边块长度
	
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[0],tw-25,th-25,0,0,0,0,1);
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[1],25,th-25,tw-25,0,25-690,0,2);
	//设定下面的三块
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[2],x,25,0,th-25,0,-665,3);
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[3],aw,ah,x,th-25,-ap,-690,4);
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[4],y+2,25,x+aw,th-25,y-689,-665,5);
	//设定关闭按钮		
	m_oBaseMsgBox.childNodes[5].style.display = "";
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[5],14,13,tw-24,10,-354,-703,6);	
	//设置用户内容显示区	
	this.msgShowContainer = m_oBaseMsgBox.childNodes[6];
	this.setMsgBoxDivPosition(m_oBaseMsgBox.childNodes[6],200,100,padding,padding+10,null,null,7);	
};
showMsgBox.prototype.setMsgBoxDivPosition = function(obj,w,h,l,t,cl,ct,a){	
	with(obj){
		if(w != null && h != null){
			style.width = w + "px";
			style.height = h + "px";			
		}
		style.left = l + "px";
		style.top = t + "px";
		if(cl != null && ct != null){
			firstChild.style.left = cl + "px";
			firstChild.style.top = ct + "px";
		}	
	}
	if(a == 7){		
		obj.style.zIndex = 990;
		obj.style.height = 70+"px";
	}
};
showMsgBox.prototype.createDivObj = function(nPosition,nLeft,nTop,sWidth,sHeight,nLevel){
	var oTempObj = document.createElement("div");	
	if(nPosition != null){
		if(isNaN(nPosition))nPosition=0;
		var oValue = ["absolute","relative","static"];
		if(oValue[nPosition]){oTempObj.style.position = oValue[nPosition]}
	}
	if(nLeft!=null)oTempObj.style.left = isNaN(nLeft)?"0px":nLeft + "px";
	if(nTop!=null)oTempObj.style.top = isNaN(nTop)?"0px":nTop + "px";
	if(sWidth!=null)oTempObj.style.width = sWidth;
	if(sHeight!=null)oTempObj.style.height = sHeight;
	if(nLevel!=null)oTempObj.style.zIndex = nLevel;		
	oTempObj.style.fontSize = "12px";
	oTempObj.style.color = "#000000";
	oTempObj.style.textAlign = "left";
	oTempObj.style.lineHeight = "100%";
	oTempObj.style.padding = "0px";
	oTempObj.style.border = "0px";
	return oTempObj;
};
showMsgBox.prototype.setText = function (text){	
	return this.oneDiv.childNodes[6].innerHTML =  text;
};
showMsgBox.prototype.setHelpMsg = function (act){//bbs/ubb/face/mk/f35.gif
	if(smain!=null) this.keyWord = smain.forHelp();
	var target = "<a target='_blank' style='color:red;text-decoration:underline;' href='"+this.keyWord+"' >互助社</a>";
	var outStr =["没有您满意的信息吗？","对不起！找不到您想要的信息。","问问大家吧。"];
	if(!act || isNaN(act) )var act = 0;
	var string = "<div style='width:200px;height:60px;padding:5 0 0 5px;line-height:24px;float:right;'><table><tr><td>"
			 + outStr[act] + "</td><td rowspan='2'><img  src='/bbs/ubb/face/mk/f35.gif'/></td>"
			 + "</tr><tr><td>去"+target+outStr[2]+"</td></tr></table></div>";				
	this.setText(string);
};
showMsgBox.prototype.showOrHide = function (status){
	showOrHide(this.oneDiv,status);
};
showMsgBox.prototype.init = function (appendTo){
	document.getElementById(appendTo).appendChild(this.oneDiv);
	//document.body.appendChild(this.oneDiv)
};
function showOrHide (obj,status){	
	obj.style.display = status;
};
var helpMsgBox =  new showMsgBox({image:page_path+"/images/dialog.png",width:200,height:60});
