ProjectNavigation();
SelectBackGround();
MenuChilds();

function ProjectNavigation(){

	var oSelect = new Object();
	oSelect.eventHandler = function(event) {
		if($('project-selector').value != '0'){
			window.location.href = $('project-selector').value;
		}
		return false;
	}

	if($('project-selector')){
		$('project-selector').onchange  = oSelect.eventHandler.bindAsEventListener(oSelect);
	}

}

function SelectBackGround(){
	var items = $$('body.home img.keyvisual');

	items.each(function(item){
		item.onclick = function(event){
			var link = item.parentNode.href;
			var src = item.src;
			xajax_ChooseBackGround(src, link);
			//alert(src);
			return false;
		};
	});
}

function MenuChilds(){
	var items = $$('#main-navigation-area a.has-child');
	//alert(items.length);
	items.each(function(item){
		var parentID = item.parentNode.id;
		//alert(parentID);
		xajax_ExtendMenu(parentID);
	});
}
