
	var mostRecentMessage = -1;
	var hiddenTutorial = false;

	function killHoverTip()
	{
		get("hinttip").style.visibility = "hidden";
	}

	function hoverTip(t, w, tip)
	{
		
		// always update the w of the div before ever displaying it
		get("hinttiptable").style.width = w + "px";
		get("hinttip").style.width = w + "px";
		
		var left = findPosX(t);
		var top = findPosY(t);// - (t.height/2);
		var windowWidth = screen.availWidth; //window.innerWidth;
		if (isIE())
		{
			windowWidth = document.body.offsetWidth;
		}
		
		var thresh = w + 5;

		if (left + t.width + thresh >= windowWidth)		
		{
			// i.e. we need to show on the left
			left-=(w);
			get("hintlefttip").style.display = "none";
			get("hintrighttip").style.display = "";
		}
		else
		{
			// i.e. we need to show on the right
			left+=t.width;
			get("hintrighttip").style.display = "none";
			get("hintlefttip").style.display = "";
		}
			
		get("hinttip").style.left = left + "px";
		get("hinttip").style.top = top + (t.height/2) - 7 + "px";
		get("tooltiptip").innerHTML = tip;		
		get("hinttip").style.visibility = "visible";
	}

	function keydownProfResponse(qid)
	{
		get('cancelProfessorResponseButton_' + qid).disabled=false; 
		get('professorResponseToQuestion_' + qid).backgroundColor = "#f5f8a1";
	}

	function hideTutorial()
	{
		var c = confirm("This will hide the tutorial.  You can always access the tutorial from the Help section of GroundBooth by clicking the 'Help' link in the upper right.  Continue?");
		if (!c)
		{
			hiddenTutorial = true;
			return false;
		}
		
		function _hideTutorial(r)
		{
			session(r);
	//		alert(r);
			return false;
		}
		hiddenTutorial = true;
		hide("tutorial_row");
		hide("tutorial_row_2");
		var url = "hideTutorial=1";
		Aajax(weburl+"dashboard/index.php", url, _hideTutorial);
	}

	function askAnotherQuestion()
	{		
		hide("help_thanks");
		get("help_question_asked").value = "";
		show("help_question");
	}

	function askHelpQuestion()
	{
		var hq = get("help_question_asked").value;
		if (trim(hq)=="")
		{
			alert("You cannot submit a blank question.  Please try again.");
			return;
		}
		
		function _askHelpQuestion(r)
		{
			session(r);
			hide("help_submitting");
			show("help_thanks");
			//alert(r);
			return;
		}
		
		hide("help_question");
		show("help_submitting");
		
		var url = "askQuestion=1&question=" + escape(hq);
		Aajax(weburl+"help/index.php", url, _askHelpQuestion);
	}

	function fixFieldKey(e, field, field_id)
	{
		var fieldName = field + "_" + field_id;
		if (e.keyCode==27)
		{
			fixFieldToggle(fieldName);
			return;
		}
		
		if (e.keyCode==13)
		{
			fixField(field, field_id);
		}
	}

	function fixFieldToggle(fieldName)
	{
		if (get("link_" + fieldName).style.display=="")
		{
			hide("link_" + fieldName);			
			show("correction_" + fieldName);
			get("newVal_" + fieldName).focus();
		}
		else
		{
			hide("correction_" + fieldName);
			get("newVal_" + fieldName).value = "";			
			show("link_" + fieldName);			
		}
	}
	
	function fixField(field, field_id)
	{
		
		var fieldName = field + "_" + field_id;
		var sugVal = get("newVal_" + fieldName).value;
		var validation_type = get("validation_" + fieldName).value; 
		var length_limit = get("length_limit_" + fieldName).value; 
		var tbl = get("table_" + fieldName).value;
		
		var prevVal = "";
		try
		{
			prevVal = get(fieldName + "_span").innerHTML;
		}
		catch (ep38) {}
		
		
		if (trim(sugVal)=="")
		{
			return;
		}
		
		if (length_limit!="-1")
		{
			if (sugVal.length>Number(length_limit))
			{
				alert("The suggested value is too long.");
				return;
			}
		}
		
		// only support 'none' and 'float' and 'email' for right now
		if (validation_type=="float")
		{
			if (!validateCurrency(sugVal))
			{
				alert("A number (or a decimal number) is expected.");
				return;
			}
		}
		
		if (validation_type=="email")
		{
			if (!validateEmail(sugVal))
			{
				alert("A properly formatted email address is expected.");
				return;
			}
		}
				
		var type = "10";
		var title = fieldName;
		var issue = sugVal;
		var browser_server = get("bug_browser_server").value;
		var browser_client = navigator.userAgent;
		var page = escape(get("bug_page").value);

		function _fixField(r)
		{
			session(r);		
			//alert(r);
			if (debug())
			{
				//alert(r);
			}
			get("correction_" + fieldName).innerHTML = "<span style=\"color:#CCC\">Thanks for the feedback.</span>";
			try
			{
				get(fieldName + "_span").innerHTML = sugVal;
			}
			catch(ep38){}
			return;
		}
		
		get("correction_" + fieldName).innerHTML = "<span style=\"color:#CCC\">Submitting...</span>"
		var url = "doBugReport=1&doRealUpdate=1&tbl=" + tbl + "&field=" + field + "&field_id=" + field_id + "&newVal=" + escape(sugVal) + "&prevVal=" + escape(prevVal) + "&type=" + type + "&title=" + title + "&issue=" + issue + "&browser_server=" + escape(browser_server) + "&browser_client=" + escape(browser_client) + "&page=" + page;
		Aajax(weburl+"dashboard/index.php", url, _fixField);	

	}
	
	function navigateStation(type, dir, wrap)
	{
		var prev = -1;
		var next = -1;
		var hit = false;
		
		var o = get("station_" + type);
				
		var a = null;
		eval("a = " + type + "_stations;");
		if (a.length==1)
		{
			return a[0];
		}
		
		var i = 0;
		while (i < a.length && !hit)
		{
			if (a[i]==o.value)
			{				
				hit = true;
				if (i==a.length-1)
				{
					if (!wrap)
					{
						next = -1;
						prev = a[i-1];
					}
					else
					{
						next = a[0];
						prev = a[i-1];
					}
				}
				if (i==0)
				{
					if (!wrap)
					{
						next = a[i+1];
						prev = -1;					
					}
					else
					{
						next = a[i+1];
						prev = a[a.length-1];
					}
				}
				if (i!=0 && i!=a.length-1)
				{
					next = a[i+1];
					prev = a[i-1];
				}
			}
									
			i++;			
		}
		
		var r = -1;
		if (dir=="prev")
		{
			r = prev;
		}
		
		if (dir=="next")
		{
			r = next;
		}
		return r;
	}
	
	function doTab(torf)
	{
		var tab = get("tab");
		if(!torf)
		{
			hide("tab");
			show("dummy_tab");
		}
		else
		{
			hide("dummy_tab");
			show("tab");
		}
	}

	function toggleTab()
	{
		var tab = get("tab");
		var tick = 0;
	
		function _toggleTab(r)
		{
			session(r);
			updateChatCalculationsFromMessageContainers();
			return;
		}


		var cur = "";
		var cur_num = -1;
		if (get("public_chat_tab")!=null)
		{
			if (get("public_chat_tab").style.display=="") { cur = "public"; cur_num=0; }
		}

		if (get("courses_chat_tab")!=null)
		{		
			if (get("courses_chat_tab").style.display=="") { cur = "courses"; cur_num=1; }
		}
		
		if (get("studygroups_chat_tab")!=null)
		{		
			if (get("studygroups_chat_tab").style.display=="") { cur = "studygroups"; cur_num=2; }
		}
		
		if (get("friends_chat_tab")!=null)
		{		
			if (get("friends_chat_tab").style.display=="") { cur = "friends"; cur_num=3; }					
		}
		
		if(tab.style.display=="")
		{
			hide("tab");
			show("dummy_tab");
			if (get("tab_message_" + cur)!=null)
			{
				get("tab_message_" + cur).blur();
			}
			cancelViewUnreadChatMessages();
			updateChatCalculationsFromMessageContainers();
		}
		else
		{
			undoDropMenus();
			tick = 1;
			hide("dummy_tab");
			show("tab");
			if (get("tab_message_" + cur)!=null)
			{			
				get("tab_message_" + cur).focus();
				get(cur + "_chat_text").scrollTop = get(cur + "_chat_text").scrollHeight;	
					
			}
			updateChatCalculationsFromMessageContainers();			
		}
		
		if (tick==1) //me_user_id=="37" && tick==1)
		{
			//alert(cur_tab_closed_count);
			var unread_chat_count_link_number = Number(get("unread_chat_count_link_number").innerHTML);			
			var new_global_chat_count = unread_chat_count_link_number - cur_tab_closed_count < 0 ? 0 : unread_chat_count_link_number - cur_tab_closed_count;
			setGlobalUnreadCount(new_global_chat_count);
			cur_tab_closed_count = 0;
			if (true) //me_user_id=='37')
			{
				//alert("hi: " + get("station_" + cur).value);
				
				// get # in this chat to reduce main one
				// unread_friends_messages
				try
				{
					var this_station_val = get("station_" + cur).value;
					var cur_ur_msg = Number(get("unread_chats_" + cur + "_" + this_station_val + "_count").innerHTML);
					var ur_count = Number(get("unread_count_" + cur).innerHTML);
					var new_count = ur_count - cur_ur_msg; 
					if (new_count<0)
					{
						new_count = 0;
					}
					get("unread_count_" + cur).innerHTML = new_count;
					updateChatCalculationsFromMessageContainers();
					var type_container = get("unread_" + cur + "_messages");
					var individual_container = get("unread_chats_" + cur + "_" + this_station_val);
					type_container.removeChild(individual_container);	
				}
				catch(ep38) {}
			}

		}
		
		var url = "toggleTabPin=1&tick=" + tick;
		Aajax(weburl+"chat/ajax.php", url, _toggleTab);
	}
	
	function opaqueChange()
	{
		//alert(get("makeOpaque").checked);
		if (get("makeOpaque").checked)
		{
			opacity(get("chat_container"), 50);
		}
		else
		{
			opacity(get("chat_container"), 100);
		}
	}
	
	function viewUnreadChatMessages()
	{
		hide("tab_row");
		hide("chat_container");
		show("unread_chats");
		hide("unread_chat_link");
		show("cancel_unread_chat_link");
	}
	
	function cancelViewUnreadChatMessages()
	{		
		hide("unread_chats");
		show("tab_row");			
		hide("cancel_unread_chat_link");	
		show("chat_container");
		show("unread_chat_link");
	}
	
	function updateChatCalculationsFromMessageContainers()
	{
		var public_unread = Number(get("unread_count_public").innerHTML);
		var courses_unread = Number(get("unread_count_courses").innerHTML);
		var studygroups_unread = Number(get("unread_count_studygroups").innerHTML);
		var friends_unread = Number(get("unread_count_friends").innerHTML);
	
		var total = public_unread + courses_unread + studygroups_unread + friends_unread;
		
		get("unread_chat_count_link_number").innerHTML = total;
		get("unread_chat_count").innerHTML = total;
		if (me_user_id=='37')
		{
			//alert(total);
		}
		if (Number(total)==0)
		{
			if (me_user_id=='37')
			{
				//alert(total + " dark");
				//alert("i'm here and should be changing...");
			}
			// also update bubble to be light instead of bright
			get("chat_balloon_image").src = weburl + "chat_tab_0.gif";
			get("actual_unread_chat_count_link").className = "unread_chat_count_link_0";
		}
		else
		{
			if (me_user_id=='37')
			{
				//alert(total + " bright");
				//alert("i'm here and should be changing...");
			}
			get("chat_balloon_image").src = weburl + "chat_tab_1.gif";
			get("actual_unread_chat_count_link").className = "unread_chat_count_link_1";
		}
	}

	function switchChatTabs(tab_id)
	{		
		function _switchChatTabs(r)
		{
			session(r);		
			updateChatCalculationsFromMessageContainers();	
			return;
		}

		try
		{
			get("tab_0_link").blur();
			get("tab_1_link").blur();
			get("tab_2_link").blur();
			get("tab_3_link").blur();
		}
		catch (ep38)
		{}		
		
		// check cur states of each tab to determine one we will hide
		var cur = "";
		var toshow = "";
		var cur_num = 0;
		if (get("public_chat_tab").style.display=="") { cur = "public_chat_tab"; cur_num=0; }
		try
		{
			if (get("courses_chat_tab").style.display=="") { cur = "courses_chat_tab"; cur_num=1; }
		}
		catch(ep38) {}
		try
		{
			if (get("studygroups_chat_tab").style.display=="") { cur = "studygroups_chat_tab"; cur_num=2; }
		}
		catch(ep38) {}
		try
		{
			if (get("friends_chat_tab").style.display=="") { cur = "friends_chat_tab"; cur_num=3; }
		}
		catch(ep38) {}		
		var type_name = "";
	
		switch(Number(tab_id))
		{
			case 0:			// public
				toshow = "public_chat_tab";
				type_name = "public";
				break;
			case 1:			// courses
				toshow = "courses_chat_tab";
				type_name = "courses";
				break;
			case 2:			// studygroups
				toshow = "studygroups_chat_tab";
				type_name = "studygroups";
				break;
			case 3:			// friends
				toshow = "friends_chat_tab";
				type_name = "friends";
				break;
		}
		
		try
		{
			if (tab_id==0 && cur=="public_chat_tab") { get("tab_message_" + type_name).focus(); return; }
			if (tab_id==1 && cur=="courses_chat_tab") { get("tab_message_" + type_name).focus(); return; }
			if (tab_id==2 && cur=="studygroups_chat_tab") { get("tab_message_" + type_name).focus(); return; }
			if (tab_id==3 && cur=="friends_chat_tab") { get("tab_message_" + type_name).focus(); return; }	
		}
		catch(ep38){}
		
		try
		{
			get("tab_" + cur_num).style.backgroundImage = "url('" + weburl + "tab_0.jpg')";
			get("tab_" + tab_id).style.backgroundImage = "url('" + weburl + "tab_1.jpg')";
		}
		catch(ep38)
		{
			return;
		}
		
		hide(cur);
		show(toshow);

		try
		{
			get(type_name + "_chat_text").scrollTop = get(type_name + "_chat_text").scrollHeight;	
		}
		catch(ep38) {}
		
		// set cursor to current thing
		try
		{
			get("tab_message_" + type_name).focus();
		}
		catch(ep38)
		{}
		
		if (true) //me_user_id=='37')
		{
			var this_station_val = get("station_" + type_name).value;
			var this_chat_count = 0;
			//alert("about to try..." + this_station_val);
			try
			{
				this_chat_count = get("unread_chats_" + type_name + "_" + this_station_val + "_count").innerHTML;
			}
			catch(ep38) {}
			if (this_chat_count!=null)
			{
				//alert(this_chat_count);
				
				if (get("unread_chats_" + type_name + "_" + this_station_val)!=null)
				{
					//get("unread_chats_" + type_name + "_" + this_station_val).style.display = "none";
				var type_container = get("unread_" + type_name + "_messages");
				var individual_container = get("unread_chats_" + type_name + "_" + this_station_val);
				type_container.removeChild(individual_container);					
					
				}
				
				// update unread counts on the view panel
				var urc = Number(get("unread_count_" + type_name).innerHTML);
				var nurc = Number(urc - Number(this_chat_count));
				nurc = nurc < 0 ? 0 : nurc;
				get("unread_count_" + type_name).innerHTML = nurc;
				
				updateChatCalculationsFromMessageContainers();
				
			}
		}
		
		var url = "switchTabs=1&tab_id=" + tab_id;
		Aajax(weburl + "chat/ajax.php", url, _switchChatTabs);
	}
	
	function changeStationTune(type, type_id)
	{
		get(type + "_chat_text").innerHTML = "Loading...";
		//get("tab_message_" + type).disabled = true;
		
		//alert(type_id);
		
		function _changeStationTune(r)
		{
			session(r);
			//alert(r);
			get(type + "_chat_text").innerHTML = r;
			//get("tab_message_" + type).disabled = false;
			get("tab_message_" + type).focus();
			get(type + "_chat_text").scrollTop = get(type + "_chat_text").scrollHeight;	
			
			// update counts too
			if (true) //me_user_id=='37')
			{
				var this_station_val = get("station_" + type).value;
				var this_chat_count = 0;
				//alert("about to try..." + this_station_val);
				try
				{
					this_chat_count = get("unread_chats_" + type + "_" + this_station_val + "_count").innerHTML;
				}
				catch(ep38) {}
				if (this_chat_count!=null)
				{
					//alert(this_chat_count);
					
					if (get("unread_chats_" + type + "_" + this_station_val)!=null)
					{
						//get("unread_chats_" + type_name + "_" + this_station_val).style.display = "none";
						var type_container = get("unread_" + type + "_messages");
						var individual_container = get("unread_chats_" + type + "_" + this_station_val);
						type_container.removeChild(individual_container);					
						
					}
					
					// update unread counts on the view panel
					var urc = Number(get("unread_count_" + type).innerHTML);
					var nurc = Number(urc - Number(this_chat_count));
					nurc = nurc < 0 ? 0 : nurc;
					get("unread_count_" + type).innerHTML = nurc;
					
					updateChatCalculationsFromMessageContainers()
				}
			}				
			
			
			return;
		}
		
		var url = "getChatStationHistory=1&type=" + type + "&type_id=" + type_id;
		Aajax(weburl+"chat/ajax.php", url, _changeStationTune);
	}
	
	function changeStation(type)
	{		
		var type_id = get("station_" + type).value;
		get(type + "_chat_text").innerHTML = "Loading...";
		get("tab_message_" + type).disabled = true;
		
		//alert(type_id);
		
		function _changeStation(r)
		{
			session(r);
			//alert(r);
			get(type + "_chat_text").innerHTML = r;
			get("tab_message_" + type).disabled = false;
			get("tab_message_" + type).focus();
			get(type + "_chat_text").scrollTop = get(type + "_chat_text").scrollHeight;	
			

			// update counts too
			if (true) //me_user_id=='37')
			{
				var this_station_val = get("station_" + type).value;
				var this_chat_count = 0;
				//alert("about to try..." + this_station_val);
				try
				{
					this_chat_count = get("unread_chats_" + type + "_" + this_station_val + "_count").innerHTML;
				}
				catch(ep38) {}
				if (this_chat_count!=null)
				{
					//alert(this_chat_count);
					
					if (get("unread_chats_" + type + "_" + this_station_val)!=null)
					{
						//get("unread_chats_" + type_name + "_" + this_station_val).style.display = "none";
						var type_container = get("unread_" + type + "_messages");
						var individual_container = get("unread_chats_" + type + "_" + this_station_val);
						type_container.removeChild(individual_container);					
						
					}
					
					// update unread counts on the view panel
					var urc = Number(get("unread_count_" + type).innerHTML);
					var nurc = Number(urc - Number(this_chat_count));
					nurc = nurc < 0 ? 0 : nurc;
					get("unread_count_" + type).innerHTML = nurc;
					
					updateChatCalculationsFromMessageContainers();
				}
			}			
			
			return;
		}
		
		var url = "getChatStationHistory=1&type=" + type + "&type_id=" + type_id;
		Aajax(weburl+"chat/ajax.php", url, _changeStation);
	}

	function handleDocumentKeyPress(e)
	{		
		/*	
		if (e.ctrlKey && e.shiftKey && e.keyCode==70) // CTRL + F for firnd clicked
		{
			if (get("search")!=null)
			{
				get("search").focus();
			}
		}
	
		if (e.ctrlKey && e.shiftKey && e.keyCode==191)
		{			
			
			toggleTab();
		}
		if (e.keyCode==27) // esc key pressed
		{			
			// escape -- means we've got to escape search options
			if (get("searchResults").style.display=="")
			{
				if (get("outlineDiv")==null)
				{
					cancelSearchBasic();					
					get("search").blur();
					get("search").value = "Search something...";					
				}
				else
				{
					cancelSearchOutline();
					get("search").blur();
					get("search").value = "Search outline...";
				}
			}
			cancelBug();
		}
		*/		
	}

	function sendMessage(e, type, type_id)
	{	

		var new_id = -1;	
			
		if (type=="public" || type=="courses" || type=="studygroups" || type=="friends")
		{
			var type_id = get("station_" + type).value;			
		}
		
		var tab_id = -1;
		var new_tab = -1;
		switch  (type)
		{
			case "public": tab_id=0; break;
			case "courses": tab_id=1; break;
			case "studygroups": tab_id=2; break;
			case "friends": tab_id=3; break;
		}
		
		var msg = get("tab_message_" + type);
		var this_msg = msg.value;	

		if (e.ctrlKey && e.altKey && e.shiftKey && e.keyCode==32)	// this conditional must appear first otherwise it would fire both 
		{
			new_id = navigateStation(type, "prev", true);
			//alert(new_id);
			var o = get("station_" + type);
			if (new_id!=-1)
			{
				o.value = new_id;
				changeStationTune(type, new_id);
			}
			return;		
		}
		
		if (e.ctrlKey && e.shiftKey && e.keyCode==32)
		{
			new_id = navigateStation(type, "next", true);
			//alert(new_id);
			var o = get("station_" + type);
			if (new_id!=-1)
			{
				o.value = new_id;
				changeStationTune(type, new_id);
			}
			return;		
		}
		
		//alert(e.keyCode);
		if (e.ctrlKey && e.shiftKey)
		{	
			
		
			if (e.keyCode==219 || e.keyCode==221)
			{			
				if (e.keyCode==219)
				{
					// [ tuner left
					new_id = navigateStation(type, "prev", true);
				}
				
				if (e.keyCode==221)
				{
					// ] tuner right
					new_id = navigateStation(type, "next", true);
				}
				var o = get("station_" + type);
				if (new_id!=-1)
				{
					o.value = new_id;
					changeStationTune(type, new_id);
				}
				return;
			}			
			
			if (e.keyCode==49)			
				switchChatTabs('0');
			if (e.keyCode==50)			
				switchChatTabs('1');
			if (e.keyCode==51)			
				switchChatTabs('2');
			if (e.keyCode==52)			
				switchChatTabs('3');
			if (e.keyCode==190)//right
			{
				new_tab = tab_id+1==4 ? 0 : tab_id+1;
				switchChatTabs(String(new_tab));
			}
			if (e.keyCode==188)//left
			{
				new_tab = tab_id-1==-1 ? 3 : tab_id-1;
				switchChatTabs(String(new_tab));
			}
			
			return;
		}
		
		if (e.keyCode==13)
		{			

			//alert(type_id);
			if (meteordead)
			{
				alert("It appears that you've opened another window.  Chat services is available in only one window at a time.  Please reload this page to continue your chat here, or use the other window.");
				return;
			}
			
			if (trim(msg.value)=="")
			{
				return;
			}

			if (type_id=="-1")
			{
				alert("Plese select which " + type.substr(0, type.length-1) + " you would like to send your message to.");
				return;
			}
	
			msg.value = "";

			function _sendMessage(r)
			{
				//alert(r);
				if (r!="")
				{
					alert(r);
				}
				msg.focus();			
				return;
			}
			var ch = type + "_" + type_id;
			
			
			var url = "sendMessage=1&message=" + replaceAll("\\+", "%2B", escape(this_msg)) + "&channel=" + ch + "&type=" + type + "&type_id=" + type_id;
			//alert(url);
			Aajax(weburl+"chat/ajax.php", url, _sendMessage);
		}
	}
	
	function waitF5()
	{
		return "<table width=\"100%\" border=\"0\"><tr><td width=\"1%\" style=\"height:35px; padding:5px;\"><img src=\"" + weburl + "wait_F5F5F5.gif\" height=\"16\" width=\"16\" border=\"0\" /></td><td valign=\"middle\" style=\"padding:5px; font-size:10px; color:#333333\" align=\"left\">Loading content...</td></tr></table>";
	}
	
	//// PROFESSOR COURSE AREA
	function changeProfTab(n, cid)
	{
		if (true) //debug())
		{
			
			function _changeProfTab(r)
			{
				session(r);
				get("prof_tab_view_" + n).innerHTML = r;
				return;
			}

			var hl_col = "#4d4d4d";
			var nl_col = "#d6d5d5";
			var toHide = -1;
			for (i=0; i<4; i++)
			{
				try
				{
					get("prof_tab_" + i).style.backgroundImage = "url('" + weburl + "prof_tab_0.jpg')";
					get("prof_tab_" + i + "_link").style.color = nl_col;
					if (get("prof_tab_view_" + i).style.display=="")
					{
						toHide = i;
					}
				}
				catch (e)
				{}
			}
			get("prof_tab_" + n).style.backgroundImage = "url('" + weburl + "prof_tab_1.jpg')";
			get("prof_tab_" + n + "_link").style.color = hl_col;

			hide("prof_tab_view_" + toHide);
			get("prof_tab_view_" + n).innerHTML = "<div class=\"profBlock\" style=\"height:360px; overflow-y:auto; overflow-x:hidden;\">" + waitF5() + "</div>";
			show("prof_tab_view_" + n);			
						
			var url = "changeProfTab=1&n=" + n + "&cid=" + cid;
			Aajax(weburl+"courses/index.php", url, _changeProfTab);
		}
		
		if (false) //!debug())
		{
			var hl_col = "#4d4d4d";
			var nl_col = "#d6d5d5";
			var toHide = -1;
			for (i=0; i<4; i++)
			{
				try
				{
					get("prof_tab_" + i).style.backgroundImage = "url('" + weburl + "prof_tab_0.jpg')";
					get("prof_tab_" + i + "_link").style.color = nl_col;
					if (get("prof_tab_view_" + i).style.display=="")
					{
						toHide = i;
					}
				}
				catch (e)
				{}
			}
			get("prof_tab_" + n).style.backgroundImage = "url('" + weburl + "prof_tab_1.jpg')";
			get("prof_tab_" + n + "_link").style.color = hl_col;
	
			hide("prof_tab_view_" + toHide);
			show("prof_tab_view_" + n);
		}
		
	}
