function autoResize(id){
   
    var newheight;
    if(document.getElementById){
       if(isIE()){
        newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
        }else {
        newheight = document.getElementById(id).contentWindow.document.documentElement.scrollHeight;
        }
    }

    document.getElementById(id).height= (newheight) + "px";
}
//******************************************************************************
function firstDictShow(lng,cid,concept,readOnly){
    var urlStr = "dict_showEntries.jsp?lng="+lng+"&cid="+cid+"&concept="+concept+"&readonly="+readOnly;
	if(readOnly==0) {
		loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer');
    } else {
	    loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer','GET','','loadCnBrowser('+cid+')');
    }
	    
}
//********************************************************************************
function loadCnBrowser(cid){
   var urlStr = "cn_relationBrowser.jsp?cid="+cid;
   loadContent(urlStr,'conceptnetwokbrowser','conceptnetwokbrowsercontaine','GET','','loadRelationBrowser2()');
}
function loadRelationBrowser2(){
	var dsfn = byId("dsfn").value
	swfobject.embedSWF("cn_RelationBrowser.swf?dataSource="+dsfn, "rbContainer", "1020", "590", "9.0.0");
}
//********************************************************************************
function selectedLanguageTab(selTabId,urlStr, tabGroupName){
	    var previousSelectedTabId = tabMap.get(tabGroupName)
		if(previousSelectedTabId != null){		
			var tab = byId(previousSelectedTabId);
			tab.className = "tabitem tabitembg tabborderleft tabbordertop tabborderbottom";
		}
		tab = byId(selTabId);
		
		tab.className = "tabselecteditem tabborderleft tabbordertop";
		tabMap.put(tabGroupName, selTabId)
		tstr = new Date().getTime();
		tstr = "&t="+tstr;
		urlStr += tstr;
		loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer','GET','', "scroll()");
		//MaVar = setTimeout("scroll('1000')",2500);
}
//*******************************************************************************
function creatEntry(lng,cid,concept){
var urlStr= "dict_creatEntry.jsp?lng="+lng+"&conceptid="+cid+"&conceptstr="+concept;
loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer','GET','', "scroll()");
//MaVar = setTimeout("scroll('1000')",10); 
}
//*******************************************************************************
function editEntry(i){

 var lng = byId('editlanguageId'+i).value;
 var entryId = byId('editentryId'+i).value;
 var entryStr = byId('editentryStr'+i).value;
 var conceptId = byId('editconceptcid'+i).value;
 var conceptStr = byId('editconceptstr'+i).value;
 var attributes = byId('editattributes'+i).value;
 var comment = byId('editcomment'+i).value;
 var priority = byId('editpriority'+i).value;
 var frequency = byId('editfrequency'+i).value;
 
/*
 entryStr = encodeURIComponent(entryStr.unicodeEncode());
 comment = encodeURIComponent(comment.unicodeEncode());

*/
 attributes = encodeURIComponent(attributes.unicodeEncode());  
 var urlStr = "dict_editEntry.jsp?lng="+lng+"&entryid="+entryId+"&entrystr="+entryStr+"&conceptid="+conceptId+"&conceptstr="+conceptStr;
 urlStr += "&attributes="+attributes+"&comment="+comment+"&priority="+priority+"&frequency="+frequency; 
 loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer','GET','', "scroll()");
 //MaVar = setTimeout("scroll('1000')",10); 
}
//*******************************************************************************
function scroll(){
window.scrollBy(0,300);
}
//*******************************************************************************
function backToEntriesShow(cid,concept,lng){
 var urlStr = "dict_showEntries.jsp?lng="+lng+"&concept="+concept+"&cid="+cid+"&readonly="+0;
 loadContent(urlStr, 'dictentriesshow','dictentriesshowcontainer','GET','', "scroll()");
 //MaVar =  setTimeout("scroll('1000')",2500);
}
//*******************************************************************************
function addAttributes(allAttribs,attribs){
result="";
var allAtt = document.getElementById(allAttribs);
var att = document.getElementById(attribs);
nbLAllAtt = allAtt.options.length;
nbLAtt = att.options.length;

cpt=0;
if(nbLAtt > 0){
for(i=0;i<nbLAtt;i++){
    if (result == "")
          result=att.options[cpt].text;
    else
          result=result + "," + att.options[cpt].text;
  cpt++;
}
}
var attTab = new Array();
if(result!="")
  attTab = result.split(",");

result="";
cpt=0;
while (cpt<nbLAllAtt)
{
  if (allAtt.options[cpt].selected)
    if (result == "")
            result=allAtt.options[cpt].text;
    else
   result=result + "," + allAtt.options[cpt].text;
cpt++;
}
var allAttSelectedTab = new Array();
if(result!="")
    allAttSelectedTab = result.split(",");

if(allAttSelectedTab.length > 0)
{
   for(i=0;i<allAttSelectedTab.length;i++)
   {
     element = allAttSelectedTab[i]; 
     if(!exist(element,attTab))
     		attTab.push(element);
   }
 }
attTab.sort();   
for(i=0;i<attTab.length;i++)
 att.options[i] = new Option(attTab[i],attTab[i]);
for(i=0;i<nbLAllAtt;i++){
	allAtt.options[i].selected = ""; 
}
}
//******************************************************************************
function removeAttributes(allAttribs,attribs){
var att = document.getElementById(attribs);
nbLAtt = att.options.length;
result="";
var cpt=0;
selectedIndexs = new Array();
for(i=0;i<nbLAtt;i++)
{
  if (att.options[i].selected)
   {
     selectedIndexs[cpt++] = i;
    }
}
for(i=selectedIndexs.length-1;i>=0;i--)
   att.remove(selectedIndexs[i]);
}
//************************************************************************************
function addAttributeTo(i,allAttribs,attribs){
result="";
var allAtt = byId(allAttribs);
var att = byId(attribs);
nbLAtt = att.options.length;
cpt=0;
if(nbLAtt > 0){
for(i=0;i<nbLAtt;i++){
    if (result == "")
          result=att.options[cpt].text;
    else
          result=result + "," + att.options[cpt].text;
  cpt++;
}
}
var attTab = new Array();
if(result!="")
  attTab = result.split(",");
//document.getElementById('liste').options[document.getElementById('liste').selectedIndex].value
if(!exist(allAtt.options[allAtt.selectedIndex].text,attTab))
		attTab.push(allAtt.options[allAtt.selectedIndex].text);
attTab.sort();   
for(i=0;i<attTab.length;i++)
 att.options[i] = new Option(attTab[i],attTab[i]);
	allAtt.options[allAtt.selectedIndex].selected = ""; 
}
//************************************************************************************
function removeAttributeFrom(i,allAttribs,attribs){

	var att = byId(attribs);
	att.remove(att.selectedIndex);
}
//************************************************************************************
function exist(x,tab)
{
  for(j=0;j<tab.length;j++){
   if(tab[j] == x)
    return true 
  }
  return false;
}
//****************************************************************************************************
function saveDictEntry(lng,entryId,cid,ent,att){	
  var entry = byId(ent).value;
  var attribs = byId(att);
  if(entry==""){
      alert("No entry!!!");
   	  resp = false; 
   }else{
        attStr = "";
        var conceptId = byId('dictconceptidcreate').value;
        var conceptStr = byId('dictconceptcreate').value;
        var comment = byId('commentedit').value;
        var prior = byId('priorityedit').value;
        var freq = byId('frequencyedit').value;
        size = attribs.options.length;
        
    	 	for(i=0;i<size;i++){
    	 		for(i=0;i<attribs.options.length;i++){
            		
    	 			attribs.options[i].selected = true;
            		attStr += attribs.options[i].text+","; 	
    	 		}
    	 	}
        attStr = encodeURIComponent(attStr.unicodeEncode());
        entry = encodeURIComponent(entry.unicodeEncode());       
        comment = encodeURIComponent(comment.unicodeEncode());
        var cStr = escape(conceptStr);
        var dataStr = "lng="+lng+"&entryid="+entryId+"&entrystr="+entry+"&conceptid="+conceptId+"&conceptstr="+conceptStr+"&comment="+comment.trim();
	   	    dataStr += "&priority="+prior+"&frequency="+freq+"&attributes="+attStr;
	   	var urlStr = "dict_saveEditedEntry.jsp?";
	   	//console.log("..."+dataStr+"...");
	   	 loadContent(urlStr,'dictentriesshow','dictentriesshowcontainer',"POST",dataStr,"backToEntriesShow('"+cid+"','"+cStr+"','"+lng+"')"); 	
       																					
       }
}          
//****************************************************************************************************
function saveEntry(lng,ent,att,cas){

 var entry = byId(ent).value;
 var attribs = byId(att);
 if(entry==""){
      alert("No entry!!!");
   	  resp = false; 
   }else{
        attStr = "";
        var conceptId = byId('dictconceptidcreate').value;
        if(conceptId=='-none-')
        	conceptId=0;
        var conceptStr = byId('dictconceptcreate').value;
        if(conceptStr=='-none-')
        	conceptStr='not defined';
        var comment = byId('commentCreate').value;
        var prior = byId('priorityCreate').value;
        var freq = byId('frequencyCreate').value;
        if(attribs.options.length > 0){
        	for(i=0;i<attribs.options.length;i++){
        		attribs.options[i].selected = true;
        		attStr += attribs.options[i].text+","; 
        		}
           attStr =  encodeURIComponent(attStr.unicodeEncode());
         }
        entry = encodeURIComponent(entry.unicodeEncode());
        comment = encodeURIComponent(comment.unicodeEncode());
        var cStr =  escape(conceptStr);
        var dataStr = "lng="+lng+"&entry="+entry+"&conceptid="+conceptId+"&conceptstr="+conceptStr+"&comment="+comment.trim();
	   	    dataStr += "&priority="+prior+"&frequency="+freq+"&attributes="+attStr;
	   	var urlStr = "dict_saveEntry.jsp?";
	   	//console.log("..."+dataStr+"...");
	   	  
	   	  if(cas==1){
	   	        var cid = byId('creatEntryCId').value;
	   	 		loadContent(urlStr,'dictentriesshow','dictentriesshowcontainer',"POST",dataStr,"backToEntriesShow('"+cid+"','"+cStr+"','"+lng+"')"); 
	   	 		} 
	   	  else {
	   	        loadContent(urlStr,'dictcreateentrypage','dictcreateentrypagecontainter',"POST",dataStr,"entryAdded()");
	   	        }
	   	  	
       }
}
//****************************************************************************************************
function closeWindow(cas){
 	if(cas==1) 
		window.history.back();
	if(cas==2){
    	byId("dictcreate").value ="";
    	hide("dictcreateentrypagecontainter");
    	hide("dictcreateentrypage");
		}	
    if(cas==3){
    	byId("dictattsearch").id.value="*";
    	hide("dictattsearchresultscontainter");
    	hide("dictattsearchresultsr");
     }
    if(cas==4){
      	var id = byId("dictsearch");
      	id.value="";
      	hide("dictsearchresultscontainter");
      	hide("dictsearchresults");
       }
    if(cas==5){
		byId("dictattcreate").value="";
    	hide("dictcreateattpagecontainter");
    	hide("dictcreateattpage");
		}	
    if(cas==6){
    	var concept = byId('dictconceptcreate').value;
    	if(concept!='-none-'){
    		hide('entrycreatconceptsearchcontainter');
	    	hide('entrycreatconceptsearch');
    	}
    	
    	else{
    		resp = window.confirm("you didn't choose any concept for this entry. Do you want to continue?");
		 	if(resp){
		 		byId('entrycreateconceptsearch').value='';
		 		hide('entrycreatconceptsearchcontainter');
		    	hide('entrycreatconceptsearch');
		 	}
		}
    }
    if(cas==7){
		  hide('entrycreatconceptsearch1');
		  hide('entrycreatconceptsearchcontainter1');
	}
    		
}
//******************************************************************************************************
function dictionarySearch(lng,startIndex,nbPages){
    var searchStr = byId("dictsearch").value;
    if(searchStr=="")
       alert("No entry is selected..." );
    else {
			var dictSearchBy = byName("dictsearchby");
			dictSearchBy = dictSearchBy[getSelectedRadio(dictSearchBy)].value;
			var dictMatch = byName("match");
			dictMatch = dictMatch[getSelectedRadio(dictMatch)].value;
			searchStr = encodeURIComponent(searchStr.unicodeEncode());
			var urlStr = "dict_searchResults.jsp?lng="+lng+"&startindex="+startIndex+"&nbpages="+nbPages+"&str="+searchStr+"&by="+dictSearchBy+"&match="+dictMatch;
			loadContent(urlStr, 'dictsearchresults','dictsearchresultscontainter');
			}
}
//*****************************************************************************************************
/*function dictionaryAttSearch(lng,startIndex,nbPages){
	
	var searchStr = byId("dictattsearch").value;
	var dictAttSearchBy = byName("dictattsearchby");
	dictAttSearchBy = dictAttSearchBy[getSelectedRadio(dictAttSearchBy)].value;
	var dictAttMatch = byName("matchatt");
	dictAttMatch = dictAttMatch[getSelectedRadio(dictAttMatch)].value;
	searchStr = encodeURIComponent(searchStr.unicodeEncode());
	var urlStr = "dict_attSearchResults.jsp?lng="+lng+"&str="+searchStr+"&by="+dictAttSearchBy+"&match="+dictAttMatch+"&startindex="+startIndex+"&nbpages="+nbPages;
	loadContent(urlStr, 'dictattsearchresults','dictattsearchresultscontainter');
}*/
//******************************************************************************************************
function entryCreate(lng){
    var searchStr = byId("dictcreate").value;
	if(searchStr == ""){
	     alert("No entry is defined...");
	     return false;
	     }
	else{
			searchStr = encodeURIComponent(searchStr.unicodeEncode());
			var dataStr = "lng="+lng+"&str="+searchStr;
			var urlStr = "dict_createPage.jsp";	
			loadContent(urlStr,'dictcreateentrypage','dictcreateentrypagecontainter',"POST",dataStr);
	    }
}
//****************************************************************************************************
/*function attributeCreate(lng){
    var searchStr = byId("dictattcreate").value;
    searchStr = encodeURIComponent(searchStr.unicodeEncode());
    if(searchStr==""){
        alert("No attribute to create...");
        return false;
     }  
    var urlStr = "dict_attCreatePage.jsp?lng="+lng+"&str="+searchStr;
	loadContent(urlStr, 'dictcreateattpage','dictcreateattpagecontainter');
	return true;
}*/
//***************************************************************************************************
function saveAtt(){
}
//**************************************************************************************************
/*function searchCpt(){
var conceptStr = byId('conceptsearchstr').value;
conceptStr = encodeURIComponent(conceptStr.unicodeEncode())

}
*/
//**************************************************************************************************
function searchConcept(cas){
	if(cas==1){
		var conceptStr = byId('entrycreateconceptsearch').value;
		if(conceptStr == '')
			alert('Please enter the concept headword to search...');
		else{
			var conceptStr = encodeURIComponent(conceptStr.unicodeEncode());	
			action='create1'; /* crate2: for updating in dictionary tab and create1 else */
			var urlStr = "dict_conceptSearch.jsp?hw="+conceptStr+"&rid=-1&cid=0&buttonset="+action;
			loadContent(urlStr, 'entrycreatconceptsearch','entrycreatconceptsearchcontainter');	
		}
      }
	if(cas==2){
		var conceptStr = byId('entryeditconceptsearch').value;
		if(conceptStr == '')
			alert('Please enter the concept headword to search...');
		else{
			var conceptStr = encodeURIComponent(conceptStr.unicodeEncode());	
			action='create1';
			var urlStr = "dict_conceptSearch.jsp?hw="+conceptStr+"&rid=-1&cid=0&buttonset="+action;
			loadContent(urlStr, 'entrycreatconceptsearch','entrycreatconceptsearchcontainter');	
		}
      }
	if(cas==3){
		var conceptStr = byId('entryupdateconceptsearch').value;
		if(conceptStr == '')
			alert('Please enter the concept headword to search...');
		else{
			var conceptStr = encodeURIComponent(conceptStr.unicodeEncode());	
			action='create2';
			var urlStr = "dict_conceptSearch.jsp?hw="+conceptStr+"&rid=-1&cid=0&buttonset="+action;
			loadContent(urlStr, 'entrycreatconceptsearch1','entrycreatconceptsearchcontainter1');	
		}
      }
}
//**************************************************************************************
function deleteEntryinShow(i,lng,cid,concept){
resp = window.confirm("Are you sure you want to delete this Entry?");
if(resp){
		entryId= byId('showentriesdelete'+i).value;
		var url = "dict_entryChanges.jsp?action=del&entryid="+entryId+"&lng="+lng;
		loadContent(url, 'dictentriesshow','dictentriesshowcontainer','GET','', "backToEntriesShow('"+cid+"','"+concept+"','"+lng+"')");
	}
}
//**************************************************************************************
function deleteEntry(lng,cbid,i,tr,startIndex,nbPages){
resp = window.confirm("Are you sure you want to delete this Entry?");
if(resp){
	tr = document.getElementById(tr);
    var entryId =  tr.cells[1].firstChild.nodeValue;
	var url = "dict_entryChanges.jsp?action=del&entryid="+entryId+"&lng="+lng;
	loadContent(url, 'dictsearchresults','dictsearchresultscontainter','GET','', "dictionarySearch('"+lng+"',"+startIndex+","+nbPages+")");
  }	
}
//**************************************************************************************
/*function deleteAttribute(lng,cbid,i,tr,startIndex,nbPages){
		resp = window.confirm("Are you sure you want to delete this attribute?");
	 	if(resp){
			 //var lng =  tr.cells[0].firstChild.nodeValue;
			 tr = document.getElementById(tr);
			 var id =  tr.cells[0].firstChild.nodeValue;
			 var name =  tr.cells[2].firstChild.nodeValue;
			 name = encodeURIComponent(name.unicodeEncode());
			 var url = "dict_attChanges.jsp?action=del&lng="+lng+"&id="+id+"&name="+name;
             loadContent(url, 'dictattsearchresults','dictattsearchresultscontainter','GET','',"dictionaryAttSearch('"+lng+"',"+startIndex+","+nbPages+")");
		}
 }*/
 //**********************************************************************************
