/*

	  globals.js
	----------------------
	
*/


function dropchar(element) {
/* A function that change the Value of the nav-search-inputelement.	 */
	if(element == "searchinput" && document.getElementById(element).value == "") {
		document.getElementById(element).value = "Search...";
	}
}

sfHover = function() {
/* 	A function for DropDownNav in IE6 */
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

var act = 0;

function teachnav_activate(trigger) {
	if(act == 0) {
		act = 1;
		new Effect.Parallel([
			new Effect.Fade('gm_'+[trigger], {from: 1, to: 0, duration: 0.2}),
			new Effect.Appear('tn_'+[trigger]+'_ul', {from: 0, to: 1}),
			new Effect.Morph('tn_'+[trigger]+'_ul',  {style:"width: 170px"}),
			new Effect.Appear('tns_'+[trigger], {from: 0, to: 1})
		],{duration: 0.7, queue: 'front',afterFinish:function(){ act = 0; }});
	}
}

function teachnav_fade(trigger) {
	if(act == 0) {
		act = 1;
		new Effect.Parallel([
			new Effect.Fade('tn_'+[trigger]+'_ul', {from: 1, to: 0}),
			new Effect.Morph('tn_'+[trigger]+'_ul',  {style:"width: 1px"}),
			new Effect.Fade('tns_'+[trigger], {from: 1, to: 0}),		
			new Effect.Appear('gm_'+[trigger], {from: 0, to: 1})
		],{duration: 0.7, queue: 'front',afterFinish:function(){ act = 0; }});
	}
}