function addLoadEvent(func){
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			if (oldonload)
			{
				oldonload();
			}
			func();
		}
	}
}

function ToggleNav(){
if(!document.getElementsByTagName) return false;
var List = document.getElementsByTagName("li");
	for( var i=0 ; i < List.length ; i++){
		if( List[i].className == "toggle"){
			List[i].className="togglefold";
			List[i].setAttribute("class","togglefold");
			List[i].onclick = function(){
				
				if(this.className == "toggle"){
					this.className="togglefold";
				}
				else{
					this.className="toggle";
				}
			}
		}
	}
}

function imgGallery()
{
	if(!document.getElementById) return false;
	if(!document.getElementById('Diashowcontainer')) return false;
	var gal=document.getElementById('Diashowcontainer');
	var thumbs=gal.getElementsByTagName('a');
	var bigImg=document.getElementById('Bigimg').getElementsByTagName('img')[0];
	var imgTxt=document.getElementById('Text');
	for(var i=0;i<thumbs.length;i++){
		thumbs[i].onclick=function(){
			bigImg.src=this.href;
			var txt=this.getElementsByTagName('img')[0].getAttribute('alt');
			imgTxt.firstChild.nodeValue=txt;
			return false;
		}
	}
}

function startSite(){
	imgGallery();
	//ToggleNav();
}
