function go(where,target) { 
  if(target) {
	if(where != "void" && where!="") target.location.href = where;
  } else {
	if(where != "void" && where!="") location.href = where;
  }
}
function goOpener(url) {
	if (window.opener == self || window.opener == null || window.opener.closed) {
		newwin=window.open(url, "new", "");
		newwin.focus();
	} else {
		window.opener.top.location.href = url;	
		window.opener.focus();
	}
}


function m(mid,bid,page)	{
	if (page)
		location.href="/swg/board/message?board.id="+bid+"&message.id="+mid+"&page="+page+"";
	else
		location.href="/swg/board/message?board.id="+bid+"&message.id="+mid+"";
}

function ml(mid,bid)	{location.href="/swg/board/message?board.id="+bid+"&message.id="+mid+"#M"+mid+"";}

function mss(mid,bid) {
	parent.message_nav.location.href="/swg/board/split_screen/message_nav?board.id="+bid+"&message.id="+mid+"";
	parent.message.location.href="/swg/board/split_screen/message?board.id="+bid+"&message.id="+mid+"";
}

function p(user_id,target){go("/swg/view_profile?user.id="+user_id+"",target);}

function ds(sub_id,target){ go("/swg/action?action=delete_subscription&subscription.id="+sub_id+"",target);}

function ft(bid,tid,target){go("/swg/action?action=float_thread&board.id="+bid+"&message.id="+tid+"",target);}

function fm(bid,mid,target){go("/swg/action?action=float_message&board.id="+bid+"&message.id="+mid+"",target);}

function ca(where,confirmation_text,target) { if(confirm(confirmation_text)) go(where,target);}





var cm=null;
var cPopup;
var ddId = "";
var curEl;
var mAlign;
var lmShowImmediate;
var lmShowLazy = false;
var populated = "";
var menuLagTime = 150;
var menuTimer = 0;
var menuCloseTimer = 0;
var menuCloseLagTime = 500;
var menuOpened = false;
var openMenuId = "";
var useLazyMenu = false;

document.onclick = new Function("closeMenu(true);");
document.ondblclick = new Function("closeMenu(true);");

function getPos(el,sProp) {
	var iPos = 0;
	while (el!=null) {
		iPos+=el["offset" + sProp];
		el = el.offsetParent;
	}
	return iPos;
}

function setMenuLocation(el,m,align) {
	if (document.all) {
		if (align == "right") {
			m.style.left = getPos(el,"Left") - m.offsetWidth + el.offsetWidth;
			m.style.top = getPos(el,"Top") + el.offsetHeight;
		} else {
			m.style.pixelleft = getPos(el,"Left");
			m.style.pixeltop = getPos(el,"Top") + el.offsetHeight;
		}
	} else if (document.getElementById) {
		if (align == "right") {
			m.style.left = getPos(el,"Left") - m.offsetWidth + el.offsetWidth;
		} else {
			m.style.left = getPos(el,"Left");
		}
		m.style.top = getPos(el,"Top") + el.offsetHeight;
	}
}

function getElement(elName) {
	if (document.all) {
		return document.all[elName];
	} else if (document.getElementById) {
		return document.getElementById(elName);
	}
	return "";
}

function stopShow() {
	if (menuTimer > 0) {
		clearTimeout(menuTimer);
		menuTimer = 0;
	}
}

function stopCloseMenu() {
	if (menuCloseTimer > 0) {
		clearTimeout(menuCloseTimer);
		menuCloseTimer = 0;
	}
}

function showNav(e, lay){
	if (document.layers) {
		var menu = document.layers[lay]
		if (menu.visibility=="hide")
			menu.visibility="show";
		else
			menu.visibility="hide";

	menu.left=e.pageX;
	menu.top=e.pageY + 15;
	}
	return false;
}



function closeMenu(immediate) {

	
	if (menuOpened) {
		menuOpened = false;
		return;
	
	} else if (immediate) {
		closeOpenMenus();
		menuCloseTimer = 0;

	
	} else if (menuCloseTimer == 0) {
		menuCloseTimer = setTimeout("closeOpenMenus()", menuCloseLagTime);
	}
}


function closeOpenMenus() {
	
	if (cm != null) {
		cm.style.visibility='hidden';
		cm = null;
	}

	if (cPopup && cPopup.isOpen) {
		cPopup.hide();
	}

	menuOpened = false;
	openMenuId = '';

}


