<?

/*
FlexCMS (http://www.flexcms.com)
Flexible, Powerful, Affordable.

Contents of this file are protected by the copyright
notice found at http://www.flexcms.com/flex/pages/copyright.html,
and its usage is subject to the terms of the licensing agreement 
available at http://www.flexcms.com/flex/pages/license.html
*/



		// create the dropdown for the menu item permission options
		$MenuPermissionsDropdown = '<option value="g"> g - '.$MsgText[0][161].'</option><option value="0" selected> 0 - '.$MsgText[0][162].'</option>';
		for ($i = 1; $i <= $UserLevel; $i++) {
			if ($LevelDescriptions[$i] != '') {
				$MenuPermissionsDropdown .= '<option value="'.$i.'"> '.$i.' - '.$LevelDescriptions[$i].'</option>';
			}
			else {
				$MenuPermissionsDropdown .= '<option value="'.$i.'"> '.$i.'</option>';
			}
		}
		
		
		
		if ($row['BlockContents'] != '') {
		
		$MenuItemsArray = explode ('^^^^',$row['BlockContents']);
		// the first line is the separator, everything after that is menu items
																
		if ($MenuItemsArray[0] != '') {
			list ($MenuItemSpacer, $MenuHeader, $MenuFooter) = explode('%%%',$MenuItemsArray[0]);
		}
		else {
			$MenuHeader = '';
			$MenuFooter = '';
			if ($row['BlockLocation'] == 1 || $row['BlockLocation'] == 2) {
				$MenuItemSpacer = '<br>';
			}
			else {
				$MenuItemSpacer = '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;';
			}
		}
							
	
		$MenuTextA = '';
		$MenuImageA = '';
		$MenuCodeA = '';
		$MenuLinkA = '';
		$MenuPriorityA = '';
		
														
		// >>>> starts at one, as the first item is the spacer
		for ($g = 1; $g < count($MenuItemsArray); $g++) {
			
			if ($MenuItemsArray[$g] != '') {
	
				list ($MenuText,$MenuImage,$MenuCode,$MenuLink,$MenuPermissions,$MenuEnabled,$MenuPriority) = explode ('%%%',$MenuItemsArray[$g]);
								
				if ($MenuPriority == '') {
					// if the menu priority is empty, set it to 0 for tracking and sorting purposes
					$MenuPriority = 0;
				}
				//if (($MenuPermissions == 'g' && $LoggedIn != 'y') || ($MenuPermissions != 'g' && $UserLevel>=$MenuPermissions) && $MenuEnabled == 1) {
				// if the user is a guest and the block is for guests only, or if the block isn't
				// for guests only and their permissions are high enough to see it
			
					$MenuTextA[] = $MenuText;
					$MenuImageA[] = $MenuImage;
					$MenuCodeA[] = $MenuCode;
					$MenuLinkA[] = $MenuLink;
					$MenuPriorityA[] = $MenuPriority;
					$MenuPermissionsA[] = $MenuPermissions;
					$MenuEnabledA[] = $MenuEnabled;
			
				//} // end if should be displayed
		
			} // end if row != ''
								
		} // end loop
							
							
		for ($g = 0; $g < count($MenuPriorityA); $g++) {
			for ($h = 0; $h < count($MenuPriorityA)-1; $h++) {

				if ($MenuPriorityA[$h] > $MenuPriorityA[$h+1]) {
									
					$Swap1 = $MenuTextA[$h+1];
					$Swap2 = $MenuImageA[$h+1];
					$Swap3 = $MenuCodeA[$h+1];
					$Swap4 = $MenuLinkA[$h+1];
					$Swap5 = $MenuPriorityA[$h+1];
					$Swap6 = $MenuPermissionsA[$h+1];
					$Swap7 = $MenuEnabledA[$h+1];
										
					$MenuTextA[$h+1] = $MenuTextA[$h];
					$MenuImageA[$h+1] = $MenuImageA[$h];
					$MenuCodeA[$h+1] = $MenuCodeA[$h];
					$MenuLinkA[$h+1] = $MenuLinkA[$h];
					$MenuPriorityA[$h+1] = $MenuPriorityA[$h];
					$MenuPermissionsA[$h+1] = $MenuPermissionsA[$h];
					$MenuEnabledA[$h+1] = $MenuEnabledA[$h];
										
					$MenuTextA[$h] = $Swap1;
					$MenuImageA[$h] = $Swap2;
					$MenuCodeA[$h] = $Swap3;
					$MenuLinkA[$h] = $Swap4;
					$MenuPriorityA[$h] = $Swap5;
					$MenuPermissionsA[$h] = $Swap6;
					$MenuEnabledA[$h] = $Swap7;
								
				}
								
			}
		}
							
		$BGColor = '#f1f1f1';
							
		for ($g = 0; $g < count($MenuPriorityA); $g++) {
		
			if ($g == 0) {
				$JSArray1 = '"'.$MenuTextA[$g].'"';
				$JSArray2 = '"'.$MenuImageA[$g].'"';
				$JSArray3 = '"'.str_replace('"','\"',$MenuCodeA[$g]).'"';
				$JSArray4 = '"'.$MenuLinkA[$g].'"';
				$JSArray5 = '"'.$MenuPriorityA[$g].'"';
				$JSArray6 = '"'.$MenuPermissionsA[$g].'"';
				$JSArray7 = '"'.$MenuEnabledA[$g].'"';
			}
			else {
				$JSArray1 .= ',"'.$MenuTextA[$g].'"';
				$JSArray2 .= ',"'.$MenuImageA[$g].'"';
				$JSArray3 .= ',"'.str_replace('"','\"',$MenuCodeA[$g]).'"';
				$JSArray4 .= ',"'.$MenuLinkA[$g].'"';
				$JSArray5 .= ',"'.$MenuPriorityA[$g].'"';
				$JSArray6 .= ',"'.$MenuPermissionsA[$g].'"';
				$JSArray7 .= ',"'.$MenuEnabledA[$g].'"';
			}
		
			
			if ($BGColor == '#f1f1f1') {
				$BGColor = '#ffffff';
			}
			else {
				$BGColor = '#f1f1f1';
			} 
			
			if ($MenuEnabledA[$g] == 1) {
				$MEPrint = 'Yes';
			}
			else {
				$MEPrint = 'No';
			}
			
			if ($MenuImageA[$g] != '') {
				$MIPrint = 'Yes';
			}
			else {
				$MIPrint = '';
			}
			
			if ($MenuCodeA[$g] != '') {
				$MCPrint = 'Yes';
			}
			else {
				$MCPrint = '';
			}
			
			$ItemsBlock .= '
				<tr bgcolor="'.$BGColor.'">
				<td><font face="'.$FontFace.'" size="2" color="#222222">'.$MenuTextA[$g].'</td>
				<td><font face="'.$FontFace.'" size="2" color="#222222">'.$MIPrint.'&nbsp;</td>
			    <td><font face="'.$FontFace.'" size="2" color="#222222">'.$MCPrint.'&nbsp;</td>
			    <td><font face="'.$FontFace.'" size="2" color="#222222">'.$MenuLinkA[$g].'&nbsp;</td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222">'.$MenuPriorityA[$g].'</td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222">'.$MenuPermissionsA[$g].'</td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222">'.$MEPrint.'</td>
				<td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><a href="javascript:EditItem('.$g.')"><font color="#222222">'.$MsgText[0][155].'</a></td>
				<td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><a href="javascript:DeleteItem('.$g.')"><font color="#222222">'.$MsgText[0][156].'</a></td>
				</tr>';
								
	
		} // end loop
		
		} // end if not empty in the db
		else {
		$ItemsBlock = '<tr><td colspan="8"><font face="'.$FontFace.'" size="2" color="#222222">'.$MsgText[0][195].'</td></tr>';
		}
		
		$PMBStuff = '<input type="hidden" name="BlockContents" value="'.str_replace('"','&#34;',$row['BlockContents']).'"><input type="hidden" name="ReturnToBW" value=""><br><table width="95%" border="0" cellspacing="0">
    <tr>
      <td bgcolor="#c0c0c0"><table width="100%" border="0" cellpadding="6" cellspacing="0" align="center">
    <tr>
      <td bgcolor="#f6f6f6"><font color="#222222"><b>'.$MsgText[0][217].'</b><br><br><table width="100%" border="0" cellpadding="4" cellspacing="0"><tr>
				<td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][198].'</b></td>
				<td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][218].'</b></td>
			    <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][219].'</b></td>
			    <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][197].'</b></td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][199].'</b></td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][157].'</b></td>
			    <td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][220].'</b></td>
				<td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][155].'</b></td>
				<td align="center"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][156].'</b></td>
				</tr>'.$ItemsBlock.'</table>
				
				<input type="hidden" name="CurrentlyBeingEdited" value="-1">