function updateEntry(lng,i,conceptId,concept,startIndex,nbPages){
         hide('dlg');
         var tr = 'dicttr'+i;
 	     tr = byId(tr);
 	     var entry =      tr.cells[0].firstChild.nodeValue;
 	     var id =         tr.cells[1].firstChild.nodeValue;
		 var  att = tr.cells[4].firstChild.nodeValue;
		 var comment =  tr.cells[5].firstChild.nodeValue;
		 var prior =  tr.cells[6].firstChild.nodeValue;
		 var freq =  tr.cells[7].firstChild.nodeValue;
		 var author =  tr.cells[8].firstChild.nodeValue;
		 var cd =  tr.cells[9].firstChild.nodeValue;
		 var lmd =  tr.cells[10].firstChild.nodeValue;
		 entry = encodeURIComponent(entry.unicodeEncode());
		 att = encodeURIComponent(att.unicodeEncode());
		 comment = encodeURIComponent(comment.unicodeEncode());
		 author = encodeURIComponent(author.unicodeEncode());
		 //alert(concept);
		 var urlStr = 'dict_entryUpDRow.jsp?id='+id+'&lng='+lng+'&entry='+entry+'&conceptid='+conceptId;
		 urlStr += '&concept='+concept+'&att='+att+'&comment='+comment+'&freq='+freq+'&prior='+prior;
		 urlStr += '&author='+author+'&cd='+cd+'&lmd='+lmd+'&startindex='+startIndex+'&nbpages='+nbPages;
		 
		 openDialog(urlStr, "Entry Editor", 760, 441, null, false,false);
		 //loadContent(urlStr,trup,tdup);760,445
}
//***********************************************************************************
 function updateAttribute(lng,i,tr,trup,tdup,startIndex,nbPages){
	 	 tr = byId(tr);
	 	 //var lng =  tr.cells[0].firstChild.nodeValue;
		 var id =  tr.cells[0].firstChild.nodeValue;
	 	 var code = tr.cells[1].firstChild.nodeValue;
		 var name = tr.cells[2].firstChild.nodeValue;
		 var desc =  tr.cells[3].firstChild.nodeValue;
		 code = encodeURIComponent(code.unicodeEncode());
		 name = encodeURIComponent(name.unicodeEncode());
		 desc = encodeURIComponent(desc.unicodeEncode());
		 var urlStr = 'dict_attUpDRow.jsp?tr='+trup+'&lng='+lng+'&id='+id+'&code='+code+'&name='+name+'&desc='+desc+'&startindex='+startIndex+'&nbpages='+nbPages;
		 openDialog(urlStr, "Attribute Editor", 710, 230, null, false, false);
 }
 //***********************************************************************************
 function saveEntryUpDWindow(lng,entryId,startIndex,nbPages){
	    entry = byId('entryup').value;
	    if(entry == ""){
	       	alert("Entry name is empty!!!");
	       	return false;
	 	}
	 	else{
	 		attStr="";
	 		conceptId= byId('dictconceptidcreate').value;
	 		conceptStr= byId('dictconceptcreate1').value;
	 		comment = byId('commentup').value;
	    	freq = byId('frequp').value;
	    	prior = byId('priorup').value;
	 		var attribs = byId('updateattribs');
	 		for(i=0;i<attribs.options.length;i++){
        		attribs.options[i].selected = true;
        	   attStr += attribs.options[i].text+","; 
        	}
        	entry = encodeURIComponent(entry.unicodeEncode());
        	attStr = encodeURIComponent(attStr.unicodeEncode());
        	comment = encodeURIComponent(comment.unicodeEncode());
            var dataStr = "action=upd&lng="+lng+"&entryid="+entryId+"&entry="+entry+"&conceptid="+conceptId+"&conceptstr="+conceptStr;
	   		dataStr += "&comment="+comment.trim()+"&priority="+prior+"&frequency="+freq+"&attributes="+attStr;
	   		var urlStr = "dict_entryChanges.jsp?";
	   		//console.log("..."+dataStr+"...");
	   		hide("dlg");
	   		loadContent(urlStr,'dictsearchresults','dictsearchresultscontainter',"POST",dataStr,"dictionarySearch('"+lng+"',"+startIndex+","+nbPages+")");
	 	}      
	}
 //***********************************************************************************
 function showAll(entryTh,entryTd,crDateTh,crDateTd,modDateTh,modDateTd,size){
   showHide(entryTh);
   showHide(crDateTh);
   showHide(modDateTh);
   for(i=0;i<size;i++){
   		showHide(entryTd+i);
   		showHide(crDateTd+i);
   		showHide(modDateTd+i);
   }
 }
 //***********************************************************************************
 /*function saveAttUpDWindow(lng,id,code,name,desc,startIndex,nbPages){
   code= byId(code).value;
   name= byId(name).value;
   desc = byId(desc).value;
   if(name == ""){
       	alert("attribute name is empty!!!");
       	return false;
 	}
   else{
        if(code=="")
            code="-";
        if(desc=="")
            desc="-";
	   	code = encodeURIComponent(code.unicodeEncode());
   		name = encodeURIComponent(name.unicodeEncode());
   		desc = encodeURIComponent(desc.unicodeEncode());
	    var urlStr = "dict_attChanges.jsp?action=upd&lng="+lng+"&id="+id+"&code="+code+"&name="+name+"&desc="+desc;
	    //alert("desc = "+desc.length+"  urlStr.lenght ="+ urlStr.length);
	    hide("dlg");
	    loadContent(urlStr, 'dictattsearchresults','dictattsearchresultscontainter','GET','',"dictionaryAttSearch('"+lng+"',"+startIndex+","+nbPages+")");
			//console.log("..."+dataStr+"...");
	    return true;
   }
 }*/
