﻿function imgSize(axImg,axWidth,aiHeight){
	//如果某个图片还没有加载完成，则代码延迟执行
	for(var i=0;i<axImg.length;i++){
		if(!axImg[i]) return;
		if(axImg[i].width==0){
			var xImg=axImg;
			var xWidth=axWidth;
			var xHeight=aiHeight;
			var callBack=function(){imgSize(axImg,axWidth,aiHeight)}
			setTimeout(callBack,100);
			return null;
		}
	}

	if(axImg==null||axWidth==null) return;
	var lxImg=axImg;
	if(axWidth.length==1){
		var liWidth=axWidth[0];
		for(var i=0;i<lxImg.length;i++){
			if(lxImg[i].width>liWidth){
				lxImg[i].style.height=Math.ceil(lxImg[i].height * liWidth/lxImg[i].width)+"px";
				lxImg[i].style.width=liWidth+"px";
			}
		}
	}else if(axWidth.length==2){
		var liWidth;
		var liWidth0=axWidth[0];
		var liWidth1=axWidth[1];
		for(var i=0;i<lxImg.length;i++){
			if(lxImg[i].width>liWidth1){
				liWidth=liWidth1;
			}else if(lxImg[i].width<lxImg[i].height&&lxImg[i].width>liWidth0){
				liWidth=liWidth1;
			}
			lxImg[i].style.height=Math.ceil(lxImg[i].height * liWidth/lxImg[i].width)+"px";
			lxImg[i].style.width=liWidth+"px";
		}
	}
	if(aiHeight!=null){
		for(var i=0;i<lxImg.length;i++){
			if(lxImg[i].height>aiHeight){
				lxImg[i].style.width=Math.ceil(lxImg[i].width * aiHeight/lxImg[i].height)+"px";
				lxImg[i].style.height=aiHeight+"px";
			}
		}
	}
}
/**
 * 更改好友列表每行显示的好友数目
 * @param {index:6} aoPara
 * 默认显示每行６个
 */
function alterBr(aoPara){
		if(!_$("friendArea")){
			return;	
		}
		var liIndex =  6;
		if(aoPara){
			liIndex = aoPara.index || liIndex;
		}
		var lxLi = _$("friendArea").getElementsByTagName("LI");
		for(var i = 0;i<lxLi.length;i++){
			if(lxLi[i].className == "br"){
				lxLi[i].parentNode.removeChild(lxLi[i]);
			}
		}
		for(var i = liIndex;i<lxLi.length;i=i+liIndex+1){
			var node = document.createElement("LI");
			node.className = "br";
			lxLi[i].parentNode.insertBefore(node,lxLi[i]);
		}
}	


function search(aoP,asConf){
	if (typeof(aoP)=="string") aoP=document.getElementById(aoP);
	if(aoP==null) return null;
	var loP=aoP;
	var loInput=loP.getElementsByTagName("INPUT")[0];

	loInput.value=asConf.defaultValue;

	loInput.onclick=function(){
		this.style.color="black";
		if(this.value==asConf.defaultValue) this.value="";
		else
			this.select();
	}
	loInput.onblur=function(){
		this.style.color="gray";
		if(this.value=="") this.value=asConf.defaultValue;
	}
	loInput.onkeyup=function(aoevt){
		var loevt=window.event||aoevt;
		if(loevt.keyCode==13){
			loP.toSearch();
		}
	}
	loP.toSearch=function(){
		if (loInput.form!=null) loInput.form.onsubmit=function(){return false}
		var lsInput=loInput.value;
		if(lsInput==""||lsInput==asConf.defaultValue) return;
		var loEVTobj={data:lsInput,returnValue:1}
		loP.onSearch(loEVTobj);
		if (loEVTobj.returnValue) document.location.href=[asConf.url,lsInput].join("");
	}
	loP.onSearch=loP.onSearch||function(aoEL){};
	return loP;
}

function template(aoP){
	if (typeof(aoP)=="string") aoP=document.getElementById(aoP);
	if(aoP==null) return null;
	var loP=aoP;
	var loUl=loP.getElementsByTagName("UL")[0];

	var hide=function(e){
		stopBubble(e);
		loUl.style.display="none";
	}
	var stopBubble=function(e){
		if (e) //停止事件冒泡
			e.stopPropagation();
		else
			window.event.cancelBubble = true;
	}
	var lxLi=loUl.getElementsByTagName("LI");
	for(var i=0;i<lxLi.length;i++){
		lxLi[i].onclick=function(e){hide(e)};
	}

	loP.onclick=function(e){
		stopBubble(e);
		loUl.style.display="block";
		
	}
	document.onclick=function(e){
		if(loUl.style.display=="block")
			hide(e);
	}

	return loP;
}

