//-- Kick all users with an old browser! (Bunch of MF!)
if(is.ns4) {

	alert("This site requires a modern browser like Netscape 7.x, Opera 7.x or Mozilla 1.x (Even Internet Explorer 6.x will do!). This site will look totally fucked up in your browser, so it might be a good idea to upgrade your browser ;)\n\nKicking you to www.netscape.com...");

	document.location="http://www.netscape.com";

}

if(screen.width < 1000) {

	document.writeln("<style>");
	document.writeln("#global {width:950px;position:absolute;left:0px;top:0px;margin-left:0px;}");
	document.writeln("</style>");

}

//-- Show menu
function show(menu_nr) {

	var div_id = 'menu' + menu_nr + '';

	if(is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "visible";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "visible";

		}

	}

}

//-- Show debugwindow
function showDebug() {

	var div_id = 'debug_window';

	if(is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "visible";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "visible";

		}

	}

}

//-- Show div
function showDiv(div_id) {

	if(is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "visible";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "visible";

		}

	}

}

//-- Hide menu
function hide(menu_nr) {

	var div_id = 'menu' + menu_nr + '';

	if (is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "hidden";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "hidden";

		}

	}

}

//-- Hide div
function hideDiv(div_id) {

	if (is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "hidden";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "hidden";

		}

	}

}

function toggleElem(div_id) {

	
	if(document.getElementById(div_id)) {

		if(document.getElementById(div_id).style.display == "block") {
			document.getElementById(div_id).style.display = "none";
		} else {
			document.getElementById(div_id).style.display = "block";
		}

	}

}

//-- Hide debugwindow
function hideDebug() {

	var div_id = 'debug_window';

	if (is.ie4) {

		if(document.all[div_id]) {

			document.all[div_id].style.visibility = "hidden";

		}

	} else {

		if(document.getElementById(div_id)) {

			document.getElementById(div_id).style.visibility = "hidden";

		}

	}

}

//-- Hide all menus
function hideAll() {

	hide(1);
	hide(2);
	hide(3);
	hide(4);
	hide(5);
	hide(6);
	hide(7);
	hide(8);
	hide(9);

}