function showLiMenu(el,m,align,showImmediate,showLazy) {
	var el_id;

	
	if (m == null) m = ddId;
	if (el == null) {el = curEl;}
	if (el == null) el_id = ""; else el_id = el.id;
	if (align == null) align = mAlign;
	if (showImmediate == null) showImmediate = lmShowImmediate;
	if (showLazy == null) showLazy = lmShowLazy;

	

	
	if (openMenuId && openMenuId != '') { showImmediate = true; }
	
	
	if (m && openMenuId != m) {

		if (showLazy) {
			if (showImmediate) {
				displayMenuLazy(el_id,m,align);
			} else {
				menuTimer = setTimeout("displayMenuLazy('"+el_id+"','"+m+"','"+align+"')", menuLagTime);
			}
		} else {
			if (showImmediate) {
				displayMenu(el_id,m,align);
			} else {
				menuTimer = setTimeout("displayMenu('"+el_id+"','"+m+"','"+align+"')", menuLagTime);
			}
		}
	}
}



function displayMenuLazy(el,tid,align) {
	
	if (openMenuId != tid) {
		closeMenu(true);
		var menu = getElement(tid);
		el = document.all[el];
		menuHTML = trim(menu.innerHTML);
		if (menuHTML == "" && document.frames["lazymenu"]) {
			lazyHTML = trim(document.frames["lazymenu"].document.body.innerHTML);
			if (lazyHTML != "") {
				menu.innerHTML = lazyHTML;
				menuHTML = lazyHTML;
			}
			populated = populated + " " + tid;
		}
		cPopup = window.createPopup();
		cPopup.document.body.innerHTML = menuHTML + "<style>" + document.all.lithiumcss.innerHTML + "</style>";
		if (align=="right") {
			cPopup.show(-menu.offsetWidth+el.offsetWidth, el.offsetHeight, menu.offsetWidth, menu.offsetHeight, el);
		} else {
			cPopup.show(0, el.offsetHeight, menu.offsetWidth, menu.offsetHeight, el);
		}
	
		ddId = "";
		curEl = "";
		mAlign = "";
		lmShowImmediate = false;
	
		openMenuId = tid;
		menuOpened = true;
		setTimeout("menuOpened=false", 500);
	}
}


function displayMenu(el,m,align) {
	
	if (openMenuId != m) {
		closeMenu(true);
		el = getElement(el);
		var mElement = getElement(m);
		
		
		if (mElement) {
			setMenuLocation(el,mElement,align);
			mElement.style.visibility='visible';
			mElement.style.zIndex=1;
			cm=mElement;
			ddId = "";
			curEl = "";
			mAlign = "";
			lmShowImmediate = false;
			openMenuId = m;
			menuOpened = true;
			setTimeout("menuOpened=false", 500);
		}
	}
}

var messId2 = "";

function setId( mId ) { messId2 = mId; }


function lm(tid, el, mid, bId, messId, lt, align, showImmediate)
{
	
	useLazyMenu = true;
	if (tid == openMenuId) {
		return;
	} else if (populated.indexOf(tid) > -1) {
		showLiMenu(el,tid,align,showImmediate,true)
	} else if (tid && ddId == "") {		
		populated += " " + tid;
		
		ddId = tid;
		curEl = el;
		mAlign = align;
		lmShowImmediate = showImmediate;
		lmShowLazy = true;
		var addl = "";
		
		if (messId2 != "") {
			addl = "&message2.id="+messId2;
			messId2="";
		}

		var queryString = "menu="+mid+"&linktarget="+lt+addl;
		if (bId != "") {
			queryString += "&board.id="+bId;
		}
		if (messId != "") {
			queryString += "&message.id="+messId;
		}
		document.frames["lazymenu"].document.location.href="/swg/lazymenu?"+queryString+"";
	} else {
		ddId = "";
		curEl = "";
		mAlign = "";
		lmShowImmediate = false;
		openMenuId = "";
	}
}



function trim(sString)
{
   sTrimmedString = "";
   if (sString && sString != "")
   {

      var iStart = 0;
      var iEnd = sString.length - 1;
      var sWhitespace = " \t\f\n\r\v";
      
      while (sWhitespace.indexOf(sString.charAt(iStart)) != -1)
      {
         iStart++;
         if (iStart > iEnd)
            break;
      }
      
      
      if (iStart <= iEnd)
      {
         while (sWhitespace.indexOf(sString.charAt(iEnd)) != -1)
            iEnd--;
         sTrimmedString = sString.substring(iStart,++iEnd);
      }
   }
   return sTrimmedString;
}




function toggle_help(el) {
	if (document.all) {
		el = document.all[el];
		if (el != null) {

			if (el.style.display == '') {
				el.style.display='none';
			} else {
				el.style.display='';
			}
		}
	} else if (document.layers) {
		el = document.layers[el];
		if (el != null) {
			if (el.display == '') {
				el.display='none';
			} else {
				el.display='';
			}
		}
	} else if (document.getElementById) {
		el = document.getElementById(el);
		if (el != null) {
			if (el.style.display == '') {
				el.style.display='none';
			} else {
				el.style.display='';
			}
		}
	}
}

