var tooltip=function(){
	var id = 'tt';
	var top = 0;
	var left = 0;
	var maxw = 320;
	var maxh =220;
	var speed = 10;
	var timer = 20;
	var endalpha = 90;
	var alpha = 0;
	var tt,t,c,b,h;
	var ie = document.all ? true : false;
	return{
		show:function(v,newsite,w){
			if(newsite==0){
				defaultContent = '<div id=\'login_box\'><div class=\'login_box_wrapper\'><div class=\'login_box_top\'> <a href=\'#\' onclick=\'tooltip.hide();\'><img src=\'/images/btn_close_Loginbox.gif\' class=\'close\'/></a> </div><div class=\'login_box_btm\'><p>Whether you are using the assessment tool, downloading a case study, or wanting to stay in touch with Disney Institute, we\'d like to find out more about you. Please register with us. We\'ll give you the option of keeping in touch with Disney Institute, or take the asessment. If you are returning, simply log in.</p><p><a href=\'/login.aspx?ReturnUrl='+v+'\'><img src=\'/images/btn_login_Loginbox.gif\' class=\'btn_login\' /></a> <a href=\'/register.aspx?ReturnUrl='+v+'\'><img src=\'/images/btn_join_Loginbox.gif\' class=\'btn_join\' /></a></p>  </div></div></div>';
				}else if(newsite==1){
					defaultContent = '<div id=\'login_box\'><div class=\'login_box_wrapper\'><div class=\'login_box_top\'> <a href=\'#\' onclick=\'tooltip.hide();\'><img src=\'/images/btn_close_Loginbox.gif\' class=\'close\'/></a> </div><div class=\'login_box_btm\'><p>You are now leaving the <em>Disney Institute</em> site and going to LearningTree.com. Learn about the <em>Disney Institute</em> programs offered at Learning Tree locations.</p><p><a href=\''+v+'\' target=\'_blank\'><img src=\'/images/btn_book.gif\' class=\'btn_login\' /></a></p>  </div></div></div>';
				}else if(newsite==2){
					defaultContent = '<div id=\'login_box\'><div class=\'login_box_wrapper\'><div class=\'login_box_top\'> <a href=\'#\' onclick=\'tooltip.hide();\'><img src=\'/images/btn_close_Loginbox.gif\' class=\'close\'/></a> </div><div class=\'login_box_btm\'><p>You are now leaving the <em>Disney Institute</em> site. <br /><br /> The program sponsor will be assisting you with any future communication for this event date. Thank you! </p><p><a href=\''+v+'\' target=\'_blank\'><img src=\'/images/btn_book.gif\' class=\'btn_login\' /></a></p>  </div></div></div>';
				}
			if(tt == null){
				tt = document.createElement('div');
				tt.setAttribute('id',id);
				//t = document.createElement('div');
				//t.setAttribute('id',id + 'top');
				//c = document.createElement('div');
				//c.setAttribute('id',id + 'cont');
				//b = document.createElement('div');
				//b.setAttribute('id',id + 'bot');
				//tt.appendChild(t);
				//tt.appendChild(c);
				//tt.appendChild(b);
				document.body.appendChild(tt);
				tt.style.opacity = 1;
				//tt.style.filter = 'alpha(opacity=1)';
				tt.style.display = 'block';
				
				
				//document.onmousemove = this.pos;
				
				
			}
			
			tt.style.display = 'block';
			
			tt.innerHTML = defaultContent;
			
			
			if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
			
			
			
		},
		pos:function(e){
			var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
			var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
			//tt.style.top = ((u - maxh)/2+h) + 'px';
			//tt.style.left = ((l-maxw)/2 + left) + 'px';
		},
		fade:function(d){
			var a = alpha;
			if((a != endalpha && d == 1) || (a != 0 && d == -1)){
				var i = speed;
				if(endalpha - a < speed && d == 1){
					i = endalpha - a;
				}else if(alpha < speed && d == -1){
					i = a;
				}
				alpha = a + (i * d);
				tt.style.opacity = alpha * .01;
				tt.style.filter = 'alpha(opacity=' + alpha + ')';
			}else{
				clearInterval(tt.timer);
				if(d == -1){tt.style.display = 'none'}
			}
		},
		hide:function(){
			//clearInterval(tt.timer);
			//tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
			tt.style.display = 'none';
		}
	};
}();

