// 泅 巩辑(document)客 包访 ///
LOGMAX = 60;
connected = 0;
BUFFERLEN = 500;
chatFrame = self.top.main;
RNAME_FACE_CHANGE = 0x002
RNAME_BODY_CHANGE = 0x004
USERSTRLCHAR = 	0x01;
USERSTRNAME	= 	0x02;
USERSTRINFO	= 	0x04;
CRENCODECHAR	= "";
BF_LIST_FRIEND	= 0x01;
BF_LIST_MUSIC 	= 0x02;
BF_LIST_FORUM		= 0x04;
BF_LIST_CHANNEL	= 0x08;
BF_LIST_MEMO		= 0x10;
BF_LIST_WHO			= 0x20;
newMemoCnt = 0;
bDontMsgAlert = false;
bMesAlive = false;
watchCntWin = false;
msgIsOnWin = false;
NULLARRAY	= new Array();
arrHompyWin = false;
bRootActiveX = true;

function openNewHompyWin(strUserCode, strTargUrl) {
	arrHompyWin[strUserCode] = window.open(strTargUrl, "", "width=1000,height=700,top=0,left=0,resizable=no,scrollbars=no");
}
function openHompyWin(strUserID, strGoURL) {
	if ( !strUserID ) 
		return;
	if ( !strGoURL )
		strGoURL = "";
	var strUserCode = makeUserId(strUserID).toUpperCase();
	var strTargUrl = '/Agit/AgitWin/?o_id='+encode_url_para(strUserID)+'&GoURL='+strGoURL
	if ( typeof(arrHompyWin) != "object" )
		arrHompyWin = new Object();
	
	if ( typeof(arrHompyWin[strUserCode]) != "object" || arrHompyWin[strUserCode].closed ) 
		openNewHompyWin(strUserCode, strTargUrl);
	else {
		try {
			arrHompyWin[strUserCode].location.replace(strTargUrl);
			arrHompyWin[strUserCode].focus();
		}
		catch(x) {
			openNewHompyWin(strUserCode, strTargUrl);
		}
	}
}
function ErrorDebug(eObj) {
	try {
		if ( IsOperator() )
			alert("系统错误!\n"+eObj.name + ": " + eObj.message+"\n"+(eObj.number& 0xFFFF)+ ": " + eObj.description);
	}
	catch (x) {
	}
}
function IsAlphabet(c) {
	return /^[a-z]*$/i.test(c);
}
function IsNum(c) {
	return /^[0-9]*$/.test(c);
}
// 窃荐牢瘤 眉农 
function makeSplitArr(orgStr, p) {
	return ( orgStr.indexOf(p) == -1 ? new Array(orgStr) : orgStr.split(p) );
}
function IsFunction(targ_obj) {
	return ( typeof(targ_obj) == "object" || typeof(targ_obj) == "function" )
}
function IsRoomName(chname) {
	return ( chname.charAt(0) == "#" );
}
function IsChatName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1).toUpperCase() == "C" );
}
function IsCastName(chname) {
	return ( IsChatName(chname) && IsAlphabet(chname.charAt(2)) );
}
function IsGameName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1).toUpperCase() == "G" );
}
function IsDateName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1) == "1" );
}
function IsShotName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1).toUpperCase() == "S" );
}
function IsFunnyName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1).toUpperCase() == "F" );
}
function IsAzitName(chname) {
	return ( IsRoomName(chname) && chname.charAt(1).toUpperCase() == "A" );
}
function IsSpecAzitNAme(chname) {
	return ( IsAzitName(chname) && chname.charAt(2).toUpperCase() == "0" );
}
function IsPrivAzitNAme(chname) {
	return ( IsSpecAzitNAme(chname) && chname.charAt(3).toUpperCase() == "0" );
}
function IsShotAzitNAme(chname) {
	return ( IsSpecAzitNAme(chname) && chname.charAt(3).toUpperCase() == "A" );
}
function GetRoomObjbyChannel(channel) {
	var ret = false;
	if ( !IsRoomName(channel) );
	else if ( IsChatName(channel) )
		ret = chatWin[channel];
	else if ( IsDateName(channel) )
		ret = dateWin[channel];
	else if ( IsShotName(channel) )
		ret = shotWin[channel];
	else if ( IsFunnyName(channel) )
		ret = funnyWin[channel];
	else if ( IsAzitName(channel) )
		ret = azitWin[channel];
	return ret;
}
function makeChanObj(channel, para1, para2) {
	var ret;
	if ( !IsRoomName(channel) );
	else if ( IsDateName(channel) )
		ret = dateWin[channel] = new init_DateObj(para1, para2);
	else if ( IsShotName(channel) )
		ret = shotWin[channel] = new makeShotRommObj(para1);
	else if ( IsFunnyName(channel) )
		ret = funnyWin[channel] = new makeFunnyRommObj(para1);
	else if ( IsAzitName(channel) )
		ret = azitWin[channel] = new makeAzitWin(para1);
	else if ( typeof(ret = GetRoomObjbyChannel(channel)) == "object" );
	else if ( IsChatName(channel) ) 
		ret = chatWin[channel] = new init_chat_Frame();
	return ret;
}
function IsObject(obj) {
	return ( typeof(obj) == "object" )
}
function IsChanMember(channel, user_id) {
	var targObj;
	if ( IsObject(targObj = GetRoomObjbyChannel(channel)) && IsObject(targObj.user) && IsObject(targObj = targObj.user[user_id]) )
		return targObj;
	return false;
}
function deleteChanObj(channel) {
	if ( !IsRoomName(channel) );
	else if ( IsChatName(channel) )
		delete chatWin[channel];
	else if ( IsDateName(channel) )
		delete dateWin[channel];
	else if ( IsShotName(channel) )
		delete shotWin[channel];
	else if ( IsFunnyName(channel) )
		delete funnyWin[channel];
	else if ( IsAzitName(channel) )
		delete azitWin[channel];
}
// 矫埃 屈侥 官操扁
function pretty_time(time_msg) {
	try {
		time_msg = makeSplitArr(time_msg,".");
		if ( time_msg.length != 6 )
			return "";
		for ( i=3; i < time_msg.length ; i++ )
			if ( time_msg[i].length == 1 )
				time_msg[i] = "0"+time_msg[i];
		return time_msg[0]+"-"+time_msg[1]+"-"+time_msg[2]+" "+time_msg[3]+":"+time_msg[4]+":"+time_msg[5];
	}
	catch (x) {
		ErrorDebug(x);
	}
}
function isHaveProp(targObj) {
	var ret = false, prop;
	for(prop in targObj) {
		ret = true;
		break;
	}
	return ret;
}
function Session_keep_alive() {
	if ( typeof(Session_live) == "object" && isHaveProp(chatWin) || isHaveProp(dateWin) || isHaveProp(shotWin)  || isHaveProp(funnyWin) )
		Session_live.location.reload();
}
function getNewMemoCnt() {
	return ( newMemoCnt ? newMemoCnt : 0 );
}
function memoCntSet(cnt, bSet) {
	if ( typeof(cnt) != "number" )
		cnt = Number(cnt);
	if ( isNaN(cnt) )
		cnt = 0;
	if ( bSet )
		newMemoCnt = cnt;
	else 
		newMemoCnt += cnt;
}
function getFindProg(path, name) {
	return chatApplet.CheckReg('HKEY_LOCAL_MACHINE', path, name, 0);
}
//酒锯揪 立加 矫累
function irc_start(repMsg) {
	connected = 1;
	memoCntSet(0, true);
	memo_image = "";
	memo_init_msg = "";
	chatWin = new Array();
	azitInviteWin = new Object();
	azitWaitWin = new Object();
	dateWin = new Array();
	shotWin = new Array();
	funnyWin = new Array();
	azitWin = new Array();
	arrChatWin = new Array(chatWin, dateWin, shotWin, funnyWin, azitWin);
	waitDateWin = new Object();
	shotWinTempObj = "";
	memo_ret_msg=new Array();
	winUserLog = new Array();
	User=new new_user(repMsg);
	BUFFERLEN = 510 - calbyte(get_user_id()) - 1;
	flood_obj = new init_flood_obj();
	chatFrame.connect_complete();
	KeepAliveTId = setInterval("Session_keep_alive()",KeelpAliveIntervalTime);
}
//酒锯揪 立加
function connect(nick,id,realname,irc_server,irc_port){
	try
	{
		if ( connected == 1)
			disconnect();
		id=id_convert(id);
		if ( typeof(chatApplet) != "object" )
			return false;
		else if ( typeof(chatApplet.connect) == "undefined" )
			return false;
		else if (chatApplet.connect(nick,id,realname,irc_server,irc_port)) 
			return true;
		else 
			return false;
	}
	catch (x)
	{
	}
}
function connectX(targFrame, strUniqId,irc_server,irc_port){
	var ret = false;
	try
	{
		
		if ( typeof(chatApplet) != "object" || typeof(chatApplet.connect) == "undefined" )
			return ret;
		disconnect();
		//if ( chatApplet.isKoreanWin() ) {
			chatFrame = targFrame;
			if (typeof(chatApplet)=='object')
			{
				//alert("chatApplet.connect(" + strUniqId + "," + irc_server + "," + irc_port + ");");
				window.setTimeout("chatApplet.connect(" + strUniqId + ",'" + irc_server + "'," + irc_port + ");",1500);
				ret = true;
				return ret;
			}
			else
			{
				window.setTimeout("connectX(" + targFrame + "," + strUniqId + "," + irc_server+ "," + irc_port +");",1000);
			}
		//}
		//else {
			//targFrame.connect_complete();
			//ret = true;
		//}
	}
	catch (x)
	{}
	return ret;
}
//酒锯揪 立加 谗扁
function disconnect(){
	try
	{
		connected = 0;
		if ( typeof(top.loc_frm) == "object" ) 
			top.loc_frm.name = "loc_frm";
		delete User;
		clearInterval(KeepAliveTId);
		chatApplet.discon();
	}
	catch (x)
	{
	}
}
//皋矫瘤 焊郴扁
function msgSend(msg){
	try
	{
		chatApplet.send(msg.replace(/[\n\r]+/g,CRENCODECHAR));
	}
	catch (x)
	{
	}
}
//// 荤侩磊 碍力辆丰 /////
function msgKill(kill_msg) {
	if ( connected != 1 )
		return;
	else if ( typeof(top.loc_frm) == "object" ) 
		top.loc_frm.name = "loc_frm";
	connected = 0;
	delete User;
	if ( kill_msg )
		alert(kill_msg);
	top.location.href="/";
}
function CmdXFunc(nCmdCode) {
	var strFunc;
	switch(nCmdCode) {
	case "0": // Url
		if ( arguments[1] )
			strFunc = "chkUrlNOpenOrHref(\""+makeJString(arguments[1])+"\")";
		break;
	case "1": // 权乔
		if ( arguments[1] )
			strFunc = "openHompyWin(\""+makeJString(arguments[1])+"\")";
		break;
	case "2": // 权乔鸡
		if ( arguments[1] )
			strFunc = "fnOpenAShotWin(\""+makeJString(arguments[1])+"\")";
		break;
	default:
		break;
	}
	if ( strFunc )
		new_process(strFunc);
}
function CmdXDisconnect() {
	new_process("msgKill('对不起,服务器的连接已中断!')");
}
function CmdXOpenAzit(strUserID) {
	new_process("f_openAgit(\""+makeJString(strUserID)+"\")");
}
function CmdXOpenWin(url) {
	new_process("chkUrlNOpenOrHref(\""+url+"\")");
}
function CmdXLogout() {
	new_process("msgKill('对不起,您的帐号已经在其他web窗口登录!')");
}
function CmdXUniqID(bSucc) {
	new_process("CmsXUniqIDAction("+bSucc+")");
}
function CmsXUniqIDAction(bSucc) {
	if ( typeof(loginPrepareWin) != "object" || typeof(loginPrepareWin.closed) == "undefined" || loginPrepareWin.closed )
		return;
	loginPrepareWin.cmdXLogin(bSucc);
}
function ChkActiveLogin(targWin, UniqId) {
	loginPrepareWin = targWin;
	chatApplet.CheckMsgLogin(UniqId);
}
//傍归绝局扁
function SpaceToNbsp(msg){
	return msg.replace(/ +/g," ");
}
// 荤侩磊 酒捞叼 啊廉坷扁
function get_userid(userinfo) {
	try
	{
		if ( userinfo.charAt(0) == "@" ) 
			userinfo = userinfo.substring(1);
		var more=userinfo.indexOf("!");
		if ( more != -1 ) {
			userinfo = userinfo.substring(++more);
			more=userinfo.indexOf("@");
			if ( more != -1 ) 
				userinfo = userinfo.substring(0,more);
		}
		return id_reverse_convert(userinfo);
	}
	catch (x)
	{
	}
}
function IsOperator() {
	var arrOpId = new Array("viceboss", "viceboss00"), i;
	var myUserId = get_user_id(), ret = false;
	if ( myUserId != "" )
		for(i=0;i<arrOpId.length && !ret;i++) {
			if ( stricmp(arrOpId[i], myUserId) == 0 )
				ret = true;
		}
	return ret;
}
function getUserPosition(strPos) {
	var arrUserPos, retUserPos, i;
	for (arrUserPos = makeSplitArr(strPos,","), retUserPos = "", i=0; i < arrUserPos.length; i++ ) 
		if ( chan_level(retUserPos) < chan_level(arrUserPos[i]) )
			retUserPos = arrUserPos[i];
	return retUserPos;
}
// 荤侩磊 扁夯 沥焊 啊廉坷扁
function new_user(userinfo) {
	if ( userinfo.length < 4 ) {
		this.user_id = userinfo;
		return;
	}
	try
	{
		var i, more, temp_code, code;
		this.oper 			= 0;
		this.cj 				= false;
		this.silenced 	= false;
		this.user_info 	= "";
		for(i=0;i<userinfo.length && "+@~$^&*-=|".indexOf(userinfo.charAt(i)) != -1 ;i++) 
			switch(userinfo.charAt(i)) {
			case "@":
				this.oper = 1;
				break;
			case "+":
				this.cj = true;
				break;
			}
		userinfo = userinfo.substring(i);
		if ( (more=userinfo.indexOf("!")) == -1 ) 
			this.user_id = id_reverse_convert(userinfo);
		else {
			this.nick=userinfo.substring(0,more++);
			userinfo =userinfo.substring(more);
			more=userinfo.indexOf("@");
			this.user_id= id_reverse_convert(userinfo.substring(0,more++));
			if ( this.nick == "聊天名" )
				this.nick = this.user_id;
			code = cate_to_num(userinfo.charAt(more++))
			this.infoCode = code;
			if ( typeof(code) == "number" ) {
				userinfo = userinfo.substring(more);
				more = ( code & USERSTRLCHAR ? 52 : 8);
				this.user_char = userinfo.substring(0,more);
				this.user_char2 = makeSplitArr(number_convert(this.user_char),"|");
				userinfo = userinfo.substring(more);
				if ( code & USERSTRNAME ) {
					for(more = 0 ; calbyte(userinfo.substring(0,more)) < 10 && more < 10; more++);
					for ( i = more -1 ; userinfo.charAt(i) == "." ;i--);
					this.realname = userinfo.substring(0,++i);
					this.user_info += userinfo.substring(0,more);
					userinfo = userinfo.substring(more);
				}
				else 
					this.realname = "非公开";
				if ( code & USERSTRINFO ) {
					more = 18;
					if ( !IsOperator() && userinfo.charAt(0) == 1 )
						this.realname = "非公开";
					this.user_info += userinfo.substring(0,more);
					this.age = ( userinfo.charAt(1) == 0 || IsOperator() ? Number(userinfo.substring(5,8)) : "非公开" );
					this.gender = ( userinfo.charAt(2) == 0 ? ( userinfo.charAt(8) == 1 ? "男子" : "女性" ) : "非公开" );
					this.job = ( userinfo.charAt(3) == 0 ? code_to_job(userinfo.charAt(9)) : "非公开" );
					this.intention = code_to_intention(userinfo.charAt(10));
					this.region = (( userinfo.charAt(5) == 0 || IsOperator() ) ? code_to_region(userinfo.substring(11,13)) : "非公开" );
					userinfo = userinfo.substring(more);
				}
				this.musicAddr = "";
				if ( userinfo != "" ) {
					userinfo = getUserPosition(userinfo);
					if ( (more=userinfo.indexOf("&")) != -1 ) {
						this.musicAddr = userinfo.substring(more+1);
						userinfo = userinfo.substring(0,more);
					}
				}
				this.channel = userinfo;
				this.position = get_position(this.channel);	
			}
		}
	}
	catch (x)
	{
	}
}
//流诀 内靛 牧滚泼
function code_to_job(job_code) {
	job_code = ascii_to_number_convert(job_code);
	jobList=new Array("非公开","企化管理 ","一般管理","营业/销售","广告/宣传","电算开发 ","电算管理","顾客服务","生产技术职 ","研究职","小学生","中学生","中学生","大学生","大学院","普通公务员","警员","职业军人","其他公务员","大学教授/讲师","初中高教师","家庭教师","其他教职","电脑相关","广告相关","设计","外国语","自由写作人","其他","言论/出版","农/畜 /水产/林业","医疗系 ","律师","宗教","广播/演艺/艺术","家庭主妇","单纯劳务/日用职","自营业","无职业","金融");
	return jobList[job_code];
}
//瘤开 内靛 牧滚泼
function code_to_region(region_code) {
	region_code = Number(region_code);
	regionList=new Array("非公开","安徽","北京","上海","天津","重庆","河北","河南","湖北","山东","广东","广西","福建","江苏","浙江","湖南","江西","吉林","黑龙江","辽宁","陕西","云南","贵州","四川","青海","甘肃","宁夏","内蒙古","山西","海南","新疆","西藏","香港","澳门","台湾");
	return regionList[region_code];
}
//狼档 内靛 牧滚泼
function code_to_intention(intention_code) {
	intention_code = ascii_to_number_convert(intention_code);
	intentionList=new Array("非公开","找新友","找理想型","舒服的对话","关心领域的聊天","分忧","脱离电脑盲","玩游戏","音乐欣赏","看电影","去看演出","美味店/时装店","喝酒","兜风","现在见面");
	return intentionList[intention_code];
}
// 荤侩磊 困摹 颇厩
function get_position(channel) {
	try
	{
		var ret = "", cate, value;
		if ( channel == "" )
			ret = "等待室"
		else if ( IsChatName(channel) ) 
			ret = ( typeof(cate = s_cate_desc[channel.charAt(2)]) != "undefined" && ( value = cate_to_num(channel.charAt(3))) > 0 && value < cate.length ? cate[value] : "无法知道" );
		else if ( IsGameName(channel) ) 
			ret = ( typeof(value = game_list_desc[gcate_to_num(channel.substring(2,4))]) == "undefined" || value == "" ? "无法知道" : value );
		else if ( IsDateName(channel) ) 
			ret = "聊天中"
		else if ( IsShotName(channel) ) 
			ret = "照片"
		else if ( IsFunnyName(channel) ) 
			ret = "形象漫画"
		else if ( IsPrivAzitNAme(channel) ) 
			ret = "家园"
		else if ( IsShotAzitNAme(channel) ) 
			ret = "家园派对"
		else
			ret = "无法知道";
		return ret;
	}
	catch (x)
	{
	}
}
function chan_level(channel) {
	if ( channel == "" )
		return 0;
	else if ( IsDateName(channel) ) 
		return 1;
	else if ( IsShotName(channel) ) 
		return 2;
	else if ( IsFunnyName(channel) ) 
		return 3;
	else if ( IsShotAzitNAme(channel) ) 
		return 4
	else if ( IsChatName(channel) ) 
		return 5;
	else if ( IsPrivAzitNAme(channel) ) 
		return 6;
	else if ( IsGameName(channel) ) 
		return 7;
	else 
		return 0;
}
//1:1 盲泼 檬扁拳
function init_DateObj(main_frame,oppo_id) {
	this.main_frame = "";
	this.msg_frame = "";
	this.oppo_id = oppo_id;
	this.inviteWin = new Object();
	this.inviteWin[oppo_id] = main_frame;
	this.joined = false;
	this.users = 0;
	this.listq = new Array();
	this.msgq = new Array();
	this.user = new Array();
	this.log = new Array(LOGMAX);
	this.log_index = 0;
	this.can_profile = false;
}
//盲泼规 檬扁拳
function init_chat_Frame() {
	this.main_frame = "";
	this.topic = "";
	this.topic_frame = "";
	this.user = new Array();
	this.users = 0;
	this.usermax = "无限制 ";
	this.user_frame = "";
	this.msg_frame	= "";
	this.joined = false;
	this.listq = new Array();
	this.msgq = new Array();
	this.cj = "";
	this.key = "";
	this.music_addr = "";
	this.noticechan = "";
	this.invite_obj = "";
	this.can_profile = true;
	this.log = new Array(LOGMAX);
	this.log_index = 0;
	this.last_user = "";
	this.memberonly = false;	
	this.reserved = false;
	this.club = "";
	this.bbs = "";
	this.do_ment = false;
}
//档硅 规瘤 矫胶袍 技泼
function init_flood_obj() {
	this.cnt = 0;
	this.max_cnt = 3;
	this.no_send = 0;
	this.time_id = "";
	this.time = 5000;
	this.no_send_time = "";
	this.no_send_val = 15000;
}
function trim_str(str) {
	return str.replace(/^[ ]+/g,"").replace(/[ ]+$/g,"");
}
function trimNsplit(strlist) {
	return makeSplitArr(trim_str(strlist)," ");
}
///////////////////////////////////////////////////////
//
// 罐绰 皋技瘤 贸府 风凭
//
///////////////////////////////////////////////////////
function disableExChar(strA) {
	return strA.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");
}
function new_process(strFunc) {
	setTimeout(disableExChar(strFunc),1);
}
function makeJString(strText) {
	return ( typeof(strText) == "string" ? strText.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n") : strText );
}
function openNullChar(msg) {
	var re = new RegExp(CRENCODECHAR,"g");
	return msg.replace(re, "\n");
}
function read_msg(msg, bRoot){
	try
	{
		bRootActiveX = ( typeof(bRoot) == "undefined" || bRoot == "1" );
		msg = openNullChar(msg);
		write_test(msg);
		new_process("select(parseReply(\""+makeJString(msg)+"\"))");
	}
	catch (x)
	{
	}
}

function replaySockConnect(bSuccess, bMessangerAlive, bAtlAlive) {
	bMesAlive = ( bMessangerAlive == 1 );
	if ( bSuccess != 1 )
		msgKill("对不起,连接服务器失败,请稍后重新再试!");
	else if ( bMesAlive || bAtlAlive == "1" )
		msgSend("VLOGIN W");
	else
		new_process("chatFrame.send_logInfo();");
}
function chkOpenMsgWin() {
	return ( !bRootActiveX || bMesAlive );
}
function changeMessangerState(bMessangerAlive) {
	bMesAlive = ( bMessangerAlive == 1 );
	if ( !bMesAlive ) 
		msgSend("VLOGIN -");
}
function parseReply(msg){
	try
	{
		var pos, repObj = new Object();
		repObj.from = "server";
		repObj.to = "unknown";
		repObj.msg = "";
		if(msg.charAt(0)==':'){
			pos=msg.indexOf(" ");
			repObj.from = msg.substring(1,pos++);
			msg = msg.substring(pos);
		}
		if ( (pos=msg.indexOf(" ")) == -1 ) 
			repObj.cmd = msg;
		else {
			repObj.cmd = msg.substring(0,pos++);
			msg = msg.substring(pos);
			if( (pos=msg.indexOf(" ")) == -1 || msg.charAt(0)==':' ) 
				repObj.to = ( typeof(User) == "object" ? get_user_id() : "unknown" );
			else {
				repObj.to = msg.substring(0,pos++);
				msg = msg.substring(pos);
			}
			pos = 0;
			if(msg.charAt(pos)==':')
				pos++;
			repObj.msg = msg.substring(pos);
		}
		repObj.cmd = repObj.cmd.toUpperCase();
		return repObj;
	}
	catch (x)
	{
	}
}
function parse_msg(msg){
	try
	{
		var pos, i=0, retArr = new Array();
		if ( typeof(msg) == "string" )
			while( msg != "" ) {
				if ( msg.charAt(0) == ':' )
					retArr[i++] = msg.substring(1);
				else if ( (pos = msg.indexOf(" ")) == -1 ) 
					retArr[i++] = msg.substring(0);
				else {
					retArr[i++] = msg.substring(0,pos++);
					msg = msg.substring(pos);
					continue;
				}
				msg = "";
			}
		return retArr;
	}
	catch (x)
	{
	}
}

function setDontMsgAlert(value) {
	bDontMsgAlert = ( value == 1 );
}
function getDontMsgAlert() {
	return bDontMsgAlert;
}