function show_help(el) {
	if (document.all) {
		el = document.all[el];
		if (el != null) {
			el.style.display='';
		}
	} else if (document.getElementById) {
		el = document.getElementById(el);
		if (el != null) {
			el.style.display='';
		}
	}
}

function hide_help(el) {
	if (document.all) {
		el = document.all[el];
		if (el != null) {
			el.style.display='none';
		}
	} else if (document.getElementById) {
		el = document.getElementById(el);
		if (el != null) {
			el.style.display='none';
		}
	}
}




function lipopup(url, desc, width, height, scroll, resize) {
	var popup = window;
	
	if (!popup.closed)
		popup.focus();
	win=window.open(url, desc, "width="+width+",height="+height+",scrollbars="+scroll+",resizable="+resize);
}

// Backwards-compatible wrapper for lipopup
function popup(url, desc, width, height, scroll, resize) {
	lipopup(url, desc, width, height, scroll, resize)
}

function resizeWindow(width, height) {
	var newHeight = height + 35;
	if (newHeight > 748) newHeight = 748;
	window.resizeTo(width,newHeight);
}

function text_values_export_frame(language, filter) {
	exportwin=window.open("/swg/admin/text_values?action=export&profile.language=" + language + "&text_values.filter=" + filter+"", "export", "width=800,height=600,scrollbars=yes,resizable=yes,menubar=yes");
}




var noteswin = window;
var assistantwin = window;


