//FADE-IN MENU-----------------------------------------------------

function headMenu(){


			$('#mainNavigation .off, #subNavigation .off').hover(function(){

				var target=$('+ .on',this); 

				if(target.css('display')=='none') {
					target.fadeIn(250);
				}else{
					target.fadeOut(50);
				}

			});
}

$(function(){headMenu();});


$(function() {

			$('.wrap').hover(function(){
				$('.on').css("display","none");
			});

			$('body').mouseout(function(){
				$('.on').css("display","none");
			});

});


//TO PAGE TOP------------------------------------------------------

function TOP(){
	var aTagList = document.getElementsByTagName('a');
	for (var i = 0; i < aTagList.length; i++) {
		if (aTagList[i].href.match(/#top/i)) {
			aTagList[i].onclick = goPageTop;
		}
	}
}
var MOVE = 20;
var POSITION;
function goPageTop(){
	var yPos = document.body.scrollTop || document.documentElement.scrollTop;
	mObj(yPos);
	return false;
}
function mObj(y,s){
	if (s) MOVE = s;
	POSITION = parseInt(y - y * 2 / MOVE);
	scrollTo(0, POSITION);
	if (POSITION > 0) setTimeout('mObj(POSITION, MOVE)', 1);
}
if (window.addEventListener) window.addEventListener('load', TOP, false);
if (window.attachEvent) window.attachEvent('onload', TOP);


//REMOVE OUTLINE------------------------------------------------------

window.onload = outline;

function outline(){
	var tgt = function (){ this.blur() };
	for (var i = 0; i < document.links.length; i++)
	document.links[i].onfocus = tgt;
}



