/**
 * @author Timo 22.02.2006
 */

help={}

help.loadFromFrame=function(frameObject){
	var fileName=Log.urlTool.removeFileExtensionAndFolder(frameObject.location+"");
	getCaption=frameObject.getCaption;
	PhraseBook.currentId=Log.arrayTool.getFirstIndexByValue(VALUES,fileName);
	help.translateDuplicateIds();
}//loadFromFrame

/**
 * Translate elements with the same id, until there is nothing left
 */
help.translateDuplicateIds=function(){
	Log.domTool.updateAttributeOnce=true;
	Log.domTool.hasUpdatedAttribute=true;
	//var iWhile=0;
	while(Log.domTool.hasUpdatedAttribute==true/*IE: &&iWhile<10*/){
		//next elements  with the same phraseId
		Log.domTool.hasUpdatedAttribute=false;
		help.translate();
		//iWhile+=1;
	}//while
}//translateDuplicateIds

help.translate=function(){
	PhraseBook.translate();
	PhraseBook.translateSet(PhraseBook.phraseBooks[PhraseBook.currentId]._aJScript,menu.html.S_WOMB_ID,'innerHTML');//JavaScript alert messages
}//translate

help.main=function(){
	menu.html.setAbreviations();
	help.checkAnchor(true);
	self.name=page._sHelpWindowName;
	page._sName=self.name;
	if(document.body!=null){document.body.onmouseout=new Function('document.title=self.name;');}
}//main

help.checkAnchor=function(b_close){
	try{
		var divId=Log.urlTool.getAnchorName(location.href);
		if(divId!=location.href){
			if(b_close==true){menu.view.switchAllKids(false);}
			help.openAnchor(divId);
			//Log.windowTool.scrollUpLeft();
		}//if
	}catch(e_rror){Log.showExeption( e_rror, 'help.checkAnchor');}
}//checkAnchor

help.openAnchor=function(sInput){
	var divId=Log.urlTool.getAnchorName(sInput);
	if(divId!=null/*&&divId!=sInput*/){
		var eImg=document.getElementById(menu.html.S_SWITCH_KID_ID+divId);
		var e_wombDiv=menu.view.getWombDiv(divId);
		menu.view.openKids(eImg,e_wombDiv);
	}//if
}//openAnchor

help.findAnchor=function(e_lement){
	help.openAnchor(e_lement.href);
	location=e_lement.href;
}//findAnchor