function note_frame() {
	if (!noteswin.closed)
		noteswin.focus();
	noteswin=window.open("/swg/notes?action=frame", "notes" + user_id() + "swg", "width=600,height=400,scrollbars=yes,resizable=yes");
}
function friends()    {
	if (!noteswin.closed)
		noteswin.focus();
	noteswin=window.open("/swg/notes?action=frame&tab=4", "notes" + user_id() + "swg", "width=600,height=400,scrollbars=yes,resizable=yes");
}
function note_send(to_user) {
	if (!noteswin.closed)
		noteswin.focus();
	noteswin=window.open("/swg/notes?action=frame&tab=3&notes.to_user="+to_user+"", "notes" + user_id() + "swg", "width=600,height=400,scrollbars=yes,resizable=yes");
}		
function note_view(id) {
	if (!noteswin.closed)
		noteswin.focus();
	noteswin=window.open("/swg/notes?action=frame&tab=7&t=inbox&id="+id+"", "notes" + user_id() + "swg", "width=600,height=400,scrollbars=yes,resizable=yes");
}		
function assistant()    {
	if (!assistantwin.closed)
		assistantwin.focus();
	assistantwin=window.open("/swg/assistant", "assistant" + user_id() + "swg", "width=300,height=400,scrollbars=yes,resizable=yes");
}




	var curHighlightedMessage;

	function highlightMessage(threadRow) {

		
		restoreMessage(curHighlightedMessage);
		if (threadRow != null) {

			var rootThread;

			
			if (threadRow.id.indexOf(".") > 0) {

				var rootImageId = threadRow.id.substring(0, threadRow.id.lastIndexOf(".")) + "i";

				
				if (document.all[rootImageId].collapsed == 1) {
					toggleThread(document.all[rootImageId]);
				}
			}

			


			if (document.body.clientHeight + document.body.scrollTop -  threadRow.offsetTop - threadRow.offsetHeight < 0) {

				threadRow.scrollIntoView(false);
			}

			
			if (document.body.scrollTop > threadRow.offsetTop) {

				threadRow.scrollIntoView(true);
			}

			
			var messageTds = threadRow.getElementsByTagName("td");
			curHighlightedMessage = threadRow;

			for (var i = 0; i < messageTds.length; i++) {
				if (messageTds[i].className == "cell_1") {
					messageTds[i].className = "cell_hi";
				} else if (messageTds[i].className == "cell_small_1") {
					messageTds[i].className = "cell_small_hi";
				} else if (messageTds[i].className == "cell_2") {
					messageTds[i].className = "cell_hi2";
				} else if (messageTds[i].className == "cell_small_2") {
					messageTds[i].className = "cell_small_hi2";
				}
			}

			
			var messageLinks = threadRow.getElementsByTagName("a")

			for (var i = 0; i < messageLinks.length; i++) {
				if (messageLinks[i].className == "subj_unread") {
					messageLinks[i].className = "subj_read";
					return;
				} else if (messageLinks[i].className == "subj_read") {
					return;
				}
			}



		} else {
			
		}
	}

	function restoreMessage(threadRow) {
		if (curHighlightedMessage != null) {
			var messageTds = threadRow.getElementsByTagName("td");

			for (var i = 0; i < messageTds.length; i++) {
				if (messageTds[i].className == "cell_hi") {
					messageTds[i].className = "cell_1";
				} else if (messageTds[i].className == "cell_small_hi") {
					messageTds[i].className = "cell_small_1";
				} else if (messageTds[i].className == "cell_hi2") {
					messageTds[i].className = "cell_2";
				} else if (messageTds[i].className == "cell_small_hi2") {
					messageTds[i].className = "cell_small_2";
				}
			}
		}
	}

	function toggleThread(stateEl) {
		if (stateEl.collapsed == 1) {
			stateEl.src=img_thread_collapse;
			stateEl.collapsed = 0;
			setThreadState(stateEl.threadid, document.all[stateEl.threadid], "expand", stateEl.numreplies);
		} else {
			stateEl.src=img_thread_expand;
			stateEl.collapsed = 1;
			setThreadState(stateEl.threadid, document.all[stateEl.threadid], "collapse", stateEl.numreplies);
		}
	}
		
	function setThreadState(threadId, messageEl, action, numreplies) {
		
		if (messageEl == null) {
			return;
		}

		
		if (messageEl.id == null || messageEl.tagName.toUpperCase() != "TR" || messageEl.nodetype == "root") {
			setThreadState(threadId, messageEl.nextSibling, action, numreplies);
			return;

		
		} else if (threadId == messageEl.id.substr(0,threadId.length)) {

			if (action == "expand") {
				if (numreplies < 10) {
					messageEl.style.display="";
					if (messageEl.nodetype == "child") {
						document.all[messageEl.id + "i"].src=img_thread_collapse;
						document.all[messageEl.id + "i"].collapsed = 0;
					}
				} else if (messageEl.id.indexOf(".", threadId.length) == messageEl.id.lastIndexOf(".")) {
					messageEl.style.display="";
				}

			} else if (action == "collapse") {
				if (messageEl.id != threadId) {
					messageEl.style.display="none";
					if (messageEl.nodetype == "child") {
						document.all[messageEl.id + "i"].src=img_thread_expand;
						document.all[messageEl.id + "i"].collapsed = 1;
					}
				}
			}

			setThreadState(threadId, messageEl.nextSibling, action, numreplies);
			return;
		}
		return;
	}

	function setThreadStateAll (action) {
		var alltr = parent.frames.list.document.getElementsByTagName("TR");
		blah = 0;

		for (var i = 0; i < alltr.length; i++) {
			if (action == "collapse") {
				if (alltr[i].nodetype == "root") {
					var nodeimage = parent.frames.list.document.all[alltr[i].id + "i"]
					if (nodeimage != null) {
						nodeimage.src=img_thread_expand;
						nodeimage.collapsed = 1;
						parent.frames.list.setThreadState(alltr[i].id, alltr[i], "collapse", alltr[i].numreplies)
					}
				}
			} else {
				if (alltr[i].nodetype == "root" || alltr[i].nodetype == "child") {
					var nodeimage = parent.frames.list.document.all[alltr[i].id + "i"]
					if (nodeimage != null) {
						nodeimage.src=img_thread_collapse;
						nodeimage.collapsed = 0;
						parent.frames.list.setThreadState(alltr[i].id, alltr[i], "expand", alltr[i].numreplies)
					}
				}
			}
		}
	}