//************************************************************************************
function newAttributeSave(lng){
 var name = byId('attname').value;
 if(name==""){
	 alert('Please enter the attribute');
	 return false;
 }
 else{
	 var code = byId('attcode').value;
	 var desc = byId('attdesc').value;
	 name = encodeURIComponent(name.unicodeEncode());
	 code = encodeURIComponent(code.unicodeEncode());
	 desc = encodeURIComponent(desc.unicodeEncode());
	 var urlStr = "dict_saveAttribute.jsp?lng="+lng+"&attname="+name+"&attcode="+code+"&attdesc="+desc;
	 loadContent(urlStr, 'dictcreateattpage','dictcreateattpagecontainter','GET','','attributeAdded()');
	 return true;
 }
}
//************************************************************************************
function attributeAdded(){
	byId("dictattcreate").value="";
	hide("dictcreateattpagecontainter");
	hide("dictcreateattpage");
	alert("Attribute added successefully...");
}
//************************************************************************************
function entryAdded(){
	byId("dictcreate").value="";
	hide("dictcreateentrypagecontainter");
	hide("dictcreateentrypage");
	alert("Entry added successefully...");
}
//************************************************************************************
function showPrevPage(lng,startIndex,nbRowsPerPage,nbPages){
if(startIndex > 0){
   startIndex = startIndex-nbRowsPerPage;
   dictionarySearch(lng,startIndex,nbPages);
}
}
//*************************************************************************************
function showNextPage(lng,startIndex,nbRowsPerPage,nbPages){
  if((startIndex/nbRowsPerPage)+1 < nbPages){ 
  startIndex = startIndex+nbRowsPerPage;
  dictionarySearch(lng,startIndex,nbPages);
  }
}
//************************************************************************************
function showPage(lng,startIndex,nbRowsPerPage,nbPages){
	var currentPage = byId("currentpage").value;
	if((currentPage>0)&&(currentPage<=nbPages)){
		startIndex = (currentPage-1)*nbRowsPerPage;
		dictionarySearch(lng,startIndex,nbPages);
	}
	else{
		alert("Page number is not correct...");
		byId("currentpage").value= (startIndex/nbRowsPerPage)+1;
	}
}
//************************************************************************************
/*function showAttPrevPage(lng,startIndex,nbRowsPerPage,nbPages){
if(startIndex > 0){
   startIndex = startIndex-nbRowsPerPage;
   dictionaryAttSearch(lng,startIndex,nbPages);
}
}*/
//*************************************************************************************
/*function showAttNextPage(lng,startIndex,nbRowsPerPage,nbPages){
  if((startIndex/nbRowsPerPage)+1 < nbPages){ 
  startIndex = startIndex+nbRowsPerPage;
  dictionaryAttSearch(lng,startIndex,nbPages);
  }
}*/
//************************************************************************************
/*function showAttPage(lng,startIndex,nbRowsPerPage,nbPages){
	var currentPage = byId("currentattpage").value;
	if((currentPage>0)&&(currentPage<=nbPages)){
		startIndex = (currentPage-1)*nbRowsPerPage;
		dictionaryAttSearch(lng,startIndex,nbPages);
	}
	else{
		alert("Page number is not correct...");
		byId("currentattpage").value= (startIndex/nbRowsPerPage)+1;
	}
}*/
//************************************************************************************
/*function submitSearch2(e,lng,cas){
	if(e.keyCode == 13){
	    if(cas==11)
	     return entryCreate(lng);
	    if(cas==12)
	      dictionarySearch(lng,0,0);
	   if(cas==21)
	      return attributeCreate(lng);
	   if(cas==22)
	      dictionaryAttSearch(lng,0,0);
	}
}*/
//************************************************************************************
function conceptSelected(i,size,concept,cid,cas){
var tr = byId('cconcept'+i);
var selectedRadio = byId('createconcept'+i);
for(j=0;j<size;j++){
 byId('createconcept'+j).checked = false;
}
selectedRadio.checked = true;
if(cas==7){
    byId('dictconceptcreate1').value = decodeURIComponent(concept).replace("+"," ");
    }
else
{
    byId('dictconceptcreate').value = decodeURIComponent(concept).replace("+"," ");
    }
byId('dictconceptidcreate').value = cid;  
}
//************************************************************************************
function showPrevImagesPage(startIndex,nbImagesPerPage,nbPages){
if(startIndex > 0){
    startIndex = startIndex-nbImagesPerPage;
	var urlStr = "nlu_images.jsp?imstartindex="+startIndex;
	loadContent(urlStr, 'showimages','showimagescontainter');
  }
}
//************************************************************************************
function showNextImagesPage(startIndex,nbImagesPerPage,nbPages){
 startIndex = startIndex+nbImagesPerPage;
 if(startIndex < (nbPages*nbImagesPerPage)){
	var urlStr = "nlu_images.jsp?imstartindex="+startIndex;
	loadContent(urlStr, 'showimages','showimagescontainter');
  }
}
//*************************************************************************************
function showFirstImagesSet(lng,cid,uw){
 var urlStr = "nlu_images.jsp?imstartindex=0&cid="+cid;
 //loadContent(urlStr, 'showimages','showimagescontainter','GET','', "firstDictShow('"+lng+"','"+cid+"','"+uw+"',1)");
 loadContent(urlStr, 'showimages','showimagescontainter','GET','', "loadCnBrowser('"+cid+"');");
}

