{stored_object name=$smarty.session.session_id|truncate:10:"" type="comp" from="comp" assign="comp"}

{if $smarty.request.confirmReset}{stored_object name=$smarty.session.session_id|truncate:10:"" type="comp" destroy="true"}{/if}

{include file="shared:layouts/comp_create_navbar.tpl"}

<form method="post" action="index.php">
<input type="hidden" name="pg" value="{toc_next}">
<input type="hidden" name="no_expire" value="true">

<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr>
<td valign="top">
<br>
<table border=0 cellpadding=0 cellspacing=0>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;"><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;">A. Competing for...</td><td><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="p2p" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('p2p');">Pound for pound <i>(Weight lost)</i></a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="pctWt" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('pctWt');">Percent of body weight lost</a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="minEx" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('minEx');">Total minutes exercised</a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="disEx" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('disEx');">Total distance exercised</a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="veg" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('veg');">Vegetable challenge</a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td><td><small><input type="radio" name="comp[type]" id="comp[type]" value="gain" onclick="unBlock('step1_block_B');"> <a href="javascript:setCompType('gain');">Weight gained</a></small></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td></tr>
   <tr><td style="height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;"></td></tr>
</table>
</td>
<td valign="top">
<br>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;"><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif"></td>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;">

B. The competition name is...
</td>
<td><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif"></td>
</tr>
<tr>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td>
<td>

<div onclick="validateDiv(this);" id="step1_block_B" style="margin-top:-1px;margin-left:0px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;">
    <table border=0 cellspacing=0>
    <tr>
      <td><h3>Name:</h3></td>
      <td><input type="text" name="comp[tmp]" id="comp[tmp]" disabled="true" onkeyup="unBlock('step1_block_C');"/></td>
    </tr>
    <tr>
      <td valign="top"><small><b>Examples:</b></small></td>
      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>
    </tr>
    </table>
</div>


    <table border=0 cellspacing=0>
    <tr>
      <td><h3>Name:</h3></td>
      <td><input type="text" name="comp[title]" id="comp[title]" onkeyup="unBlock('step1_block_C');"/></td>
    </tr>
    <tr>
      <td valign="top"><small><b>Examples:</b></small></td>
      <td><small>&quot;The chubby family reunion&quot;<br />&quot;Company shape-up marathon&quot;<br />&quot;Super Summer Slimdown&quot;</small></td>
    </tr>
    </table>

</td>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td>
</tr>
<tr><td style="height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;"></td></tr>
</table>
    <br/>
    <div style="border:solid 1px black;width:94%;height:85px;">
      test
    </div>
</td>
<td valign="top">
<br>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;"><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_left.gif"></td>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table1_header_bg.gif);background-repeat:repeat-x;">

C. Who's competing...
</td>
<td><img src="{$skinFolder}images/ehc/containers/grayTable/table1_header_right2.gif"></td>
</tr>
<tr>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_left.gif);background-repeat:repeat-y;"></td>
<td>

<div onclick="validateDiv(this);" id="step1_block_C" style="margin-top:-1px;margin-left:-10px;border:solid 1px gray;background-color:silver;zIndex:100;position:absolute;filter:alpha(opacity=25);-moz-opacity:0.25;">
    <table border=0 cellpaddin=0 cellspacing=0>
      <tr>
	<td colspan="2">
	   <table border="0" cellpadding="0" cellspacing="0">
	     <tr>
	       <td colspan=2><li style="color:#cccccc">Invate your friends</li></td>
             </tr>
             <tr>
	       <td align="right">
	         <small style="color:#cccccc">
		   My friend's Name:
                 </small>
	       </td>
	       <td>
	         &nbsp;&nbsp;&nbsp;<input type="text id="tmp1" name="temp1" style="width:110px;" disabled />
	       </td>
             </tr>
             <tr>
	       <td align="right">
	         <small style="color:#cccccc">
		   My friend's Email:
	         </small>
	       </td>
	       <td>
	          &nbsp;&nbsp;&nbsp;<input type="text id="tmp1" name="temp1" style="width:110px;" disabled/>
               </td>
             </tr>
             <tr>
	       <td colspan="2" align="right">
	         <small style="color:#cccccc">
		   <span>
                     Add more
                   </span>
                 </small>
	        </td>
             </tr>
	   </table>
	</td>
      </tr>
      <tr><td colspan="2"><li style="color:#cccccc">Let them know with an email...</li></td></tr>
      <tr>
        <td valign="top" colspan=2>
	  <table border="0" cellpadding="0" cellspacing="0">
	      <tr>
		 <td valign="top">
		    <small style="color:#cccccc">
			<table border=0 cellpadding=0 cellspacing=0 width="100%">
			  <tr><td>&nbsp;&nbsp;&nbsp;<input type="radio" value="kind" name="tmp2"/> <span style="color:#cccccc;">Kind Message</span></td></tr>
			  <tr><td>&nbsp;&nbsp;&nbsp;<input type="radio" value="smack" name="tmp2"/> <span style="color:#cccccc;">Trash Talking Message</span></td></tr>
			  <tr><td>&nbsp;&nbsp;&nbsp;<input type="radio" value="challenge" name="tmp2"/> <span style="color:#cccccc;">Motivational Message</span></td></tr>
			  <tr><td>&nbsp;&nbsp;&nbsp;<input type="radio" value="custom" name="tmp2"/> <span style="color:#cccccc;">Make Your Own Message</span></td></tr>
                        </table>
		    </small>
		 </td>
		 <td valign="top" id="invateHolder">
		    <div id="tmp3" style="border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;">
			<small style="color:#cccccc">
			   <a href="javascript:setInviteWeight('heavy');">Heavy</a><br />
			   <a href="javascript:setInviteWeight('medium');">Medium</a><br />
			   <a href="javascript:setInviteWeight('light');">Light</a><br />
			</small>
		    </div>
		</td>
	     </tr>
	  </table>
        </td>
     </tr>
     </table>