function checkAll(field) {
	if (field) {
		if (field.length > 0) {
			for (i = 0; i < field.length; i++)
				field[i].checked = true;
		} else {
			field.checked = true;
		}
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}

function uncheckAll(field) {
	if (field) {
		if (field.length > 0) {
			for (i = 0; i < field.length; i++)
				field[i].checked = false;
		} else {
			field.checked = false;
		}
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}



function moveBatch(field) {
	if (field) {
		var mp = "";
		var checked = false;
		for (var i=0; i<field.length; i++)  { 
			if (field[i].checked) {
				checked = true;
				if (mp != "") mp += ";";
				mp += field[i].value;
			}
		}
		if (checked) 
			lipopup("/swg/board/move_message?mp="+mp+"", 'move', 600, 635, 'yes', 'yes')
		else
			alert("There are no messages marked for moving.  To move a message, mark the message by clicking the checkbox to the left of the message and choose this option again.");
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}


function deleteBatch(mtype) {
	if (document.batch_action.bm) {
		var checked = false;
		for (var i=0; i<document.batch_action.bm.length; i++)  { 
			if (document.batch_action.bm[i].checked) {
				checked = true;
				break;
			}
		}

		var mess; 
		if (mtype == "threads") {
			mess = "You are about to DELETE all the messages in each of the checked threads.  This affects ALL the messages in the THREAD, not just the replies to this message.  Do you want to delete all the checked threads?";
			document.batch_action.action.value = "delete_thread_batch";
		} else if (mtype == "replies") {
			mess = "You are about to DELETE these messages and their replies in each of the checked threads.  Do you want to delete all the checked messages and their replies?";
			document.batch_action.action.value = "delete_message_and_replies_batch";
		} else if (mtype == "messages") {
			mess = "You are about to DELETE all of the checked messages.  Continue with the batch delete?"
			document.batch_action.action.value = "delete_message_batch";
		}
		if (checked) {
			if (confirm(mess)) {
				document.batch_action.submit();
			}
		} else {
			alert("There are no messages marked for deletion.  To delete a message, mark the message by clicking the checkbox to the left of the message and choose this option again.");
		}
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}

function markBatch(field) {
	if (field) {
		var mp = "";
		var checked = false;
		for (var i=0; i<field.length; i++)  { 
			if (field[i].checked) {
				checked = true;
				if (mp != "") mp += ";";
				mp += field[i].value;
			}
		}
		document.batch_action.action.value = "mark_thread_read_only_batch";
		if (checked) 
			document.batch_action.submit();
		else
			alert("There are no messages marked for this action.  To use perform this action, mark the message by clicking the checkbox to the left of the message and choose this option again.");
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}

function unMarkBatch(field) {
	if (field) {
		var mp = "";
		var checked = false;
		for (var i=0; i<field.length; i++)  { 
			if (field[i].checked) {
				checked = true;
				if (mp != "") mp += ";";
				mp += field[i].value;
			}
		}
		document.batch_action.action.value = "unmark_thread_read_only_batch";
		if (checked) 
			document.batch_action.submit();
		else
			alert("There are no messages marked for this action.  To use perform this action, mark the message by clicking the checkbox to the left of the message and choose this option again.");
	} else {
		alert ("There are no checkboxes available on this page.");
	}
}

var alt1 = 1;
var alt2 = 1;

function reset_alt_colors () {
	if (altColors == "by_row") {
		alt1 = 1;
		alt2 = 1;
	} else if (altColors = "by_column") {
		alt1 = 1;
		alt2 = 2;
	} else {
		alt1 = 1;
		alt2 = 1;
	}
}

function alternate_colors () {
	if (altColors == "by_row") {
		if (alt1 == 1) {
			alt1 = 2;
			alt2 = 2;
		} else {
			alt1 = 1;
			alt2 = 1;
		}
	}
}






function dmfll(read_only,unread_count,reply_count,message_id,message_subject,has_no_text,has_url,has_image,has_attachment,num_pages,author_id,author_login_display,rating_image,last_message_id,last_message_date,last_message_time,last_message_author_id,last_message_author_display,subId,isGlobalFloat,message_views,has_moved,num_self_replies,jump,modMarked,isUserSquelched) {
    var row = "";
	var folder = 0;
	var marked = "subj_read";
	var cell1 = "cell_"+alt1;
	var cell2 = "cell_"+alt2;
	var cell1small = "cell_small_"+alt1;
	
	if (!read_only)			folder += 4;
	if (!userIsRegistered || unread_count > 0)	{
		folder += 2;
		marked = "subj_unread";
	}
	if (reply_count > 10)	folder += 1;
	if (num_self_replies > 0)	folder += 8;

	if (!disableRowTag) row += "<tr>";
	if (showIconsInLists) row += "<td class=\""+cell1+"\" width=10 align=center>"+board_icons[folder]+"</td>";
	if (show_checkboxes) row +=	"<td class=\""+cell2+"\" width=\"1%\" align=center><input type=checkbox name=bm value=\""+message_id+","+boardId+"\"></td>";
	if (show_mod_flag_column) {
		row +=	"<td class=\""+cell1+"\" width=\"1%\" style=\"padding: 2px;\"><table cellpadding=1 cellspacing=0 border=0><tr>";
		if (isUserSquelched) {
			row += "<td><img src=/i/skins/default/icon_mod_squelched.gif height=21 width=14 ";
			row += " alt=\"This user has been squelched\"";
			row += " title=\"This user has been squelched\"></td>";
		} else if (enablesq) {
			row += "<td><img src=/i/p.gif height=21 width=14></td>";
		}
		if (modMarked > 0) {
			row += "<td><img src=/i/skins/default/icon_mod_markedread.gif height=21 width=14 ";
			row += " alt=\"This thread contains messages which haven\'t been read by a moderator\"";
			row += " title=\"This thread contains messages which haven\'t been read by a moderator\"></td>";
		} else {
			row += "<td><img src=/i/p.gif height=21 width=14></td>";
		}
		row += "</tr></table>";
	}
	row += "<td class=\""+cell2+"\"><a href=/"+comm_id+"/board/message?board.id="+boardId+"&message.id="+message_id
	if (jump) {
		row += "&jump=true";
	}
	row += " class=\""+marked+"\">";
	if (has_moved) {
	row += "<img src=/i/global/moved.gif width=25 height=13 border=0 alt=''> Moved: ";
	}
	row += message_subject+"</a> ";
    if (has_no_text) row += icon_no_text + " ";
    if (has_url) row += icon_has_url + " ";
    if (has_image) row += icon_has_image + " ";
    if (has_attachment) row += icon_has_attachment + " ";
    if (num_pages > 1) {
        row += "<span style=\"font-size: 8pt;\"><nobr>[";
        for (var i=1;i<=num_pages;i++) {
            if (i == 10) {
                row += "<a href=/"+comm_id+"/board/message?board.id="+boardId+"&message.id="+message_id+"&page="+num_pages+"  class=subj_read>&#187;</a>";
                break;
            } else { 
                row += "<a href=/"+comm_id+"/board/message?board.id="+boardId+"&message.id="+message_id+"&page="+i+"  class=subj_read>"+i+"</a>"
                if (i != num_pages) row += "&nbsp;"
            }
        }
        row += "]</nobr></span>";
    }
    row += "</td>";
    row += "<td class=\""+cell1+"\" align=center><span class=count_text>"+reply_count+"</span></td>";
    if (unread_count > 0) {
    row += "<td class=\""+cell2+"\" align=center><a href=/"+comm_id+"/board/message?board.id="+boardId+"&message.id="+message_id+"&jump=true class=count_new_text title='Jump to the first unread message'>"+unread_count+"</a></td>";
    } else {
    row += "<td class=\""+cell2+"\" align=center><span class=count_new_text>"+unread_count+"</span></td>";
    }

    row += "<td class=\""+cell1+"\" nowrap><a href='/"+comm_id+"/view_profile?user.id="+author_id+"' class=auth_text>"+author_login_display+"</a>&nbsp</td>";
	if (showRatings) row += "<td class=\""+cell2+"\" align=center>"+rating_image+"</td>";

    row += "<td class=\""+cell1small+"\" nowrap align=right><a href=/"+comm_id+"/board/message?board.id="+boardId+"&message.id="+last_message_id+"#M"+last_message_id+"><span class=date_text>"+last_message_date+"</span> <span class=time_text>"+last_message_time+"</span></a><br>";
    row += "<span class=time_text>by</span> <a href='/"+comm_id+"/view_profile?user.id="+last_message_author_id+"' class=auth_text>"+last_message_author_display+"</a></td>";

	if (showFloat) {
	    if (subId >= 0) {
	        row += "<td class=\""+cell2+"\" align=center><a href=/"+comm_id+"/action?action=delete_subscription&subscription.id="+subId+"&dest_url=referer>"+float_off_icon+"</a></td>";
	    } else if (isGlobalFloat) {
	        row += "<td class=\""+cell2+"\" align=center>"+float_global_icon+"</td>";
	    } else {
	        row += "<td class=\""+cell2+"\" align=center><a href=/"+comm_id+"/action?action=float_thread&board.id="+boardId+"&message.id="+message_id+"&dest_url=referer>"+float_on_icon+"</a></td>";
	    }
	}

	if (!disableRowTag) row += "</tr>";

    document.write(row);
    alternate_colors();
}





function dbfbl(board_id,board_title,board_description,msg_count,new_count,message_id,date,time,user_id,user_name_formatted,subject,sub_id) {
    var row = "";
	var folder = 0;
	var marked = "subj_read";
	
	if (new_count > 0)	{
		folder += 1;
		marked = "subj_unread";
	}

	if (!disableRowTag) row += "<tr>";
	if (showIconsInLists) row += "<td class=cell_"+alt1+" width=10 align=center>"+board_icons[folder]+"</td>";
	row += "<td class=cell_"+alt2+" width=\"40%\"><a href=\"/"+comm_id+"/board?board.id="+board_id+"\" class=list_text>"+board_title+"</a>";
	if (board_description.length > 0) row += "<br><span class=text_smallest>"+board_description+"</span>";
	row += "</td>";
	row += "<td width=\"10%\" class=cell_small_"+alt1+" align=center><span class=count_text>"+msg_count+"</span></td>";
	row += "<td width=\"10%\" class=cell_small_"+alt2+" align=center><span class=count_new_text>"+new_count+"</span></td>";
	row += "<td width=\"40%\" class=cell_small_"+alt1+" align=right>";
	if (msg_count > 0) {
		row += "<a href=\"/"+comm_id+"/board/message?board.id="+board_id+"&message.id="+message_id+"\">"+subject+"</a><br>";
		row += "<span class=time_text>by</span> ";
		row += "<a href=\"/"+comm_id+"/view_profile?user.id="+user_id+"\" class=auth_text>"+user_name_formatted+"</a> ";
		row += "<span class=time_text>on</span> ";
		row += "<span class=date_text>"+date+"</span> <span class=time_text>"+time+"</span>";
	} else {
		row += "No messages posted yet";
	}
	row += "</td>";
	if (sub_id >= 0) {
		row += "<td class=cell_"+alt2+" align=center><a href=\"/"+comm_id+"/action?action=delete_subscription&subscription.id="+sub_id+"\">"+float_on_icon+"</a></td>";
	} else {
		row += "<td class=cell_"+alt2+" align=center><a href=\"/"+comm_id+"/action?action=float_board&board.id="+board_id+"\">"+float_off_icon+"</a></td>";
	}

	if (!disableRowTag) row += "</tr>";
    document.write(row);
    alternate_colors();
}



	function open_pollwin() {
	wheelpoll = window.open("http://starwarsgalaxies.station.sony.com/poll/starwars/poll.jsp","wheelpoll","height=640,width=580,resizable=no,scrollbars=yes,status=no");
	}

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	function loginWinVar(pid, return_url){
		var from_URL = return_url;
		var url="https://login.station.sony.com/login/login.jsp?returnURL="+from_URL+"&pid="+pid;
		window.open(url, "signin", "width=280,height=350,status=yes,resizable=no");
	}
	MM_reloadPage(true);
	
	// This part allows Javascript to talk to Flash
	function gamesMenu()
	{
	 var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	 var flashMovie = InternetExplorer ? document.s_loader : document.embeds[0];
	 var movie_ready = "false";
	 if(movie_ready == "false")
	 {
	  while(movie_ready == "false")
	  {
	   if(flashMovie.PercentLoaded() == 100)
	   {
		flashMovie.TGotoLabel("_level0/gamesMenu/","open");
		movie_ready = "true";
	   }
	  }
	 }
	 else
	 {
	  flashMovie.TGotoLabel("_level0/gamesMenu/","open");
	 }
	}
	
	var axel = Math.random() + "";
	var ord = axel * 1000000000000000000;
	
function handleResize()
{
        if (navigator.appName == "Netscape")
        {
                location.reload();
                return true;
        }
        
}

// Can the user accept cookies
var WM_acceptsCookies = false;

if(document.cookie == '') {
    document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie.
    if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) {
	WM_acceptsCookies = true; 
    }// If it succeeds, set variable
} else { // there was already a cookie
  WM_acceptsCookies = true;
}

function WM_setCookie (name, value, hours, path, domain) {
    if (WM_acceptsCookies) { 
		var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();
		// Set the cookie, adding any parameters that were specified.
		document.cookie = name + '=' + escape(value) + ';expires=' + numHours + ';path=' + path + ((domain)?';domain=' + domain:''); 
    }
}

function WM_readCookie(name) {
    if(document.cookie == '') {
	return false; 
    } else { 
	var firstChar, lastChar;
	var theBigCookie = document.cookie;
	firstChar = theBigCookie.indexOf(name);	// find the start of 'name'
	var NN2Hack = firstChar + name.length;
	if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie
	    firstChar += name.length + 1; // skip 'name' and '='
	    lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';').
	    if(lastChar == -1) lastChar = theBigCookie.length;
	    return unescape(theBigCookie.substring(firstChar, lastChar));
	} else {
	    return false;
	}
    }	
}

function WM_killCookie(name, path) {
  var theValue = WM_readCookie(name); 
  if(theValue) {
      document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ';path=' + path; // set an already-expired cookie
  }
}

flashVer = 0;
browser = "0";

// Netscape detection,
if (document.layers) {
	browser = "Netscape" + parseFloat(navigator.appVersion);
}

// Looking for Netscape Flash. Are we on Windows?
if  (navigator.userAgent.indexOf('Win') == -1) {  // not Windows
	flashVer = -1;   // can't determine Flash Version on Mac
}

//if ( (navigator.mimeTypes) && (navigator.userAgent.indexOf('Win') != -1) ) {
if  ( (document.layers) && (navigator.mimeTypes) ) {
	flashVer = detection_flashNsVersion();
} 

// returns the full version of Flash plugin found or 0.0
function detection_flashNsVersion()
{
  // this function returns an integer which should be the major version of the Flash plugin or 0
  // this function only returns useful information if called from Netscape or IE Mac 5.0+
  // Set these local variables to avoid the Netscape 4 crashing bug.
  var thearray = navigator.plugins
  var arraylen = thearray.length

  // Step through each plugin in the array.
  for (var i=0; i < arraylen; i++) {
    // Set these local variables to avoid the Netscape 4 crashing bug.
    theplugin = thearray[i]
    thename   = theplugin.name
    thedesc   = theplugin.description

    // If the plugin is Flash...
    if (thename.indexOf("Shockwave") != -1 && thename.indexOf("Flash") != -1)
    {
		return thedesc.substring(thedesc.indexOf("Flash ") + 6,thedesc.indexOf("Flash ") + 7);
    }
  }
  
  return 0;
}


//Now checking IE for Flash ActiveX
// this is where we write out the VBScript for MSIE Windows
var WM_startTagFix = '</';
var msie_windows = 0;
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
  msie_windows = 1;
  document.writeln('<script language="VBscript">');
  document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
  document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
  document.writeln('Dim WM_detect_through_vb');
  document.writeln('WM_detect_through_vb = 0');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  WM_detect_through_vb = 1');
  document.writeln('End If');
  document.writeln('Function WM_activeXDetect(activeXname)');
  document.writeln('  on error resume next');
  document.writeln('  If ScriptEngineMajorVersion >= 2 then');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
  document.writeln('     If (err) then');
  document.writeln('        WM_activeXDetect = False');
  document.writeln('     End If');
  document.writeln('   Else');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('   End If');
  document.writeln('End Function');
  document.writeln(WM_startTagFix+'script>');
}

// check for an IE Flash ActiveX 
function lookForFlashDirectX(activeXname) {
	return WM_activeXDetect(activeXname);
}

if ( navigator.userAgent.indexOf('MSIE') != -1 ){
	browser = "IE" + navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5, 3);

	if (navigator.userAgent.indexOf('Win') != -1) {
		if(lookForFlashDirectX('ShockwaveFlash.ShockwaveFlash.3')) {flashVer = 3;}
		if(lookForFlashDirectX('ShockwaveFlash.ShockwaveFlash.4')) {flashVer = 4;}
		if(lookForFlashDirectX('ShockwaveFlash.ShockwaveFlash.5')) {flashVer = 5;}
		if(lookForFlashDirectX('ShockwaveFlash.ShockwaveFlash.6')) {flashVer = 6;}
	}
}

