/*
Forum Width CP - by Nadim
This code must not be reposted or modified without the permission of its creator.
Leave this header intact at all times.
*/

if(window.location.href.indexOf("index.cgi?action=headersfooters&edit=width")!=-1){
	var WidthCP = '';
	WidthCP += '<br/><center><table id="widthpanel" width="92%" class="bordercolor" cellpadding="4" cellspacing="1">'
	WidthCP += '<tr><td class="catbg" height="18">Edit Forum Width</td></tr>';
	WidthCP += '<tr><td class="windowbg2" height="50">';
	WidthCP += '<table width="100%" height="100%" cellpadding="0" cellspacing="0">';
	WidthCP += '<tr><td width="30%">';
	WidthCP += '<form name="selectwidth" style="margin-bottom:0;">';
	WidthCP += '<input type="radio" name ="pixelwidth" onClick="SwitchToPixels();"> Pixels <br/>';
	WidthCP += '<input type="radio" name="percentwidth" onClick="SwitchToPercent();"> Percent';
	WidthCP += '</form>';
	WidthCP += '</td><td width="70%" align="center" style="border-left-width: 1px; border-left-style: solid; border-left-color: '+document.getElementsByTagName("Table")[0].bgColor+';">';
	WidthCP += '<b>Board Width:</b> <input size="3" maxlength="3" name="forumwidth" type="text" value="'+BoardWidth+'"/><b> <font id="widthtype">'+WidthType+'</font></b>';
	WidthCP += '<br/><a href="JavaScript:DefaultWidth();">[Set to Default]</a>';
	WidthCP += '</td></tr></table>';
	WidthCP += '</td></tr></table></center>';
	function DefaultWidth(){
		if(window.document.selectwidth.percentwidth.checked == true){
			document.getElementById("forumwidth").value = "92";
			document.getElementById("widthtype").innerHTML = "%";
			WidthType = "%";
		}
		if(window.document.selectwidth.pixelwidth.checked == true){
			document.getElementById("forumwidth").value = "720";
			document.getElementById("widthtype").innerHTML = "px";
			WidthType = "";
		}

	}
document.write(WidthCP)
}