	function fnViewAllComment(commentcnt,statusid)
	{
		for(i=2;i<=commentcnt;i++)
		{
			document.getElementById("id_tr_" + i + "_" + statusid).style.display="";
		}
		
		document.getElementById("id_maintr_" + statusid).style.display="none";
		
	}
	
	function fnHideSmallTextBox(txtid)
	{
		//alert(document.getElementById(txtid).style.display);
		document.getElementById(txtid).style.display='none';
	}
	
	function fnIncreaseHieghtofTA(elementid)
	{
		elementid.style.height = elementid.scrollHeight + 'px';
	}


	function fnCheckConversationCharCnt(statusid)
	{ 
		var strText;
		var strTextLen;
		strDivId="id_txtWhatAreUWorking_"+statusid; 
		strCharDivId="id_charConvtextCnt_"+statusid; 
		strEnterButton = "btnaddcomment_"+statusid;
		strText = document.getElementById(strDivId).value;
		
			if(1000 - strText.length >= 20)
			{
				document.getElementById(strCharDivId).className = "charcount";
			}
			else if((1000 - strText.length < 20) &&  (1000 - strText.length > 10) )
			{					
				document.getElementById(strCharDivId).className = "charcount20";
			}
			else
			{
				document.getElementById(strCharDivId).className = "charcountnegative";
			}
			
			if(1000 - strText.length  < 0)
			{
				document.getElementById(strEnterButton).src = "images/btn_enterdisable.gif";
			}
			else
			{
				document.getElementById(strEnterButton).src = "images/btn_enter.gif";
			}
			if((1000 - strText.length <= 999) && (1000 - strText.length > -1)){ 
				try{
					ajax_hideTooltip();
				}
				catch(e){}
			}
	
			document.getElementById(strCharDivId).innerHTML = (1000 - strText.length); 
	}



	function fnSetClass(statusid)
	{
		document.getElementById("id_txtWhatAreUWorking_"+ statusid).className = "inputblack";
	}




	function fnShowCommentBoxer(statusid)
	{
		if(document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "" || document.getElementById("id_txtWhatAreUWorking_"+statusid).value == "Write a Comment...")
		{
			document.getElementById("id_txtWhatAreUWorking_"+statusid).style.height = "85px";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).value = "";
			document.getElementById("submit_"+statusid).style.display = "";
			document.getElementById("id_txtWhatAreUWorking_"+statusid).focus();
		}
	}
	
	
	
	/*function fnChkCommentTxt(loginuserid,straction,txtRecId,txtque,txttype)
	{
		var strText;
		var strExtraparam;
		var strToolTipParam;

		if(txtRecId == "" || txtRecId == 0)
		{
			strText = document.getElementById('id_txtWhatAreUWorking').value;
			strExtraparam = "";
		}
		else
		{
			strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
			strExtraparam = "&parentid="+txtRecId;
			strToolTipParam="id_ErrCommentDiv_"+txtRecId;
			strToolTipParamexceed="id_ErrorConvMessageExceedDiv_"+txtRecId;
		}		
		
		if(strText == "" || strText == "Write a Comment...")
		{
			ajax_showTooltip(strToolTipParam,document.getElementById("btnaddcomment_"+txtRecId),250,30);
			//alert("Enter Text For 'What good work are you doing right now?' ");
			return false;
		}
		else if(1000 - strText.length  < 0)
		{
			strDivId= "btnaddcomment_"+txtRecId;
			ajax_showTooltip(strToolTipParamexceed,document.getElementById(strDivId),280,50);
			return false;
		}
		else
		{
			
			
			var myarry = new Array();
			myarry = strText.split(' '); 
			for (i=0;i<myarry.length;i++)
			{	
				if((myarry[i].length) >= 25)
				{	
					if((!myarry[i].match("http://")) && (!myarry[i].match("www")) && (!myarry[i].match("http://www")) && (!myarry[i].match("https://")))
					{
						ajax_showTooltip('id_ExceedGoodWorkWord',document.getElementById('btnaddcomment_'+txtRecId),200,40);
						return false;
					}		
				}
			}
			
			
			if (parseInt(txtRecId) > 0)
				fnShowDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
			else
				{
					fnShowDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
					strText = strText.substring(0, 140);
				}
			//strText = escape(strText);
	 		//strText = strText.replace(/\r?\n/g,'<br/>');
			strText=Base64.encode(strText);
		 
			var ajaxIndex = ajaxObjects.length;	
			ajaxObjects[ajaxIndex] = new sack();
			ajaxObjects[ajaxIndex].requestFile = sitename+"/index.php?action=setunsetsessionvars&mode=ajax&ajax_action=setsessionparams&settoparams=forwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId+"&que="+txtque+"&s="+txttype;
			ajaxObjects[ajaxIndex].onCompletion = function(){
																if(loginuserid == 0 || loginuserid == "")
																{
																	if (parseInt(txtRecId) > 0)
																		fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																	else
																		fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																	Lightbox.showBoxByID('divRegisterLogin', 625,385);
																	return false;
																}
																else
																{
																	ajaxObjects[1] = new sack();			
																	ajaxObjects[1].requestFile = sitename+"/index.php?action=checkuseractype";
																	ajaxObjects[1].onCompletion = function(){
																												if (ajaxObjects[1].response == 1)
																												{
																													fnProcessAjaxCode(10);
																												}
																												else if (ajaxObjects[1].response == 2)
																												{
																													document.getElementById('divRegisterLogin').innerHTML = "";
																													//Lightbox.showBoxByID('divRegisterLogin', 560,345);
																													Lightbox.showBoxByID('divRegisterLogin', 625,385);
																													fnProcessAjaxCode(10);
																												}
																												else
																												{
																													//alert("You do not have permission to add \"What good work are you doing right now?\"");
																												}
																											}
																	ajaxObjects[1].runAJAX();
																
																}
															};	// Specify function that will be executed after file has been found
			ajaxObjects[ajaxIndex].runAJAX();
			
			
		}
		
	}*/
