var DISPLAYLANG
var Col_WidthA="80%,30%"
var Col_WidthF="30%,80%"
var CurrentChannel
var CurrentDocument
var CurrentView="DOC"
var TreeLoaded=false
var SearchDoneBefor=false
var ShowThe_Link=false
var TreeIsHidden=false

function CheckOfTree()
{
	return;
}

function HideTree()
{
	if(DISPLAYLANG=="A") 
		 top.mainframeset.cols="100%,0"
	 else	 
		top.mainframeset.cols="0,100%"
	ShoImage("");	
	TreeIsHidden=true
	ShoImage("CONT");
		
}


function HideTreeOther()
{
	if(DISPLAYLANG=="A") 
    	top.mainframeset.cols="100%,0"
	 else	 
		top.mainframeset.cols="0,100%"
	TreeIsHidden=true	
}



function ShowSearch()
{
	if(TreeLoaded!=true)
		return;
	top.contents.document.location=""
	top.contents.document.location="../search/advsearch.asp"
	if(DISPLAYLANG=="A") 
		top.mainframeset.cols="100%,0"
	 else	 
		top.mainframeset.cols="0,100%"
	 ShoImage("")
	 TreeIsHidden=true	
}




function ShowTree()
{
	if(TreeLoaded!=true)
		return;
	var DocLinkToDisplay="doc/viewarticle.asp?ArtId=" + CurrentDocument + "&CID=" + CurrentChannel 
	top.contents.document.location=DocLinkToDisplay	
	if(DISPLAYLANG=="A") 
		top.mainframeset.cols=Col_WidthA
	else	
	    top.mainframeset.cols=Col_WidthF
	ShoImage("TREE")
	TreeIsHidden=false
}


function ShowTree_Doc()
{
	if(TreeLoaded!=true)
		return;
	if(DISPLAYLANG=="A") 
		top.mainframeset.cols=Col_WidthA
	else	
	    top.mainframeset.cols=Col_WidthF
	ShoImage("TREE")
	TreeIsHidden=false
}



function ShowTree_Doc_BK()
{
	if(TreeLoaded!=true)
		return;
	if(DISPLAYLANG=="A") 
		top.mainframeset.cols=Col_WidthA
	else	
	    top.mainframeset.cols=Col_WidthF
	ShoImage("CONT")
}



function ShowTreeFSearch() //this function used to search tree from search page 
{
	var DocLinkToDisplay="../doc/viewarticle.asp?ArtId=" + CurrentDocument + "&CID=" + CurrentChannel 
	top.contents.document.location=DocLinkToDisplay	
	if(DISPLAYLANG=="A") 
		top.mainframeset.cols=Col_WidthA
	else	
	    top.mainframeset.cols=Col_WidthF
	ShoImage("TREE")
	TreeIsHidden=false
}


var thesaurusTBvar
function hideThesaurus()
{
	if(top.contents.thesaurusTB.style.visibility=='visible')
	{
		thesaurusTBvar=top.contents.thesaurusTB.innerHTML
		top.contents.thesaurusTB.style.visibility='hidden'
		top.contents.thesaurusTB.innerHTML=''
	}
 	else
	{
		top.contents.thesaurusTB.innerHTML=thesaurusTBvar
		top.contents.thesaurusTB.style.visibility='visible'
	}
 
}
	
	
function ShoImage(ID)	
{

	var ImagesPath
	if(DISPLAYLANG=="A")
		ImagesPath="Images/"
	else
		ImagesPath="IMAGESF/"

	
	switch  (ID)
	{
	case "CONT" :
			top.ToolBar.imgshow.src= ImagesPath + "kaama.gif"
			top.ToolBar.imgcontent.src=ImagesPath +"show-waseka_h.gif"
			top.ToolBar.imgres.src=ImagesPath +"search-res.gif"
		break;
	case  "TREE" :	
			top.ToolBar.imgshow.src=ImagesPath +"kaama_h.gif"
			top.ToolBar.imgcontent.src=ImagesPath +"show-waseka.gif"
			top.ToolBar.imgres.src=ImagesPath +"search-res.gif"	
		break ;
	case  "RES"	:	
			top.ToolBar.imgshow.src=ImagesPath +"kaama.gif"
			top.ToolBar.imgcontent.src=ImagesPath +"show-waseka.gif"
			top.ToolBar.imgres.src=ImagesPath +"search-res_h.gif"
		break;
	case ""  :
			top.ToolBar.imgshow.src=ImagesPath +"kaama.gif"
			top.ToolBar.imgcontent.src=ImagesPath +"show-waseka.gif"
			top.ToolBar.imgres.src=ImagesPath +"search-res.gif"
		break;		
	}		
		
	
	

}
	

function ShowDoc()
{
	if(TreeLoaded!=true)
		return;
	
		CurrentView="DOC"
		var DocLinkToDisplay="doc/viewarticle.asp?ArtId=" + CurrentDocument + "&CID=" + CurrentChannel + "&Test=1" 
		top.contents.document.location=DocLinkToDisplay
	HideTree()
	ShoImage("CONT")	
	
	
}



function ShowSerchRes()
{
	if(TreeLoaded!=true)
		return;
	CurrentView="SEARCH"
	var DocLinkToDisplay="search/TBresults.asp"
	top.contents.document.location=DocLinkToDisplay
	HideTree()
	
}	

function ShowSearchFull()
{
	CurrentView="SEARCH"
	HideTreeOther()
	
}		     



