function addfav()
{
	window.external.AddFavorite(window.location, document.title);
}

function ToggleVis(antw_id)
{
	var item="a"+antw_id;
	var item_link=document.getElementById(item);
	
	if(item_link.style.display=="none")
	{
		item_link.style.display="block";
	}
	else
	{
		item_link.style.display="none";
	}
}
function SetImage(imgfile,width,height)
{
	MainImage.src=imgfile;
	MainImage.width=width;
	MainImage.height=height;
}
function LoadSection()
{
	//ExistTest.style.visibility="hidden";
	if(document.forms[1] && document.forms[1].StrSelect)
	{
		var newSelection=document.forms[1].StrSelect.value;
		document.forms[1].StrCurSelect.value=newSelection;
		var oldSelection=document.forms[1].StrOldSelect.value;
		
		var strTotal=document.forms[1].strTxtTotal.value
		var strVis="<A NAME='"+oldSelection+"'>"+document.forms[1].strTxtVis.value+"</A>";
		if(document.forms[1].strTxtVis.value=="")
		{
			strVis="";
		}
		document.forms[1].StrOldSelect.value=newSelection;
		// find section
		
		var needle="<A NAME='"+newSelection+"'>";
		var SectionPos=strTotal.indexOf(needle);
		var strSub="";
		var startText="";
		var endText="";
		
		
		if(SectionPos>=0)
		{
			startText=strTotal.substr(0,SectionPos);
			var endneedle="</A>";
			
			SectionPos+=needle.length;//strip tag
			var SectionEnd=strTotal.indexOf(endneedle,SectionPos);
			endText=strTotal.substr(SectionEnd+endneedle.length);
			if(endText.length<=endneedle.length)
			{
				endText="";
			}
			SectionEnd-=SectionPos;
			if(SectionEnd>0)
			{
				strSub=strTotal.substr(SectionPos,SectionEnd);
			}
			else
			{
				strSub="";
			}
			
		}
		else
		{
			startText=strTotal;
			
		}
		
		document.forms[1].strTxtVis.value=strSub;
		
		//
		
		document.forms[1].strTxtTotal.value=startText+strVis+endText;
	
		
	}
	
}
function addsection()
{
	var new_index=0;
	win=prompt("Welke sectie wil je toevoegen?", "");
	if (win)
	{
		new_index=document.forms[1].StrSelect.length;
		new_option = new Option(win,win);
		document.forms[1].StrSelect.options[new_index] = new_option;
		// hier in database section list
	}
}