/* ==================== AMOL END ===================== */





function fnAddGoodWork(loginuserid, straction, txtRecId) //approveflag required for Events Comment 8 april 2009 Chaitanya
	{ 
		var strText;
		var strExtraparam;
		var strToolTipParam;
		
		
		strText = document.getElementById('id_txtWhatAreUWorking_'+txtRecId).value;
		strExtraparam = "&parentid="+txtRecId;
		strToolTipParam="id_ErrCommentDiv_"+txtRecId;
		strToolTipParamexceed="id_ErrorConvMessageExceedDiv_"+txtRecId;
		
		
		
		
		Lightbox.refreshAfterClose=1;
		
		
		
		if(strText == "" || strText =="Enter update here...")
		{
			ajax_showTooltip(strToolTipParam, document.getElementById('btnaddcomment_'+txtRecId), 250, 50);
			//alert("Enter Text For 'What good work are you doing right now?' ");
			return false;
		}
		else if(1000 - strText.length  < 0)
		{
			strDivId= "btnaddcomment_"+txtRecId;
			ajax_showTooltip(strToolTipParamexceed,document.getElementById(strDivId),280,50);
			return false;
		}
		else
		{	
		
			var myarry = new Array();
			myarry = strText.split(' '); 
			for (i=0;i<myarry.length;i++)
			{	
				if((myarry[i].length) >= 25)
				{	
					if((!myarry[i].match("http://")) && (!myarry[i].match("www")) && (!myarry[i].match("http://www")) && (!myarry[i].match("https://")))
					/*if(!myarry[i].match("http://"))*/
					{
						ajax_showTooltip('id_ExceedGoodWorkWord',document.getElementById('btnaddcomment_'+txtRecId),200,50);
						return false;
					}		
				}
			}
			
		
			
			
			if (parseInt(txtRecId) > 0)
				fnShowDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
			else
				{
					fnShowDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
					strText = strText.substring(0, 140);
				}
		
			
			strText=Base64.encode(strText);
			
			
	 		
			
			if (straction == "" || straction == "seventhgeneration")
				straction = "seventhgeneration?isnewu=1";
				
			ajaxObjects[0] = new sack();
			ajaxObjects[0].requestFile = sitename+"/index.php?action=sgajaxseventhgeneration&mode=ajax&ajax_action=sgsetsessionparams&settoparams=sgforwgwrud&location="+straction+"&txtWhatAreUWorking="+strText+"&parentid="+txtRecId;
			ajaxObjects[0].onCompletion = function(){
																if(loginuserid == 0 || loginuserid == "")
																{
																		// FOR LOADER IMAGE DIV
																		if (parseInt(txtRecId) > 0)
																			fnHideDefauleLoaderImage("id_GoodworkEnter_"+txtRecId,"id_GoodworkLoader_"+txtRecId);
																		else
																			fnHideDefauleLoaderImage("id_GoodworkEnter","id_GoodworkLoader");
																		
																		//Lightbox.showBoxByID('divRegisterLogin', 570,345);
																		Lightbox.showBoxByID('divRegisterLogin', intLoginPopupWidth, intLoginPopupHeight);
																		return false;
																}
																else
																{			
																	fnProcessAjaxCode(34);
																}
															};	// Specify function that will be executed after file has been found
			ajaxObjects[0].runAJAX();
		}
		return true;
	}