// Some functions to reduce html bandwidth
function menuStart(menu_name) {
	d.write('<div id="'+menu_name+'">');
	d.write('<table border="0" cellspacing="0" cellpadding="0">');
	d.write('<tr>');
	d.write('<td width="10" height="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10"><img src="'+URL_CURR_SKIN+'img/black_dot.gif" width="1" height="10" border="0" alt="" title=""><img src="'+URL_CURR_SKIN+'img/menu_border_top.gif" width="9" height="10" border="0" alt="" title=""></td>');
	d.write('<td class="menu_border_top" height="10"><img src="'+URL_IMG+'space.gif" width="1" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10" align="right"><img src="'+URL_CURR_SKIN+'img/menu_border_corner_right_top.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('</tr>');
	d.write('<tr>');
	d.write('<td width="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td class="menu_border_left" width="10"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td class="menu_content1" nowrap>');
}

function menuItem(item_name,item_url,is_new,newwindow) {
	if(item_url != '') {
		linktarget = (newwindow != 0) ? 'target="_blank" ' : '';

		if(is_new != "") {
			d.write('<span class="pointer_new2">::</span>');
		} else {
			d.write('::');
		}
		d.write(' <a '+linktarget+'href="'+item_url+'">'+item_name+'</a><br />');
	} else {
		d.write(''+item_name+'<br />');
	}
}

function menuEnd() {
	d.write('</td>');
	d.write('<td class="menu_border_right" width="10"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('</tr><tr>');
	d.write('<td width="10" height="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10"><img src="'+URL_CURR_SKIN+'img/menu_border_corner_left_bottom.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('<td class="menu_border_bottom" height="10"><img src="'+URL_IMG+'space.gif" width="1" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10" align="right"><img src="'+URL_CURR_SKIN+'img/menu_border_bottom.gif" width="9" height="10" border="0" alt="" title=""><img src="'+URL_CURR_SKIN+'img/black_dot.gif" width="1" height="10" border="0" alt="" title=""></td>');
	d.write('<td width="10" height="10" onmouseover="hideAll();"><img src="'+URL_IMG+'space.gif" width="10" height="10" border="0" alt="" title=""></td>');
	d.write('</tr><tr>');
	d.write('<td width="10" height="10" onmouseover="hideAll();" colspan="6"><img src="'+URL_IMG+'space.gif" width="140" height="10" border="0" alt="" title=""></td>');
	d.write('</tr></table></div>');
}

function trackerItem(item_name,item_title,item_date,item_url,is_new,newwindow) {
	linktarget = (newwindow != 0) ? 'target="_blank" ' : '';

	d.write('<b>'+item_date+'</b> ');
	if(is_new != '') {
		d.write('<span class="pointer_new3">*</span> ');
	}
        d.write('<a '+linktarget+'href="'+item_url+'" title="'+item_title+'">'+item_name+'</a><br />');
  	d.write('<div class="sidebar_seperator1"><img src="'+URL_IMG+'space.gif" border="0" alt="" title="" width="1" height="1"></div>');
}

function sideBarSectionStart(title) {
	d.write('<div class="sidebar_head1">&nbsp; '+title+'</div><div class="sidebar_content1">');
}
function sideBarSectionEnd() {
	d.write('</div>');
}
function sideBarSectionSearch() {
	sideBarSectionStart('SEARCH');
	d.write('<form name="search" method="post" action="'+URL_BASE+'search.php">');
	d.write('<table border="0">');
	d.write('<tr><td class="s1" colspan="2"><input class="box2" type="text" name="search_for" size="15" maxlength="60"></td></tr>');
	d.write('<tr><td class="s1"><select name="area" size="1"><option value="forum">Forum</option><option value="library">Library</option><option value="news">News</option><option value="users">Users</option><option></option><option value="ds.net">DS.net</option><option value="google">Google</option></select></td><td class="s1"><a href="javascript:document.search.submit();"><img src="'+URL_CURR_SKIN+'img/button_go.gif" width="32" height="17" border="0" alt="Search" title="Search"></a></td></tr>');
	d.write('</table></form>');
	sideBarSectionEnd();
}
function sideBarSectionStats(num_users,num_topics,num_posts,num_hits,stats_url) {
	sideBarSectionStart('STATS');
	d.write('<table border="0" cellpadding="0">');
	d.write('<tr><td class="s2"><b>Registered Users:</b></td><td class="s2" align="right">'+num_users+'</td></tr>');
	d.write('<tr><td class="s2"><b>Forum Topics:</b></td><td class="s2" align="right">'+num_topics+'</td></tr>');
	d.write('<tr><td class="s2"><b>Forum Posts:</b></td><td class="s2" align="right">'+num_posts+'</td></tr>');
	d.write('<tr><td class="s2"><b>Pageviews / Month:</b></td><td class="s2" align="right">'+num_hits+'</td></tr>');
	d.write('</table>');
	sideBarSectionEnd();
}
function birthdayItem(name,age,url) {
	d.write('<a href="'+url+'">'+name+'</a> ('+age+')<br />');
}
function whoIsOnlineItem(name,url) {
	if(url != "") {
		d.write('<a href="'+url+'">'+name+'</a><br />');
	} else {
		d.write(''+name+'<br />');
	}
}

var numChecked = 0;
function checkAllFields(ref) {
	var chkAll = document.getElementById('checkAll');
	var checks = document.getElementsByName('delPM[]');
	var boxLength = checks.length;
	var allChecked = false;
	var totalChecked = 0;
	if ( ref == 1 ) {
		if ( chkAll.checked == true )
		{
			for ( i=0; i < boxLength; i++ )
			checks[i].checked = true;
		}
		else
		{
			for ( i=0; i < boxLength; i++ )
			checks[i].checked = false;
		}
	} else {
		for ( i=0; i < boxLength; i++ )
		{
			if ( checks[i].checked == true )
			{
			allChecked = true;
			continue;
			}
			else
			{
			allChecked = false;
			break;
			}
		}
		if ( allChecked == true )
		chkAll.checked = true;
		else
		chkAll.checked = false;
	}
	for ( j=0; j < boxLength; j++ )
	{
		if ( checks[j].checked == true )
		totalChecked++;
	}
	
	numChecked = totalChecked;
}

function verify_delete_pms(count) {
	if(count > 1) {
		return confirm("Are you sure you want to delete these "+count+" PMs?");
	} else {
		return confirm("Are you sure you want to delete this PM?");
	}
}