
var  entityConfiguration = new Object();
//COMMENTED BY NILEEMA MOHANTY gOrgFolder IS ALREADY DEFINE 
//ONLY THIS FILE IS REQUIRED TO INCLUDE AFTER DECLARATION 
var gOrgFolder = "oxford";
/**
 * The name of the current entity. This should be unique across the Application. 
 */
var gCurrentEntity;
var gBeforeHeaderMessage;
/**
 * This is the Search Template to be used for the current Entity.
 */
var gCurrentSearchTemplate;
/**
 * The Template for Adding and Editing the current Entity.
 */
var gCurrentAddEditTemplate;
/**
 * The Template for showing a List of current Entity.
 */
var gCurrentListTemplate;
/**
 * The Template for showing a List of current Entity.
 */
var gCurrentViewTemplate;
/**
  * The Primary Key field of the Entity.
  */
var gCurrentEntityIdField;
/**
 * The URL to invoke to fetch the Image of selectec Entity for Editing.
 */
var gCurrentEntityPreEditURL;
/**
 * The URL to be invoked for getting the list of Entities.
 */
var gCurrentEntityListURL;
/**
 * The URL to be invoked for Saving the Entity to the Database.
 */
var gCurrentEntitySaveURL;
/**
 * The URL to be invoked to fetch the details to fill the Lists in the
 * different fields of the Entity. E.g. to get the list of Clients, Project
 * Statuses and Project Types when Project is being Added or Searched for.
 * For Editing of Project this list will be made available with the details
 * of the Entity being Edited. 
 */
var gCurrentEntityPreURL;
/**
 * The Id of the Entity being Edited.
 */
var gCurrentEntityIdForEdit;
/**
 * The Login Key of the user for this Session.
 */
var gLoginKey = "<%=lLoginKey%>";
/**
 * Function to be called after AddEdit Screen is shown.
 */
var gPostAddEdit;
/**
 * Function to be called after Search Screen is shown.
 */
var gPostSearch;
/**
 * Function to be called after List Screen is shown.
 */

var gPostList;
var gEntityConfig;
var gGrid;
var gDOM;
var gUtil;
var gClearAddEdit = true;
var menus;
var tree;

/**
 * Predefined Parent id ,  description 
 * To be used for adding sub predefined task.  
 */
var gPDTParentId;
var gPDTParentName;

function showtagcloud()
	{
    
     var gOrgID='3';
     var etIDtag='106';
	 var lAJAXInteraction = new AJAXInteraction("/dotcom/"+gOrgFolder+"/TagCloud/TagCloud.kar?gOrgID="+gOrgID+"&etIDtag="+etIDtag, handleTagCloud, false);
      var lRequest = lAJAXInteraction.doPost('LK=' + gLoginKey);
    
	}

function handleTagCloud(pXMLObject)
{
	 //alert("------------handleTagCloud"+pXMLObject);
	var lXMLResponse;
     lXMLResponse = pXMLObject.responseXML;
	// alert("handleTagCloud lXMLResponse:"+lXMLResponse);
	var lSuccess;
	var lStatus;
	var lMessage;
	var lParam;
	var lFocusField;
	var lCount;
	var lList;
	var size;
	var lRoot = lXMLResponse.documentElement;
//	alert(lRoot);
	lRoot = copyNodes(lRoot);
	lSuccess = false;
var		pResult = lRoot.childNodes[0];
	if (pResult.attributes != null)
	{
		lStatus = null;
		lMessage = null;
		lStatus = pResult.attributes.getNamedItem("STATUS").value;
		if (lStatus != null)
		{
			lSuccess = (lStatus == "0");
		}
	}
		if (lSuccess)
	{
		if (lRoot.childNodes.length == 2)
		{
			lList = lRoot.childNodes[1];
		}
		else
		{
			lList = lRoot.childNodes[2];
		}
	
	}

				var list = lList.childNodes[0];
				var sp="<img align=\"absmiddle\" style=\"margin-left:0px;\" src=\"\TagCloud\\jsp\\tag.png\"/><span class=\"righttxt\">Popular Tags</span><br/>";
				var maximum=list.childNodes[0].attributes.getNamedItem("COUNTER").value;
				//alert("first value is "+maximum);
				var comp;
				var comp1;
			
			for(i=1;i<=list.childNodes.length;i++)
				{
			
					if(list.childNodes[i])
					{
						
						comp = list.childNodes[i].attributes.getNamedItem("COUNTER").value;
                                    
						if (eval(comp)>eval(maximum))
						{
                                            
                                              	maximum=comp;
						}
					}

				}
			
				//alert("max is:"+maximum);
				for(i=0;i<=list.childNodes.length;i++)
		{
					if(list.childNodes[i])
			{
						//alert("tc1");
				var term = list.childNodes[i].attributes.getNamedItem("TERM").value;
				var counter1 = list.childNodes[i].attributes.getNamedItem("COUNTER").value;
                            
				var counter=Math.ceil(((counter1/maximum)*100));
				if (counter <20)
					{
						size = 'script1';
					} 
				else if (counter>= 20 && counter <40) 
					{
						size = 'script2';
					} 
				else if (counter>= 40 && counter <60) 
					{
						size = 'script3';
					} 
				else if (counter>= 60 && counter <80) 
					{
						size = 'script4';
					} 
				else if (counter>= 70 && counter <80) 
					{
						size = 'script5';
					} 
				else if (counter>= 80 && counter <90) 
					{
						size = 'script6';
					} 
				else 
					{
						size = 'script7';
					}
				sp=sp+"<a class="+size+" title="+term+" href='javascript:tagSearch(\""+term+"\")'>"+term+"</a>";
				
			}
			}
			//sp=sp+"</p>";
			//alert("tc2");
			document.getElementById("tagcloud").innerHTML=sp;
			//alert("tc3");



}

function tagSearch(tagvalue)
	{
	
      document.tagFormSubmit.keyword.value=tagvalue;
      document.tagFormSubmit.submit();
	  tagcloudImpl(tagvalue);
	}