</div>

    <table border=0 cellpaddin=0 cellspacing=0>
      <tr>
	<td colspan="2">
	  <div id='enterFriendNameDiv' style='display:block;'>
	   <table border="0" cellpadding="0" cellspacing="0">
	     <tr>
	       <td colspan=2><li>Invate your friends</li></td>
             </tr>
             <tr>
	       <td align="right">
	         <small>
		   My friend's Name:
                 </small>
	       </td>
	       <td>
	         <input type="text id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" />
	       </td>
             </tr>
             <tr>
	       <td align="right">
	         <small>
		   My friend's Email:
	         </small>
	       </td>
	       <td>
		  <input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" />
	       </td>
             </tr>
             <tr>
	       <td colspan="2" align="right">
	         <small>
		   <span onclick="extraCompetitors('open');" style="cursor:pointer;">
                     Add more
                   </span>
                 </small>
	        </td>
             </tr>
	   </table>
	  </div>
	  <div id="myEnteredFriendsDiv" style="display:none;">
	   <table border="0" cellpadding="0" cellspacing="0" width="100%">
	     <tr>
	       <td><li>My Competitors:</li></td>
             </tr>
             <tr>
	       <td align="left" id="competitorListHolder" style="padding-left:15px">
	       </td>
             </tr>
             <tr>
	       <td align="right">
	         <small>
		   <span onclick="editCompetitors();" style="cursor:pointer;">
                     Edit my competitors
                   </span>
                 </small>
	        </td>
             </tr>
	   </table>
	  </div>
	</td>
      </tr>
      <tr><td colspan="2"><li>Let them know with an email...</li></td></tr>
      <tr>
        <td valign="top" colspan=2>
	  <table border="0" cellpadding="0" cellspacing="0">
	      <tr>
		 <td valign="top">
		    <small>
			<table border=0 cellpadding=0 cellspacing=0 width="100%">
			  <tr><td id='kind'><input type="radio" value="kind" name="comp[invite_type]" onclick="setInviteStyle('kind');"/> <a href="javascript:setInviteStyle('kind');">Kind Message</a></td></tr>
			  <tr><td id='smack'><input type="radio" value="smack" name="comp[invite_type]" onclick="setInviteStyle('smack');"/> <a href="javascript:setInviteStyle('smack');">Trash Talking Message</a></td></tr>
			  <tr><td id='challenge'><input type="radio" value="challenge" name="comp[invite_type]" onclick="setInviteStyle('challenge');" /> <a href="javascript:setInviteStyle('challenge');">Challenge</a></td></tr>
			  <tr><td id='custom'><input type="radio" value="custom" name="comp[invite_type]" onclick="setInviteStyle('custom');"/> <a href="javascript:setInviteStyle('custom');">Make Your Own</a></td></tr>
                        </table>
		    </small>
		 </td>
		 <td valign="top" id="invateHolder">
		    <div id="InvateW" style="border-bottom:solid 1px #CCC;border-left:solid 1px #CCC;padding-right:5px;visibility:hidden;">
			<small>
			   <input type="radio" value="heavy" name="comp[invite_subtype]"  onclick="displayLetter('{$vanity}')" /> <a href="javascript:setInviteWeight('heavy');">Heavy</a><br />
			   <input type="radio" value="medium" name="comp[invite_subtype]" onclick="displayLetter('{$vanity}')" /> <a href="javascript:setInviteWeight('medium');">Medium</a><br />
			   <input type="radio" value="light" name="comp[invite_subtype]" onclick="displayLetter('{$vanity}')" /> <a href="javascript:setInviteWeight('light');">Light</a><br />
			</small>
		    </div>
		</td>
	     </tr>
	  </table>
        </td>
     </tr>
     </table>