<div align="center"><br><br>
<table align="center" width="75%" border="0" cellspacing="0">
    <tr>
      <td bgcolor="#d1d1d1">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
	<tr><td colspan="2" bgcolor="#f1f1f1"><font size="2" color="#222222"><b>'.$MsgText[0][200].':</b></font><br></td></tr>
    <tr>
      <td width="25%"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][198].'</b></td>
      <td><input type="text" name="MenuText" size="25"><br><font size="2" color="#222222">'.$MsgText[0][221].'</td>
    </tr>
	<tr>
      <td bgcolor="#f1f1f1"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][197].'</b></td>
      <td bgcolor="#f1f1f1"><input type="text" name="MenuLink" size="25"><br><font size="2" color="#222222">'.$MsgText[0][203].'</font></td>
    </tr>
	<tr>
      <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][218].'</b></td>
      <td><input type="text" name="MenuImage" size="25"><br><font size="2" color="#222222">'.$MsgText[0][222].'</td>
    </tr>
	<tr>
      <td bgcolor="#f1f1f1"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][219].'</b></td>
      <td bgcolor="#f1f1f1"><input type="text" name="MenuCode" size="25"><br><font size="2" color="#222222">'.$MsgText[0][223].'</td>
    </tr>
	<tr>
      <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][224].'</b></td>
      <td><select name="MenuPermissions">'.$MenuPermissionsDropdown.'</select><br><font size="2" color="#222222">'.$MsgText[0][225].'</td>
    </tr>
	<tr>
      <td bgcolor="#f1f1f1"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][220].'</b></td>
      <td bgcolor="#f1f1f1"><select name="MenuEnabled">
	<option value="1"> '.$MsgText[0][188].'</option>
	<option value="0"> '.$MsgText[0][187].'</option>
