<?php
	if( !is_array($active) ){
		ob_clean();
		header("Location: index.php?id=".$fid);	
	}
?>

<?php
		
	$js .= 'var G = new P.Group('.$gid.');';
	
	$tr .= '<tr class="line">
				<td>
					<span class="count">'.$config["POSITIVE_RESULT"].' 票</span>
					<span id="percent-'.$fid.'-A">0%</span>
					<div class="ratio"><span id="option-'.$fid.'-A" style="background:'.rand_color().';" /></div>
				</td>
				<td>
					<span class="count">'.$config["NEGATIVE_RESULT"].' 票</span>
					<span id="percent-'.$fid.'-B">0%</span>
					<div class="ratio"><span id="option-'.$fid.'-B" style="background:'.rand_color().';" /></div>
				</td>
			</tr>
			';
			
	$tr .= '
	<tr class="title">
		<td><strong>'.$config["POSITIVE"].'</strong></td>
		<td><strong>'.$config["NEGATIVE"].'</strong></td>
	</tr>
	';
	
	$js .= 'G.Option("'.$fid.'-A",'.$config["POSITIVE_RESULT"].');';
	$js .= 'G.Option("'.$fid.'-B",'.$config["NEGATIVE_RESULT"].');';
	
	$tr .= '<tr class="line">
				<td>
					<dl id="POSITIVE_BOX"> </dl>
					<div id="POSITIVE_PAGE" class="number">LOADING...</div>
					<script type="text/javascript">getMessage('.$fid.',"POSITIVE","");</script>
				</td>
				<td>
					<dl id="NEGATIVE_BOX"> </dl>
					<div id="NEGATIVE_PAGE" class="number">LOADING...</div>
					<script type="text/javascript">getMessage('.$fid.',"NEGATIVE","");</script>
				</td>
			</tr>
			';
	
	//echo '<fieldset><legend>表单结果</legend>';
	echo '
	<table id="result" border="0" cellpadding="3" cellspacing="1">
		'.$tr.'
	</table>	
	';
	
	/*
	//表单可用
	if($VICACHE["mod.forms"]["status"]){
	
		echo "
		<fieldset id='board' class=\"positive\">
			<legend>".($f_posi_name?$f_posi_name:"左边支持者")."</legend>
			
			<dl id=\"posi-msg\">
				<dt>(~&gt;__&lt;~)</dt>
				<dd>
					<em>还没有支持者</em>
				</dd>
			</dl>
			
			<p id=\"posi-page\"></p>
		</fieldset>
		
		<fieldset id='board' class=\"negative\">
			<legend>".($f_nega_name?$f_nega_name:"右边支持者")."</legend>
			
			<dl id=\"nega-msg\">
				<dt>(~&gt;__&lt;~)</dt>
				<dd>
					<em>还没有支持者</em>
				</dd>
			</dl>
			
			<p id=\"nega-page\"></p>
		</fieldset>
		";
		
	}
	
	*/
	
	//echo '</fieldset>';
	
	/*
	for($i=0; $i<100; $i++){
		echo '<p>&nbsp;</p>';	
	}
	
	echo "<button id='xxxx'>xxxx</button>";
	*/
	
	echo "
	<div id='send'>
		<p>
		<input type='button' class='submit' name='button' onclick='location.href=\"?mode=$mode&id=".$VICACHE["mod.forms"]["id"]."\";' value='返回活动' />
		<input type='button' class='submit' name='button' onclick='window.close();' value='关闭窗口' />
		</p>
	</div>
	";
	
	echo '<script type="text/javascript">var P = new VeryIDE.Process();'.$js.'P.Show();</script>';

?>