</td>
<td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_body_right2.gif);background-repeat:repeat-y;"></td>
</tr>
<tr><td style="height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;"></td></tr>
</table>
</td>
<td>
</td>
</tr>
</table>
<br />
<table border="0" cellpadding=0 cellspacing=0 width="100%">
<tr>
<td width="10px" style="background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;"><img src="{$skinFolder}images/ehc/containers/note/topLeftCorner.gif"></td>
<td style="background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;"></td>
<td width="15px" style="background-image:url({$skinFolder}images/ehc/containers/note/top.gif);background-repeat:repeat-x;"><img src="{$skinFolder}images/ehc/containers/note/topRightCorner.gif"></td>
</tr>
<tr>
<td width="10px" style="background-image:url({$skinFolder}images/ehc/containers/note/left.gif);background-repeat:repeat-y;"></td>
   <td>
      <!-- <iframe src="" id="letterHolder" name="letterHolder" style="width:100%;height:410px;" scrollbars="no" frameborder="0"></iframe> -->
      <div id="letterHolder" name="letterHolder" style="width:100%;height:410px;border:solid 1px white;"></div>
   </td>
<td width="10px" style="background-image:url({$skinFolder}images/ehc/containers/note/right.gif);background-repeat:repeat-y;"></td>
</tr>
<tr><td style="height:10px;background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_left.gif);background-repeat:no-repeat;background-position:top left;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_bg.gif);background-repeat:repeat-x;"></td><td style="background-image:url({$skinFolder}images/ehc/containers/grayTable/table_bottom_corner_right.gif);background-repeat:no-repeat;background-position:top left;"></td></tr>
</table>
{* <iframe src="?pg=compCreate/inviteFrame" style="width:100%;height:410px;" scrollbars="no" frameborder="0"></iframe> *}

<div id="invite-div"></div>
<br />

<div align="right">
  <button type="image" src="{$skinFolder}images/btn_next.gif" alt="Next" border="0" />
</div>

<div id="myCompetitors" style="width:300px;background-color:white;zIndex:100;position:absolute;display:none;top:-70px;left:300px;border:solid 1px #CCC;filter: alpha(opacity=85)">
  <center>
   <table border="0" cellpadding="1" cellspacing="0" width="95%">
      <tr><td align="right" valign="top" style="height:5px"><small><span style="cursor:pointer;" onclick="extraCompetitors('close');">close window</span><small></td></tr>
      <tr><td style="border-bottom:solid 1px #CCC;"><h2>More Competitors...</td></tr>
      <tr>
         <td align="center">
	    <table id="competitorsTable" border="0" cellpadding="2" cellspacing="0" width="90%">
                <tr>
		  <td></td>
		  <td align="center" valign="bottom">Name</td>
                  <td align="center" valign="bottom">Email</td>
                </tr>
	        <tr>
		  <td>2.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>3.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>4.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>5.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>6.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>7.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>8.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>9.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>10.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
	        <tr>
		  <td>11.</td>
		  <td><input type="text" id="comp[competitor_name]" name="comp[competitor_name]" style="width:110px;" /></td>
		  <td><input type="text" id="comp[competitor_email]" name="comp[competitor_email]" style="width:110px;" /></td>
		</tr>
		<tr>
		  <td colspan="3" align="right"><small><span style="cursor:pointer;" onclick='addMoreCompetitors();'>Add More Lines</span></small></td>
		</tr>
            </table>
         </td>
      </tr>
      <tr>
	<td align="right" style="border-top:solid 1px #CCC;"><img style="cursor:pointer;" onclick="addingCompetitors();" src="{$skinFolder}images/btn_next.gif" alt="Add" border="0" /></td>
      </tr>
   </table>
  </center>
</div>

</form>

{stored_object_fill_form object=$comp name="comp"}

<script language="javascript" type="text/javascript" src="/js/js-get-data.js"></script>
<script language="javascript" type="text/javascript" src="/js/AJAX.js"></script>
<script language="javascript" type="text/javascript" src="/js/NewComp.js"></script>

<script language="JavaScript">
	
        //jsGetData('?pg=jsGetData','invite-div', 'madlib.form', '&compType=friends&inviteType=smack');

	var examples = Array();
	{foreach from=$examples key="key" item="example"}
	examples[{$key}] = '{eval var=$example.body|addslashes|replace:"\r":""|replace:"\n":"\\n"}';
	{/foreach}
	
	{literal}


	{/literal}
</script>