</select>
</td>
    </tr>
	<tr>
      <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][199].'</b></td>
      <td><input type="text" name="MenuPriority" size="5"><br><font size="2" color="#222222">'.$MsgText[0][205].'</td>
    </tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr>
	<td colspan="2" bgcolor="#f1f1f1"><div align="center"><input type="button" value="'.$MsgText[0][206].'" onClick="SaveChanges();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$MsgText[0][207].'" onClick="SaveAsNew();"></div></td>	
	</tr>
</table>
</td>
    </tr>
</table></div>	
				
	<div align="center"><br><br>
<table align="center" width="75%" border="0" cellspacing="0">
    <tr>
      <td bgcolor="#d1d1d1">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
	<tr><td colspan="2" bgcolor="#f1f1f1"><font size="2" color="#222222"><b>'.$MsgText[0][208].':</b></font><br></td></tr>
    <tr>
      <td width="25%"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][209].'</b></td>
      <td><input type="text" name="MenuSpacer" size="25" value="'.str_replace('"','&#34;',$MenuItemSpacer).'"><br><font size="2" color="#222222">'.$MsgText[0][210].'</td>
    </tr>
	<tr>
      <td bgcolor="#f1f1f1"><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][211].'</b></td>
      <td bgcolor="#f1f1f1"><input type="text" name="MenuHeader" size="25" value="'.str_replace('"','&#34;',$MenuHeader).'"><br><font size="2" color="#222222">'.$MsgText[0][212].'</font></td>
    </tr>
	<tr>
      <td><font face="'.$FontFace.'" size="2" color="#222222"><b>'.$MsgText[0][213].'</b></td>
      <td><input type="text" name="MenuFooter" size="25" value="'.str_replace('"','&#34;',$MenuFooter).'"><br><font size="2" color="#222222">'.$MsgText[0][214].'</td>
    </tr>
		<tr>
	<td colspan="2" bgcolor="#f1f1f1"><div align="center"><input type="button" value="'.$MsgText[0][123].'" onClick="SaveSettings();"></div></td>	
	</tr>