// start MySpace IM code
function get_url() { //el=str, case_sensitive=bool
	var rs="i";
	var urls = document.URL;
	urls = urls.replace(/'/g,"");

	var el = "friendID";
	var re = new RegExp( "\\?[\\w\\W]*"+ el +"=([^\\&\\?#]*)", rs);
	var arr = re.exec(urls);
	if(!arr){
		elg = "groupID";
		var red = new RegExp( "\\?[\\w\\W]*"+ elg +"=([^\\&\\?#]*)", rs);
		arr = red.exec(urls);
	}
	if(arr && arr.length>1)return arr[1];
	else{
		var expr = /\/([\w]*)$/i;
		arr = expr.exec(urls);
			if(arr && arr.length>1) {
				return arr[1].toLowerCase(); }
			else {
				return ''; }
	}
}
function getIMwin(h,w) {
	var getIMurl = "http://www.myspace.com/Modules/IM/Pages/GetIM.aspx";
	getIMurl =  "http://www.myspace.cn/chinaim";
	var getIMh = h;
	var getIMw = w;
	var getIMleft = (screen.availwidth-w)/2;
	var getIMtop =(screen.availheight-h)/2;
	//window.open(getIMurl,null,'height='+getIMh+',width='+getIMw+',left='+getIMleft+',top='+getIMtop+',status=no,toolbar=no,menubar=no,location=no');
	window.open(getIMurl);
}

function gotIM(){
	try{if (document.cookie && document.cookie.indexOf('imyspaceim') != -1)return true;}catch(err){}
	try{new ActiveXObject("MySpaceIMX.MySpaceIMPlugin.1");return true;}catch(err){}
	try{if(navigator.mimeTypes && navigator.mimeTypes.length>0)if(navigator.mimeTypes["application/myspaceim"])return true;}catch(err){}
	return false
}

function IsMySpaceIMInstalled(){IsMySpaceIMInstalledById(MO_MySpaceContext.DisplayFriendId||get_url());}
function IsMySpaceIMInstalledById(fid){
	if(gotIM())window.location.href='myim:sendIM?uID=0&cID='+fid;
	else getIMwin(475,600);
}
// end MySpace IM code

/**
 * @author CHENZX 2008.01.24
**/
var mbPageOnload=false;   
var miMaxTagsLength=0;
var _$=function(asID){
	return document.getElementById(asID);
}
var _p=function(aoEL){
	if (typeof(aoEL)=="string") aoEL=_$(aoEL);
	return (aoEL!=null)?(aoEL.parentElement||aoEL.parentNode):null;
}
function autochangeOBJWsize(aoEL,aiW){
	if (parseInt(aoEL.getAttribute("width"))>aiW){
		var lih=parseInt(aoEL.getAttribute("height"))*aiW/parseInt(aoEL.getAttribute("width"));
		aoEL.setAttribute("width",aiW);
		aoEL.setAttribute("height",lih);
	}	
}
function autochangeIMGWsize(aoEL,aiW){
	if (parseInt(aoEL.offsetWidth)>aiW){
		var lih=parseInt(aoEL.offsetHeight)*aiW/parseInt(aoEL.offsetWidth);
		aoEL.setAttribute("width",aiW);
		aoEL.setAttribute("height",lih);
		aoEL.style.width=aiW+"px";
		aoEL.style.height=lih+"px";
	}
}
function checksize(){
	//var liLMaxW=210;
	var liLMaxW=298;
	var liRMaxW=500;
	try{
	if (_$("narSect")!=null){
		var lxTags=_$("narSect").getElementsByTagName("OBJECT");
		for (var i=0; i<lxTags.length; i++){
			if(lxTags[i].id!="mini") autochangeOBJWsize(lxTags[i],liLMaxW);
		}
		var lxTags=_$("narSect").getElementsByTagName("EMBED");
		for (var i=0; i<lxTags.length; i++){
			if(_p(lxTags[i]).id!="mini")  autochangeOBJWsize(lxTags[i],liLMaxW);
		}
		lxTags=_$("narSect").getElementsByTagName("IMG");
		for (var i=0; i<lxTags.length; i++){
			autochangeIMGWsize(lxTags[i],liLMaxW);
		}
	}
	if (_$("wideSect")!=null){
		var lxTags=_$("wideSect").getElementsByTagName("OBJECT");
		for (var i=0; i<lxTags.length; i++){
			if(lxTags[i].id!="mini") autochangeOBJWsize(lxTags[i],liRMaxW);
		}
		var lxTags=_$("wideSect").getElementsByTagName("EMBED");
		for (var i=0; i<lxTags.length; i++){
			if(_p(lxTags[i]).id!="mini")  autochangeOBJWsize(lxTags[i],liRMaxW);
		}		
		lxTags=_$("wideSect").getElementsByTagName("IMG");
		for (var i=0; i<lxTags.length; i++){
			autochangeIMGWsize(lxTags[i],liRMaxW);
		}
	}
	if (!mbPageOnload){
		setTimeout("checksize()",1000);
	}
	}catch(err){}
}
checksize();
onload=function(){
	mbPageOnload=true;
}


/** 兴趣爱好自动链接 **/
function highlightInterests(elem)
{
		inputString = elem.innerHTML;
		var items= [
			"\\x2C",//,
			"\\x28",//(
			"\\x29",//)
			"\\x2D",//-
			"\\x3A",//:
			"\\x3B",//;
			"\\x2A",//*
			"\\x2F",///
			"\\x5C",//\
			"\\x2E",//.
			"\\x21",//!
			"\\x3F",//?
			"\\x7B",//{
			"\\x7D",//}
			"\\x5B",//[
			"\\x5D",//]
			"\\x2B",//+
			"\\x3C",
			"\\x3E",
			"\\u300A",
			"\\u300B",
			"\\u3002",
			"\\uFF0C",
			"\\u2018",
			"\\u2019",
			"\\u201c",
			"\\u201d",
			"\\u3001",
			"\\uff1f",
			"\\uff08",
			"\\uff09",
			"\\u300e",
			"\\u300f",
			"\\uff01",
			"\\uff5e"
		]
		eval("var Items = /([^\\s"+items.join("")+"]+([\\s]+[^\\s"+items.join("")+"]+)*)/g;"); 
		var HTML = /([\x3C\x3E])/gi;
		var outputString = inputString;
		if (!HTML.test(outputString) && outputString.indexOf('<z>') == -1)
		{
			outputString = outputString.replace(Items, "<A HREF=\"#\" CLASS=\"link_normal\" onclick=\"executeSearch(this.innerHTML);return false;\">$1</A>");
			elem.innerHTML = outputString;
		}
}
function executeSearch(linkRef)
{
	location.href = "http://cso.myspace.cn/search/searchinterest.php?kw=" + encodeURI(linkRef);
}
function checkprofilehobby(){
	if (_$("hobby")!=null)	{
		var lxDIVs=_$("hobby").getElementsByTagName("DIV");
		for (var i=0; i<lxDIVs.length; i++)
		{
			highlightInterests(lxDIVs[i]);
		}
	}else{
		setTimeout("checkprofilehobby()",500);
	}
}
checkprofilehobby();
/*
function duration(){
	if(window.attachEvent){
		window.attachEvent('onload', buildDuration);
	}else if(window.addEventListener){
		window.addEventListener('load', buildDuration, false);
	}
}
duration();
function buildDuration(){
	var loLocation=document.getElementById("template");
	var loNode=document.createElement("DIV");
	loNode.innerHTML=['用时<b>',MS_Duration,'</b>秒'].join("");
	loNode.style.cssText="position:absolute;left:525px;top:5px;color:gray";
	loLocation.parentNode.insertBefore(loNode,loLocation.nextSibling);
}	
*/

//Ajax 1.1
function initTextArea(aiMax){
    var lsValue = this.value;
	var liLeft = aiMax || 100;
	var liMax = aiMax ||100;
	
    if(lsValue){
		this.defValue = lsValue;
		this.style.color = "gray"
    }
    this.onclick=function(){
        if(this.value==this.defValue){
            this.value="";           
        }
        this.style.cssText=" color:black;";
    }
    this.onfocus=function(){
        if(this.value==this.defValue){
            this.value="";           
        }
        this.style.cssText=" color:black;";
    }
    this.onblur=function(){
        if(this.value==""){
            this.value=this.defValue;          
        }       
        this.style.cssText=" color:gray;";
    }
	this.onkeydown = function(){
		this.limitValue = this.value;
	}	
	this.onkeyup = function(){
		if(!this.tip){
			return;
		}
		liLeft = liMax - this.value.length;
		if(liLeft >=0){
			this.tip.innerHTML = "*还可以输入" + liLeft +"个字";
		}else{
			this.value = this.limitValue;
			this.tip.innerHTML = "*输入内容已经达到最大长度";
		}
	}
}
function totalLength(asEL){
    var liLength=0;
    if(asEL!=""){
        for(var i=0;i<asEL.length;i++){ 
            var code=escape(asEL.charAt(i)); 
            if((code.length>=4)&&(code<'%uFF60'||code>'%uFF9F')){ 
                liLength+=2; 
            } 
            else{ 
                liLength++; 
            }
        } 
    } 
    return liLength; 
}


function submitTip(aoP,asStr){
	asStr = asStr || "请求发送中";
	aoP.parentNode.innerHTML = asStr+'...';
}

function xCookie(){
	var loP={};
	loP.set=function(asName,asValue,aiDay){				//设置Cookie的值
	  var lsexpir = ""; 
	  if (aiDay){ 
	   var lodate = new Date(); 
	   var lomac = new Date(0);//修正MAC机器的BUG
	   var liskew = lomac.getTime();
		 if (liskew > 0)lodate.setTime(lodate.getTime() - liskew);
	   lodate.setTime(lodate.getTime()+(aiDay*24*60*60*1000)); 
	   lsexpir = "; expires="+lodate.toGMTString();	  
	  } 
	  document.cookie = asName+"="+asValue + lsexpir+"; path=/";
	}
	loP.get=function(asName){										 //获取Cookie的值
	  var nameEQ = asName + "=";
	  var ca = document.cookie.split(';'); 
	  for(var i=0;i < ca.length;i++) { 
	   var c = ca[i]; 
	   while (c.charAt(0)==' ') c = c.substring(1,c.length); 
	   if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 
	  }
	  return null; 
	}
	return loP;
}

 function submitComment(){
    if(_$("t_area").value==null){
        _$("t_area").value="";
    }
    if(_$("t_area").value.split(" ").join("")==""){
    	if(_$("picid").value == ""){
	        alert("内容不能为空！");
	        return false;   		
    	}else{
    		_$("t_area").value = " ";
    	}

    }
    if(_$("t_area").value.length>2000){
        alert("评论字数不能超过2000！");
        return false;
    }
    return true;
}
function submitEditComment(){
    if(_$("commentBody").value==null){
         _$("commentBody").value="";
    }
    if(_$("commentBody").value.split(" ").join("")==""){
	    if(_$("picUrlfield").value == ""){
	        alert("内容不能为空！");
	        return false;
	    }else{
	    	_$("commentBody").value = " ";
	    }
    }

    if(_$("commentBody").value.length>2000){
        alert("评论字数不能超过2000！");
        return false;
    }
    submitTip(_$("SubmitCommentButton"),'发送中');
    return true;
} 
function toInsertPic(){
	ContactBox.canPostComment = true;
	//ContactBox.clickLink("publishComment");
	setTimeout(
		function(){
			if(ContactBox.canPostComment){
				_$('insertPic').showLayer();
				_$('insertPic').changeModule("OnlinePic");
			}
		},500
	)
}
function toInsertEditPic(){
	_$('insertPic').showLayer();
	_$('insertPic').changeModule("OnlinePic");	
}

function toInsertPainter(){
	ContactBox.canPostComment = true;
	//ContactBox.clickLink("publishComment");
	setTimeout(
		function(){
			if(ContactBox.canPostComment){
				_$('insertPic').showLayer();
				_$('insertPic').changeModule("Draw");
			}
		},500
	)
}
function toInsertEditPainter(){
	_$('insertPic').showLayer();
	_$('insertPic').changeModule("Draw");
}





 function valiateUserRelationInProfile(){
	var lsService = "profileservice.asmx/GetSendCommentStatusForReply";
	var loRelationReq = {
		"ajaxservice": lsService,
		"json": {
			"receipantId":MO_MySpaceContext.DisplayFriendId,
			"type":"profile"
		}
	}
	var loResp = _api(loRelationReq);
	if(loResp.Result == 0){
		ContactBox.canPostComment = true;
	}else{
		ContactBox.canPostComment = false;
		if(loResp.Result == 2){
			location.href = loResp.RedirectUrl;
		}else if(loResp.Result == 1){
			alert(loResp.Message);
		}
	}
 }
 
 function postCommentInProfile(){
 	var lsVal = document.getElementById("t_area").value;
	if(!/\S/.test(lsVal)){
		alert("请输入留言内容！");
		return false;
	}
	var lsService = "profileservice.asmx/ProfilePostComment";
	var loRelationReq = {
		"ajaxservice": lsService,
		"json": {
			"msg":encodeURIComponent(lsVal.split("\r\n").join("<br />").split("\n").join("<br />")),
			"picUrl":document.getElementById("picurl").value,
			"receipantId":MO_MySpaceContext.DisplayFriendId,
			"type":"profile",
			"captcha":""
		}
	}
	var loResp = _api(loRelationReq);
	
	//loResp = {"__type":"MySpace.Web.Services.Profile.CommentWrapper","Result":1,"Message":"不允许给该用户发评论","UserId":0,"DisplayName":"MyTest","OnLineNow":true,"PostDate":"2008年8月25日 17:31:00","CommentBody":"HelloWorld","UserImage":"http://b2.ac-images.cdnmyspace.cn/cnimages01/1/s_c57b217291f83dc70f09462256644b4c.png","CommentId":5555};
	
	if(loResp.Result == 0){		
		insertComment(loResp);
		document.getElementById("t_area").value = "";
		restoreInsertPic();
	}else if(loResp.Result == 2){
		location.href = loResp.RedirectUrl;
	}else{
		alert(loResp.Message);
	} 	
 }
 
 function restoreInsertPic(){
    MO_InsertPic.commentPic.value = "";
    MO_InsertPic.commentPicUrl.value = "";
    MO_InsertPic.prePicList.innerHTML = '';               
    MO_InsertPic.prePicList.style.display="none";
    MO_InsertPic.prePicTotal.style.display="none";
    MO_InsertPic.insertPic.style.display="block"; 	
 }
 
 function insertComment(aoData){
 	var lsId = aoData.UserId;
 	var lsCommentId = aoData.CommentId;
 	var lsName = aoData.DisplayName;
 	var lsImage = aoData.UserImage;
 	var lsOnline = "";
 	if(aoData.OnLineNow){
 		lsOnline = '<img height="20" width="80" class="ImgOnlineNow" alt="Is Online"  src="http://x.myspace.cn/images/CN/onlinenow.gif"/>';
 	}
 	var leTab = document.getElementById("commentList");
 	var leTr = leTab.insertRow(0);
 	leTr.setAttribute("uid",lsId);
 	leTr.setAttribute("cid",lsCommentId);
 	var leTd0 = leTr.insertCell(0);
 	leTd0.className = "td0"; 	
 	var leTd1 = leTr.insertCell(1);
 	leTd1.className = "td1";
 	
	var lsRightLinks = '<a href="javascript:void(0)" class="link_normal" onclick="deleteComment(this)" id="commentDel">删除</a>';
	
 	var lsHTML0 = ['<a title="',lsName,'" href="http://www.myspace.cn/',lsId,'" class="link_user">',lsName,'</a><a title="',lsName,'" href="http://www.myspace.cn/',lsId,'" class="userPic"><img onload="imgSize([this],[90])" alt="',lsName,'" title="',lsName,'" src="'+lsImage+'" class="avatar"/></a>',lsOnline,'<br/>'].join("");
 	var lsHTML1 = ['<div class="when"><span class="text_normal">',aoData.PostDate,'</span></div><p class="comment"><span class="text_normal">',aoData.CommentBody,'</span><div class="commentLinks"><div class="leftDiv"></div><div class="rightDiv">',lsRightLinks,'</div></div></p>'].join("");
 	leTd0.innerHTML = lsHTML0;
 	leTd1.innerHTML = lsHTML1;
 	
 }
 
 function deleteComment(aeNode){
	if(!confirm("您确定要删除该条留言吗？")){
		return false;
	} 	
 	var leParent = aeNode.parentNode.parentNode.parentNode.parentNode;
 	var lsCid = leParent.getAttribute("cid");
 	var lsUid = leParent.getAttribute("uid");
 	var lsService = "profileservice.asmx/DeleteComment";
	var loRelationReq = {
		"ajaxservice": lsService,
		"json": {
			"commentId":parseInt(lsCid),
			"userId":parseInt(lsUid),
			"displayFriendId":MO_MySpaceContext.DisplayFriendId
		}
	}
	var loResp = _api(loRelationReq);
	if(loResp.Result == 0){
		leParent.style.display = "none";
	}else if(loResp.Result == 2){
		location.href = loResp.RedirectUrl;
	}else{
		alert(loResp.Message);
	}	
 }
 
 function feedBackInProfile(aeNode){
	var leParent = aeNode.parentNode.parentNode.parentNode.parentNode;
	MO_MySpaceContext.ReceipantId = leParent.getAttribute("uid");
	var lsName = leParent.getElementsByTagName("a")[0].getAttribute("title");
	var leArea = document.getElementById("t_area");	
	leArea.value = "回复 "+lsName+" ：";
	leArea.focus();
 }
 
 function previewCommentInProfile(){
 	var lsVal = document.getElementById("t_area").value;
	if(!/\S/.test(lsVal)){
		alert("请输入留言内容！");
		return false;
	} 
	var leHidden = document.getElementById("receipantId");
	if(leHidden){
		leHidden.value = MO_MySpaceContext.ReceipantId || -1;
	}	
 	var leForm = document.forms["pubishComent"];
 	leForm.submit();
 }
function userRank(){
	var leTrigger = document.getElementById("userRank");
	var leDetail = document.getElementById("rankDetail");	
	if(!leTrigger || !leDetail){
		return false;
	}
	leTrigger.onmouseover = function(){
		leDetail.style.display = "block";
	}
	leTrigger.onmouseout = function(){
		leDetail.style.display = "none";
	}
}

 /**
 * by yjz
 * */
 function followFriend_lj(aeP, aoParam){
    var loBlockUserReq = {
        "ajaxservice": "profileservice.asmx/MakeFollowShip",
        "json": {
            "friendId": aoParam.friendId,
            "sendNotify":true
        }
    }
 
   	var lsResult =  _api(loBlockUserReq);
   	switch (lsResult.result) {
    	case 0:{
    		countFollowFriend_lj(null, "sure");
    		var ley = document.getElementById("followingFriend");
    		ley.style.display = "inline";
    		aeP.style.display = "none";
	        break;
        }
        default:{
        	alert(lsResult.message);
        }
  	}

 }

 function cancelFollowFriend_lj(aeP, aoParam){
 	var isCanelFollow = confirm("是否确定要对 "+aoParam.friendName+" 取消关注？取消后将不能看到对方的动态更新");
 	if(!isCanelFollow){
 		return false;
 	}
    var loBlockUserReq = {
        "ajaxservice": "profileservice.asmx/BreakFollowShip",
        "json": {
            "friendId": aoParam.friendId
        }
    }
 
   	var lsResult =  _api(loBlockUserReq);
   	switch (lsResult.result) {
    	case 0:{
    		countFollowFriend_lj(null, "cancel");
    		var leN = document.getElementById("followFriend");
    		leN.style.display = "inline";
    		aeP.parentNode.style.display = "none";
	        break;
        }
        default:{
        	alert(lsResult.message);
        }
  	}
 }
 
 function countFollowFriend_lj(aeP, isFollow){
 	var leCountImg = document.getElementById("countFollowFriendImg");
 	if(!leCountImg){
 		leNewIMG = document.createElement("img");
 		leNewIMG.setAttribute("id", "countFollowFriendImg");
 		document.body.appendChild(leNewIMG);
 		leCountImg = leNewIMG;
 	}
 	leCountImg.src = "http://count.myspace.cn/images/follow.gif?ver="+(new Date()).getTime()+"&isFollow="+isFollow;
 	leCountImg.style.display = "none";
 }
 
function resizeKnWidgetHeight(aiFlag){
	var leFrame = document.getElementById("apppanel_102234_profileleft");
	if(!leFrame){
		return;
	}
	var liUnit = 505;
	if(aiFlag<0){
		var liHeight = parseInt(leFrame.height)-liUnit;
		if(liHeight<130){
			leFrame.height=125;
		}else{
			leFrame.height=liHeight;
		}
	}else{
		leFrame.height=parseInt(leFrame.height)+liUnit;
	}
}