var if_userAgent = navigator.userAgent.toLowerCase();
var opera = (if_userAgent.indexOf('opera') != -1); // is opera
var ns4 = (document.layers) ? true : false; // is netscape 4
var ie4 = (document.all && !document.getElementById) ? true : false; // is IE 4
var ie5 = (document.all && document.getElementById) ? true : false; // is IE 5+
var ns6 = (!document.all && document.getElementById) ? true : false; // is netscape 6

/* ----------------------------------------------------------- */
// Build Search Link 
/* ----------------------------------------------------------- */

function if_InitSearchLink(strRoomSkin) {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" title="Search" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += 'search.gif" border="0" align="absmiddle"></a>';}
	else {
	strLink += '<a href="search.aspx" title="Search" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += 'search.gif" border="0" align="absmiddle">Search</a>';}
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Search Menu
/* ----------------------------------------------------------- */

function if_InitSearch(strRoomSkin) {

	var hrefLocation = location.href;
	var arrHref = hrefLocation.split("/");
	var PathRelative = arrHref[0] + '//' + arrHref[2] + '/' + arrHref[3] + '/'; 

	var tableCode = '';
	tableCode += '<form name="mnu_search" method="get" action="' + PathRelative + 'search.aspx">'
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += 'Search All Rooms</td></tr>'
	tableCode += '<tr><td nowrap class="RoomsBody1">'
	tableCode += '<input type="text" class="FormInputText" size="18" name="query">&nbsp;'
	tableCode += '<input type="image" align="absmiddle" ToolTip="Search Rooms..." alt="Search Rooms..." border="0" src="'
	tableCode +=  strRoomSkin + 'button_go.gif"></a></td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'search.aspx?adv=1" class="smlLinks">Advanced Search...</a></td></tr>'
	tableCode += '</table>'
	tableCode += '</td></tr>'
	tableCode += '</table></form>';			
	return tableCode;

}

/* ----------------------------------------------------------- */
// Build Recent Posts Link 
/* ----------------------------------------------------------- */

function if_InitRecentTopicsLink(strRoomSkin) {
	
	var strLink = '';
	var ImgView = strRoomSkin+"views.gif";
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" title="Views" class="smllinks"><img src="' + ImgView + '" width="80" height="18" border="0"></a>';}
	else {
	strLink += '<a href="miscellaneous.aspx?show=misc24" title="Views" class="smllinks"><img src="' + ImgView + '" width="80" height="18" border="0"></a>';
	}
	
	document.write(strLink);
	
}

function if_InitLink(strRoomSkin) {
	
	var strLink = '';
	var ImgView = strRoomSkin + "mylinks.gif";
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" title="My Links" class="smllinks"><img src="' + ImgView + '" border="0"></a>';}
	else {
	strLink += '<a href="mylinks.aspx" title="My Links" class="smllinks"><img src="' + ImgView + ' border="0"></a>';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Recent Posts Menu
/* ----------------------------------------------------------- */

 function if_InitRecentPosts() {
 	var hrefLocation = location.href;
	var arrHref = hrefLocation.split("/");
	var PathRelative = arrHref[0] + '//' + arrHref[2] + '/' + arrHref[3] + '/'; 
		
	var tableCode = '';
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += 'Recent topics</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'miscellaneous.aspx?show=lastvisit" class="smlLinks">Posts since my last visit</a>'
	tableCode += '</td></tr><tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'miscellaneous.aspx?show=misc24" class="smlLinks">Posts from last 24 hours</a>'
	tableCode += '</td></tr><tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'miscellaneous.aspx?show=misc7days" class="smlLinks">Posts from last 7 days</a>'
	tableCode += '</td></tr><tr><td class="cuadro3_texto4">'
	tableCode += '<a href="' + PathRelative + 'miscellaneous.aspx?show=active" class="HeaderTxt">Active topics</a>'
	tableCode += '</td></tr><tr><td class="cuadro3_texto4">'
	tableCode += '<a href="' + PathRelative + 'miscellaneous.aspx?show=favorite" class="HeaderTxt">Favorite topics</a>'
	tableCode += '</td></tr><tr><td class="RoomsBody1">'
	tableCode += '<a href="javascript:;" onclick="window.open(\'' + PathRelative + 'generateword.aspx\',\'z\',\'width=200,height=100,top=300,left=400\');" class="smlLinks">'
	tableCode += '<img src="' + PathRelative + 'images/icons/doc.gif" align="absMiddle" border="0">&nbsp;Save last post</a>'	
	tableCode += '</td></tr></table>'		
	tableCode += '</td></tr>'
	tableCode += '</table>';	
			
	return tableCode;
}

 function if_MyLinks() {
 
	var tableCode = '';
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += 'My Links</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="miscellaneous.aspx?show=lastvisit" class="smlLinks">E-mail 1</a></td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="miscellaneous.aspx?show=lastvisit" class="smlLinks">E-mail 2</a></td></tr>'
	tableCode += '</table>'		
	tableCode += '</td></tr>'
	tableCode += '</table>';			
	return tableCode;
}

/* ----------------------------------------------------------- */
// Author Name Link 
/* ----------------------------------------------------------- */

function if_InitAuthorNameLink(strAuthorName, intAuthorID) {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="smllinks"><b>' + strAuthorName + '</b></a>';}
	else {
	strLink += '<a href="userinfo.aspx?id=' + intAuthorID + '" class="smllinks"><b>' + strAuthorName + '</b></a>';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Author Link Menu
/* ----------------------------------------------------------- */

 function if_InitAuthorName(intAuthorID) {
 
	var tableCode = '';
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="userinfo.aspx?id='
	tableCode += intAuthorID
	tableCode += '" class="smlLinks">View Members Profile</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?MemberID='
	tableCode += intAuthorID
	tableCode += '&Task=AddBuddy" class="smlLinks">Add To Buddy List</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?MemberID='
	tableCode += intAuthorID
	tableCode += '&Task=doPM" class="smlLinks">Send Private Message</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?MemberID='
	tableCode += intAuthorID
	tableCode += '&Task=doEmail" class="smlLinks">Send Email To Member</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="search.aspx?MemberID='
	tableCode += intAuthorID
	tableCode += '&adv=1" class="smlLinks">Find All Members Posts</a>'
	tableCode += '</td></tr>'
	tableCode += '</table></td></tr>'
	tableCode += '</table>';			
	return tableCode;

}

function if_InitAuthorName2(intAuthorID) {
 
	var str = intAuthorID;		
	intAuthorID = str.replace("x","");

	var tableCode = '';	
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>';
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">';
	tableCode += '<tr><td class="RoomsBody1">';
	tableCode += '<a href="userinfo.aspx?id=';
	tableCode += intAuthorID;
	tableCode += '" class="smlLinks">View Members Profile</a>';
	tableCode += '</td></tr>';
	tableCode += '<tr><td class="RoomsBody1">';
	tableCode += '<a href="logon.aspx?MemberID=';
	tableCode += intAuthorID;
	tableCode += '&Task=doPM" class="smlLinks">Send Private Message</a>';
	tableCode += '</td></tr>';
	tableCode += '<tr><td class="RoomsBody1">';
	tableCode += '<a href="logon.aspx?MemberID=';
	tableCode += intAuthorID;
	tableCode += '&Task=doEmail" class="smlLinks">Send Email To Member</a>';
	tableCode += '</td></tr>';

	//Show or not show the CHAT menu
	//******************************
	var pos = str.match("x");
	if (pos ==null)
	{
		tableCode += '<tr><td class="RoomsBody1">';
		tableCode += '<a href="javascript:void(\'\');"'
		tableCode += ' onclick="'
		tableCode += 'javascript:window.open(';	
		tableCode += '\'ChatRoom.aspx?UserID=';
		tableCode += intAuthorID;
		tableCode += '\', \'\', \'menubar=0,resizable=1,width=425,height=500\');"';
		tableCode += ' class="smlLinks">Chat with this user</a>';
		tableCode += '</td></tr>';		
	} 

	tableCode += '</table></td></tr>';
	tableCode += '</table>';			
	return tableCode;

}

function pb_InitNotesLink(strImage,strRoomSkin) {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += strImage;
	strLink += '" width="20" height="20" border="0" align="middle" ></a>';}
	else {
	strLink += '<a href="#" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += strImage;
	strLink += '" width="20" height="20" border="0"  align="middle"></a>';
	}
	document.write(strLink);
}

/* ----------------------------------------------------------- */
// Build Control Panel Link 
/* ----------------------------------------------------------- */

function if_InitControlPanelLink(strRoomSkin) {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += 'control_panel.jpg" width="23" height="23" border="0"></a>';}
	else {
	strLink += '<a href="profile" class="smllinks"><img src="';
	strLink += strRoomSkin;
	strLink += 'control_panel.jpg" width="23" height="23" border="0"></a>';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Control Panel Menu
/* ----------------------------------------------------------- */

 function if_InitControlPanel() {
 
	var hrefLocation = location.href;
	var arrHref = hrefLocation.split("/");
	var PathRelative = arrHref[0] + '//' + arrHref[2] + '/' + arrHref[3] + '/'; 
	
	var tableCode = '';
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="0" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += '<a href="' + PathRelative + 'profile.aspx" class="HeaderTxt">Control Panel</a></td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'contact.aspx" class="smlLinks">Contact</a> / '
	tableCode += '<a href="' + PathRelative + 'personal.aspx" class="smlLinks">Personal Info</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'signature.aspx" class="smlLinks">Message Signature</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'photo.aspx" class="smlLinks">Photo Image</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'logininfo.aspx" class="smlLinks">Registration Details</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="cuadro9_texto2">'
	tableCode += 'Your Controls'
	tableCode += '</td></tr>'
	

	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'subscriptions.aspx" class="smlLinks">Favorite Topics</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="' + PathRelative + 'privatemessages.aspx?Folder=InBox" class="smlLinks">PM Inbox</a> / '
	tableCode += '<a href="' + PathRelative + 'privatemessages.aspx?Folder=SentItems" class="smlLinks">PM Sent Items</a>'
	tableCode += '</td></tr>'
	tableCode += '</table>'
	tableCode += '</td></tr></table>';			
	return tableCode;

}

/* ----------------------------------------------------------- */
// Build Room Options Link
/* ----------------------------------------------------------- */

function if_InitRoomOptionsLink() {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="HeaderTxt" '
	strLink += 'tooltip="Display Room Options...">Room Options</a>';}
	else {
	strLink += '';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Room Options Menu
/* ----------------------------------------------------------- */

 function if_InitRoomOptions() {
 
	var tableCode = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="1" cellpadding="7">'
	tableCode += '<tr><td class="RoomsHeader">'
	tableCode += 'Room Options</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&Task=doPost" class="smlLinks">Post New Topic</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&Task=doRoomSub" class="smlLinks">Subscribe To Room</a>'
	tableCode += '</td></tr>'
	tableCode += '</table></td></tr>'
	tableCode += '</table>';			
	return tableCode;

}

/* ----------------------------------------------------------- */
// Build Room Search Link
/* ----------------------------------------------------------- */

function if_InitRoomSearchLink() {
	
	var strLink = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	if (ie4 || ie5 || ns6) {	
	strLink += '<a href="javascript:void(\'\');" class="HeaderTxt" '
	strLink += 'tooltip="Search This Room...">Search This Room...</a>';}
	else {
	strLink += '<a href="search.aspx?fid=' + intRoomID + '" class="HeaderTxt" '
	strLink += 'tooltip="Search This Room...">Search This Room...</a>';}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Room Search Menu
/* ----------------------------------------------------------- */

function if_InitRoomSearch(strRoomSkin) {
 
	var tableCode = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	tableCode += '<form name="mnu_search" method="get" action="search.aspx">'
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'
	tableCode += '<table width="100%" cellspacing="1" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += 'Search This Room</td></tr>'
	tableCode += '<tr><td nowrap class="RoomsBody1">'
	tableCode += '<input type="hidden" class="FormInputText" value="' + intRoomID + '" name="fid">'
	tableCode += '<input type="text" class="FormInputText" size="18" name="query">&nbsp;'
	tableCode += '<input type="image" ToolTip="Search Room..." alt="Search Room..." align="absmiddle" border="0" src="'
	tableCode +=  strRoomSkin + 'button_go.gif"></a></td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="search.aspx?fid=' + intRoomID 
	tableCode += '&adv=1" class="smlLinks">Recent Room Posts...</a></td></tr>'
	tableCode += '</table>'
	tableCode += '</td></tr>'
	tableCode += '</table></form>';			
	return tableCode;

}

/* ----------------------------------------------------------- */
// Build Topic Options Link
/* ----------------------------------------------------------- */

function if_InitTopicOptionsLink() {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="HeaderTxt" '
	strLink += 'tooltip="Display Topic Options...">Topic Options</a>';}
	else {
	strLink += '';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Topic Options
/* ----------------------------------------------------------- */

 function if_InitTopicOptions() {
 
	var tableCode = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	var intMessageID = if_getQueryStringParameter(window.top.location, 'messageid');
	var intTopicPage = if_getQueryStringParameter(window.top.location, 'topicpage');
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'		
	tableCode += '<table width="100%" cellspacing="1" cellpadding="7">'
	tableCode += '<tr><td class="cuadro3_texto4">'
	tableCode += 'Topic Options</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&MessageID='
	tableCode += intMessageID
	tableCode += '&TopicPage='
	tableCode += intTopicPage
	tableCode += '&Task=doReply" class="smlLinks">Post Reply To Topic</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&MessageID='
	tableCode += intMessageID
	tableCode += '&TopicPage='
	tableCode += intTopicPage
	tableCode += '&Task=doTopicSub" class="smlLinks">Add Favorite Topic</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="logon.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&MessageID='
	tableCode += intMessageID
	tableCode += '&TopicPage='
	tableCode += intTopicPage
	tableCode += '&Task=doEmailTopic" class="smlLinks">Email This Topic</a>'
	tableCode += '</td></tr>'
	tableCode += '<tr><td class="RoomsBody1">'
	tableCode += '<a href="javascript:if_wOpen(\'printtopic.aspx?RoomID='
	tableCode += intRoomID
	tableCode += '&MessageID='
	tableCode += intMessageID
	tableCode += '\',\'700\',\'500\'\,\'0\',\'1\',\'1\',\'1\',\'1\',\'1\')" class="smlLinks">Printable Version</a>'
	tableCode += '</td></tr>'
	tableCode += '</table></td></tr>'
	tableCode += '</table>';	
	return tableCode;

}

/* ----------------------------------------------------------- */
// Build Topic Rating Link
/* ----------------------------------------------------------- */

function if_InitTopicRatingLink() {
	
	var strLink = '';
	if (ie4 || ie5 || ns6) {
	strLink += '<a href="javascript:void(\'\');" class="HeaderTxt" '
	strLink += 'tooltip="Rate This Topic...">Rate This Topic</a>';}
	else {
	strLink += '';
	}
	
	document.write(strLink);
	
}

/* ----------------------------------------------------------- */
// Build Topic Rating Menu
/* ----------------------------------------------------------- */

function if_InitTopicRating(strRoomSkin) {
 
	var tableCode = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	var intMessageID = if_getQueryStringParameter(window.top.location, 'messageid');
	var intTopicPage = if_getQueryStringParameter(window.top.location, 'topicpage');
	tableCode += '<form name="mnu_search" method="get" action="shwmessage.aspx">'
	tableCode += '<table width="100%" class="RoomsBackGroundTable" cellspacing="0" cellpadding="0">';
	tableCode += '<tr><td>'
	tableCode += '<input type="hidden" name="RoomID" value="' + intRoomID + '">'
	tableCode += '<input type="hidden" name="MessageID" value="' + if_removeBookmark(intMessageID) + '">'
	tableCode += '<input type="hidden" name="TopicPage" value="' + intTopicPage + '">'
	tableCode += '<table width="100%" cellspacing="1" cellpadding="7">'
	tableCode += '<tr><td class="RoomsHeader">'
	tableCode += 'Rate This Topic</td></tr>'
	tableCode += '<tr><td nowrap class="RoomsBody1" valign="top">'
	tableCode += '<table width="100%" cellpadding="0" cellspacing="0">'
	tableCode += '<tr><td><img border="0" src="'
	tableCode +=  strRoomSkin + 'misc_rating5.gif">'
	tableCode += '</td><td align="right" class="SmallTxt"> Great Topic'
	tableCode += '<input type="radio" class="RadButton" name="RateVal" checked value="5">'
	tableCode += '</td></tr>'
	tableCode += '<tr><td><img border="0" src="'
	tableCode +=  strRoomSkin + 'misc_rating4.gif">'
	tableCode += '</td><td align="right" class="SmallTxt"> Good Topic'
	tableCode += '<input type="radio" name="RateVal" value="4">'
	tableCode += '</td></tr>'
	tableCode += '<tr><td><img border="0" src="'
	tableCode +=  strRoomSkin + 'misc_rating3.gif">'
	tableCode += '</td><td align="right" class="SmallTxt"> Average'
	tableCode += '<input type="radio" name="RateVal" value="3">'
	tableCode += '</td></tr>'
	tableCode += '<tr><td><img border="0" src="'
	tableCode +=  strRoomSkin + 'misc_rating2.gif">'
	tableCode += '</td><td align="right" class="SmallTxt"> Bad Topic'
	tableCode += '<input type="radio" name="RateVal" value="2">'
	tableCode += '</td></tr>'
	tableCode += '<tr><td><img border="0" src="'
	tableCode +=  strRoomSkin + 'misc_rating1.gif">'
	tableCode += '</td><td align="right" class="SmallTxt"> Terrible'
	tableCode += '<input type="radio" name="RateVal" text="test" value="1">'
	tableCode += '</td></tr>'
	tableCode += '</table></td></tr>'
	tableCode += '<tr><td align="center" class="RoomsBody1">'
	tableCode += '<input type="submit" class="FormButton" value="Rate Topic"></td></tr>'
	tableCode += '</table>'
	tableCode += '</td></tr>'
	tableCode += '</table></form>';			
	return tableCode;

}

function pb_InitNotes(strRoomSkin,strTopicId,hd_Notes_id) {
 
	var tableCode = '';
	var intRoomID = if_getQueryStringParameter(window.top.location, 'roomid');
	var intMessageID = if_getQueryStringParameter(window.top.location, 'messageid');
	var intTopicPage = if_getQueryStringParameter(window.top.location, 'topicpage');
	
	tableCode += '<form name="frmNotes" method="get" action="shwmessage.aspx">'
	tableCode += '<table width="180" border="1" bordercolor="#000000" align="center" bgcolor=#ffffff>';
	tableCode += '<tr><td>';
	tableCode += '<table width="100%" border="0" cellpadding="2" cellspacing="3">';
	tableCode += '<tr><td align="center"><textarea name="txtNote_' + strTopicId + '" cols="30" rows="10" class="borde2"></textarea></td></tr>'
	tableCode += '<tr><td align="center">'
	tableCode += '<input type="hidden" name="RoomID" value="' + intRoomID + '">'
	tableCode += '<input type="hidden" name="MessageID" value="' + if_removeBookmark(intMessageID) + '">'
	tableCode += '<input type="hidden" name="TopicPage" value="' + intTopicPage + '">'
	tableCode += '<input type="hidden" name="MessageTopicId" value="' + strTopicId + '">'
	tableCode += '<input type="hidden" name="deleteNote" value="N">'
	tableCode += '<input type="image" src="'
	tableCode += strRoomSkin
	tableCode += 'btn_updatenota.gif" width="66" height="19">&nbsp;&nbsp;<input type="image" src="'
	tableCode += strRoomSkin
	tableCode += 'btn_deletenota.gif" width="66" height="19" onClick="deleteNote.value=null;">'
	tableCode += '</td></tr></table></td></tr></table></form>'

	return tableCode;
}
/* ----------------------------------------------------------- */
// Helper funtion returns a query string value for the drop down menus
/* ----------------------------------------------------------- */
function if_getQueryStringParameter(queryString, parameterName) {

	var parameterName = parameterName + "="; 
	queryString = queryString + "";
	queryString = queryString.toLowerCase();
	
	if (queryString.length > 0) {

		begin = queryString.indexOf(parameterName); 
	
			if (begin != -1) { 
				begin += parameterName.length; 
				end = queryString.indexOf("&", begin);
				if (end == -1) {end = queryString.length;}
				return unescape(queryString.substring(begin, end));
			}
			
	return "1"; 
	
	} 
}

function toggleBox(szDivID, iState)
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}