// get Operating System
var os = "Unknown"
if (navigator.appVersion.indexOf("Windows 95") != -1) os = "Windows 95"
else if (navigator.appVersion.indexOf("Win95") != -1) os = "Win95";
else if (navigator.appVersion.indexOf("Windows 98") != -1) os = "Win98";
else if (navigator.appVersion.indexOf("Win98") != -1) os = "Win98";
else if (navigator.appVersion.indexOf("Windows NT") != -1) {
	os = "WinNT";
	if (navigator.appVersion.indexOf("Windows NT 4") != -1) os = "WinNT4";
	else if (navigator.appVersion.indexOf("Windows NT 5.0") != -1) os = "Win2000";
	else if (navigator.appVersion.indexOf("Windows NT 5.1") != -1) os = "WinXP";
}
else if (navigator.appVersion.indexOf("WinNT") != -1) os = "WinNT";
else if (navigator.appVersion.indexOf("Mac") != -1) {
	if ( navigator.userAgent.indexOf('MSIE') != -1 ) {
		if ( navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5, 3) <= 5 ) {
			os = "Macintosh9";
		} else {
			os = "Macintosh10";
		}
	} else {
		os = "Macintosh";
	}
}

// get monitor color depth
if (navigator.appName != "Netscape") {colors=screen.colorDepth}
else {colors=screen.pixelDepth}
screen_res = screen.width + "x" + screen.height;
// get bandwidth
today = new Date();
time = today.getTime(); 
js=navigator.javaEnabled();

function wow(totalSize, log_ver) {
	isCookie = WM_readCookie(log_ver);
	if (!isCookie) {
		newToday = new Date();
		newTime = newToday.getTime();
		elapsedTime = (newTime - time) / 1000;
            // calculate kb/second with one decimal place
            bw1 = totalSize / elapsedTime;
		bw2 = Math.round( bw1 * 10 );
            bw = bw2 / 10;
		if(isNaN(bw) || bw > 2000) {
			bw = 100;
		}
		var littleImage = new Image();
		littleImage.src= '/common/detector/98734hdlfjbas86d523jhDB.jsp?use_db=true&flashVer=' + flashVer + '&browser=' + browser + '&os=' + os + '&bw=' + bw + '&log_ver='+log_ver + '&colors=' + colors + '&screen_res=' + screen_res + '&js=' + js;
//		alert('flashVer=' + flashVer + '&browser=' + browser + '&os=' + os + '&bw=' + bw + '&log_ver='+log_ver + '&colors=' + colors + '&screen_res=' + screen_res + '&js=' + js);
		cookieContents = "flashVer:"+flashVer+"&browser:"+browser;
		WM_setCookie (log_ver, cookieContents, '200', '/')
	}
}