</table>
</td>
    </tr>
</table></div>
	
	</td>
    </tr>
</table>
</td>
    </tr>
</table><br><script language="JavaScript">

var MenuText = new Array('.$JSArray1.');
var MenuImage = new Array('.$JSArray2.');
var MenuCode = new Array('.$JSArray3.');
var MenuLink = new Array('.$JSArray4.');
var MenuPriority = new Array('.$JSArray5.');
var MenuPermissions = new Array('.$JSArray6.');
var MenuEnabled = new Array('.$JSArray7.');

var LineOne = "'.str_replace('"','\\"',$MenuItemsArray[0]).'";
var Spacer = "'.str_replace('"','\\"',$MenuItemSpacer).'";
var Header = "'.str_replace('"','\\"',$MenuHeader).'";
var Footer = "'.str_replace('"','\\"',$MenuFooter).'";


function EditItem(ItemNumber) {

	ArrayPosition = ItemNumber;

	document.forms["PostForm"].elements["MenuText"].value = MenuText[ArrayPosition];
	document.forms["PostForm"].elements["MenuLink"].value = MenuLink[ArrayPosition];
	document.forms["PostForm"].elements["MenuCode"].value = MenuCode[ArrayPosition];
	document.forms["PostForm"].elements["MenuImage"].value = MenuImage[ArrayPosition];
	document.forms["PostForm"].elements["MenuPermissions"].value = MenuPermissions[ArrayPosition];
	document.forms["PostForm"].elements["MenuEnabled"].value = MenuEnabled[ArrayPosition];
	document.forms["PostForm"].elements["MenuPriority"].value = MenuPriority[ArrayPosition];
	
	document.forms["PostForm"].elements["CurrentlyBeingEdited"].value = ArrayPosition;

}
function SaveChanges() {

	ArrayPosition = document.forms["PostForm"].elements["CurrentlyBeingEdited"].value;
	if (ArrayPosition >= 0) {
	
	if (document.forms["PostForm"].elements["MenuText"].value != MenuText[ArrayPosition] || document.forms["PostForm"].elements["MenuLink"].value != MenuLink[ArrayPosition] || document.forms["PostForm"].elements["MenuCode"].value != MenuCode[ArrayPosition] || document.forms["PostForm"].elements["MenuImage"].value != MenuImage[ArrayPosition] || document.forms["PostForm"].elements["MenuPermissions"].value != MenuPermissions[ArrayPosition] || document.forms["PostForm"].elements["MenuEnabled"].value != MenuEnabled[ArrayPosition] || document.forms["PostForm"].elements["MenuPriority"].value != MenuPriority[ArrayPosition]) {


		MenuText[ArrayPosition] = document.forms["PostForm"].elements["MenuText"].value;
		MenuLink[ArrayPosition] = document.forms["PostForm"].elements["MenuLink"].value;
		MenuCode[ArrayPosition] = document.forms["PostForm"].elements["MenuCode"].value;
		MenuImage[ArrayPosition] = document.forms["PostForm"].elements["MenuImage"].value;
		MenuPermissions[ArrayPosition] = document.forms["PostForm"].elements["MenuPermissions"].value;
		MenuEnabled[ArrayPosition] = document.forms["PostForm"].elements["MenuEnabled"].value;
		MenuPriority[ArrayPosition] = document.forms["PostForm"].elements["MenuPriority"].value;
		

		var FinalBlockContents = LineOne;
		
		for (i = 0; i < MenuText.length; ++i) {
			
			if (MenuText[i] != \'\' && MenuText[i] != \'undefined\') {
			
				FinalBlockContents = FinalBlockContents + \'^^^^\' + MenuText[i] + \'%%%\' + MenuImage[i] + \'%%%\' + MenuCode[i] + \'%%%\' + MenuLink[i] + \'%%%\' + MenuPermissions[i] + \'%%%\' + MenuEnabled[i] + \'%%%\' + MenuPriority[i];
			
			}
		
		}
		
		document.forms["PostForm"].elements["BlockContents"].value = FinalBlockContents;
		document.forms["PostForm"].elements["ReturnToBW"].value = "y";
		document.forms["PostForm"].submit();

	}
	else {
		
		document.forms["PostForm"].elements["MenuText"].value = "";
		document.forms["PostForm"].elements["MenuLink"].value = "";
		document.forms["PostForm"].elements["MenuCode"].value = "";
		document.forms["PostForm"].elements["MenuImage"].value = "";
		document.forms["PostForm"].elements["MenuPermissions"].value = "";
		document.forms["PostForm"].elements["MenuEnabled"].value = "";
		document.forms["PostForm"].elements["MenuPriority"].value = "";
	
		document.forms["PostForm"].elements["CurrentlyBeingEdited"].value = "-1";
	
	}
	} // end if changing an existing one
	else {
	// creating a new one
	
		ArrayPosition = MenuText.length;
	
	if (document.forms["PostForm"].elements["MenuText"].value == "") {
	
		alert("'.$MsgText[0][226].'");
	
	}
	else {
	
		MenuText[ArrayPosition] = document.forms["PostForm"].elements["MenuText"].value;
		MenuLink[ArrayPosition] = document.forms["PostForm"].elements["MenuLink"].value;
		MenuCode[ArrayPosition] = document.forms["PostForm"].elements["MenuCode"].value;
		MenuImage[ArrayPosition] = document.forms["PostForm"].elements["MenuImage"].value;
		MenuPermissions[ArrayPosition] = document.forms["PostForm"].elements["MenuPermissions"].value;
		MenuEnabled[ArrayPosition] = document.forms["PostForm"].elements["MenuEnabled"].value;
		MenuPriority[ArrayPosition] = document.forms["PostForm"].elements["MenuPriority"].value;
				

		var FinalBlockContents = LineOne;
		
		for (i = 0; i < MenuText.length; ++i) {
				
			if (MenuText[i] != \'\' && MenuText[i] != \'undefined\') {
				
				FinalBlockContents = FinalBlockContents + \'^^^^\' + MenuText[i] + \'%%%\' + MenuImage[i] + \'%%%\' + MenuCode[i] + \'%%%\' + MenuLink[i] + \'%%%\' + MenuPermissions[i] + \'%%%\' + MenuEnabled[i] + \'%%%\' + MenuPriority[i];
			
			}
		
		}
			
		document.forms["PostForm"].elements["BlockContents"].value = FinalBlockContents;
		document.forms["PostForm"].elements["ReturnToBW"].value = "y";
		document.forms["PostForm"].submit();
	}
	
	}

}
function SaveAsNew() {

	ArrayPosition = MenuText.length;
	
	if (document.forms["PostForm"].elements["MenuText"].value == "") {
	
		alert("'.$MsgText[0][226].'");
	
	}
	else {
	
		MenuText[ArrayPosition] = document.forms["PostForm"].elements["MenuText"].value;
		MenuLink[ArrayPosition] = document.forms["PostForm"].elements["MenuLink"].value;
		MenuCode[ArrayPosition] = document.forms["PostForm"].elements["MenuCode"].value;
		MenuImage[ArrayPosition] = document.forms["PostForm"].elements["MenuImage"].value;
		MenuPermissions[ArrayPosition] = document.forms["PostForm"].elements["MenuPermissions"].value;
		MenuEnabled[ArrayPosition] = document.forms["PostForm"].elements["MenuEnabled"].value;
		MenuPriority[ArrayPosition] = document.forms["PostForm"].elements["MenuPriority"].value;
				

		var FinalBlockContents = LineOne;
		
		for (i = 0; i < MenuText.length; ++i) {
				
			if (MenuText[i] != \'\' && MenuText[i] != \'undefined\') {
				
				FinalBlockContents = FinalBlockContents + \'^^^^\' + MenuText[i] + \'%%%\' + MenuImage[i] + \'%%%\' + MenuCode[i] + \'%%%\' + MenuLink[i] + \'%%%\' + MenuPermissions[i] + \'%%%\' + MenuEnabled[i] + \'%%%\' + MenuPriority[i];
			
			}
		
		}
			
		document.forms["PostForm"].elements["BlockContents"].value = FinalBlockContents;
		document.forms["PostForm"].elements["ReturnToBW"].value = "y";
		document.forms["PostForm"].submit();
	}

}
function DeleteItem(ItemNumber) {

	var ArrayPosition = ItemNumber;

	var ConfirmDelete = confirm("'.$MsgText[0][216].'");
	
	if (ConfirmDelete == true) {
		
		MenuText[ArrayPosition] = "";
		MenuLink[ArrayPosition] = "";
		MenuCode[ArrayPosition] = "";
		MenuImage[ArrayPosition] = "";
		MenuPermissions[ArrayPosition] = "";
		MenuEnabled[ArrayPosition] = "";
		MenuPriority[ArrayPosition] = "";
		
		
		var FinalBlockContents = LineOne;
	
		for (i = 0; i < MenuText.length; ++i) {
			
			if (MenuText[i] != \'\' && MenuText[i] != \'undefined\') {
			
				FinalBlockContents = FinalBlockContents + \'^^^^\' + MenuText[i] + \'%%%\' + MenuImage[i] + \'%%%\' + MenuCode[i] + \'%%%\' + MenuLink[i] + \'%%%\' + MenuPermissions[i] + \'%%%\' + MenuEnabled[i] + \'%%%\' + MenuPriority[i];
			
			}
		
		}
			
		document.forms["PostForm"].elements["BlockContents"].value = FinalBlockContents;
		document.forms["PostForm"].elements["ReturnToBW"].value = "y";
		document.forms["PostForm"].submit();
	
	}

}
function SaveSettings() {

	var FinalBlockContents = document.forms["PostForm"].elements["MenuSpacer"].value + \'%%%\' + document.forms["PostForm"].elements["MenuHeader"].value + \'%%%\' + document.forms["PostForm"].elements["MenuFooter"].value;
		
	for (i = 0; i < MenuText.length; ++i) {
				
		if (MenuText[i] != \'\' && MenuText[i] != \'undefined\') {
				
			FinalBlockContents = FinalBlockContents + \'^^^^\' + MenuText[i] + \'%%%\' + MenuImage[i] + \'%%%\' + MenuCode[i] + \'%%%\' + MenuLink[i] + \'%%%\' + MenuPermissions[i] + \'%%%\' + MenuEnabled[i] + \'%%%\' + MenuPriority[i];
			
		}
		
	}
			
	document.forms["PostForm"].elements["BlockContents"].value = FinalBlockContents;
	document.forms["PostForm"].elements["ReturnToBW"].value = "y";
	document.forms["PostForm"].submit();


}

</script>';


?>
