
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>blog</title>
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/iframe.css">
<script type='text/javascript' src='servtools/calendar.js'></script>
	
<script type="text/javascript" charset="utf-8">
parent.guide("poll");	

function $(id_value){
	return document.getElementById(id_value);
}

function initIntro() {
	var introObj = $('intropoll');
	var tipObj = $('addtip');
	if(introObj.style.display == 'none') {
		introObj.style.display = '';
		tipObj.innerHTML = "{echo:lp{pol_hidden_info};/}";
	} else {
		if (($('message').value.length == 0) || (confirm("{echo:lp{pol_a_hidden};/}"))) {
			introObj.style.display = 'none';
			$('message').value = '';
			tipObj.innerHTML = "{echo:lp{pol_add_info};/}";
		}
	}
}

function initReward(status) {
	var rewardObj = $('rewardlist');
	if(status == 1) {
		rewardObj.style.display = '';
	} else {
		rewardObj.style.display = 'none';
		$("credit").value = '';
		$("percredit").value = '';
	}
}

function showMoreOption() {
	$("moreoption").style.display = '';
	$("moretip").style.display = 'none';
}

function check_form(obj){
	var subj=$("subject").value;
	if(subj.length<1||subj.length>80){
		parent.Dialog.alert("{echo:lp{pol_limit_sub};/}");
		return false;
	}
	
	var optionCount = 0;
	var optionObj = document.getElementsByName("option[]");
	for(var i=0;i<optionObj.length;i++) {
		if(optionObj[i].value.replace(/[\s\n\r]/g,"")!="") {
			optionCount++;
		}
	}
	if(optionCount<2) {
		parent.Dialog.alert('{echo:lp{pol_w_option};/}');
		return false;
	}
	
if($("credit").value){
	if(isNaN($("credit").value)){
		parent.Dialog.alert('{echo:lp{pol_award_num};/}');return false;
	}
	if(parseInt($("credit").value)>{echo:$user_info['integral'];/}||parseInt($("credit").value)<1){
		parent.Dialog.alert('{echo:lp{pol_total_range};/}1~{echo:$user_info["integral"];/}');return false;
	}
	if($("percredit").value==''){
		parent.Dialog.alert('{echo:lp{pol_per_range};/}1~'+Math.min(parseInt($("credit").value),10));return false;
	}
	if(isNaN($("percredit").value)){
		parent.Dialog.alert('{echo:lp{pol_award_num};/}');return false;
	}
	if(parseInt($("percredit").value)>10||parseInt($("percredit").value) > parseInt($("credit").value)||parseInt($("percredit").value) < 1){
		parent.Dialog.alert('{echo:lp{pol_per_range};/}1~'+Math.min(parseInt($("credit").value),10));return false;
	}
}
	var makefeed = $("makefeed");
	if(makefeed) {
		if(makefeed.checked == false) {
			return window.confirm('{echo:lp{pol_w_affair};/}');
		}
	}
}
function get_min(){
	if(isNaN($('credit').value)){
		alert('{echo:lp{pol_award_num};/}');
	}else{
		$("m_point").innerHTML="{echo:lp{pol_per_range};/}1~"+Math.min(parseInt($('credit').value),10);
	}
}
</script>
</head>
<body>
  <div class="main_right_title">
     <span class="main_title_dot5"></span>
     <span class="main_title_txt">{echo:lp{pol_title};/}</span>
  </div>
<div id="tabsB">
	<ul>
		<li><a href="?app=poll_mine&m=new" title="{echo:lp{pol_new};/}"><span>{echo:lp{pol_new};/}</span></a></li>
		<li><a href="?app=poll_mine&m=hot" title="{echo:lp{pol_hot};/}"><span>{echo:lp{pol_hot};/}</span></a></li>
		<li><a href="?app=poll_mine&m=reward" title="{echo:lp{pol_reward};/}"><span>{echo:lp{pol_reward};/}</span></a></li>
		<li><a href="?app=poll_mine&m=mine" title="{echo:lp{pol_mine};/}"><span>{echo:lp{pol_mine};/}</span></a></li>
	</ul>
		<div class="div_but" onclick="location.href='?app=poll_send'">{echo:lp{pol_send};/}</div>
</div>
<div class="photo_view_box">
	<div class="photo_view_content">	
	
<form id="addnewpoll" name="addnewpoll" method="post" action="do.php?act=poll_add" onsubmit='return check_form(this);' autocomplete='off'>
<table cellspacing="4" cellpadding="4" width="100%" class="poll_table" style="text-align:left">
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_sub};/}</td>
		<td>
			<input  class="text" type="text" id="subject" name="subject" value="">
			<a id="addtip" href="javascript:;" onclick="initIntro();" onfocus="this.blur();">{echo:lp{pol_add_info};/}</a>
		</td>
	</tr>
	<tr id="intropoll" style="display:none">
		<td style='width:20%;text-align:right'>{echo:lp{pol_more_info};/}</td>
		<td valign="top"><textarea id="message" style="padding: 3px 2px;width:70%;height:50px;" name="message"></textarea> </td>
	</tr>
	<tr><td colspan="2" style="line-height: 8px;">&nbsp;</td></tr>
	<tr><td class="dotted_line" colspan="2">&nbsp;</td></tr>
	{echo:poll_item(1);/}
	<tr>
		<td style='width:20%;text-align:right'></td>
		<td>
			<div><a id="moretip" href="javascript:;" onclick="showMoreOption();" onfocus="this.blur();">{echo:lp{pol_add_m_option};/}</a></div>
		</td>
	</tr>
	<tbody id="moreoption" style="display: none;">
		{echo:poll_item(11);/}
	</tbody>
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_p_option};/}</td>
		<td>
			{echo:poll_select();/}
		</td>
	</tr>
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_over_time};/}</td>
		<td>
			<input class="text" type="text" size="16" id="expiration" readonly name="expiration" value="{echo:date("Y-m-d",time()+60*60*24*30);/}" onclick='getDateString(this,oCalendarChs)' />
		</td>
	</tr>
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_limit};/}</td>
		<td>
			<input type="radio" name="sex" value="2" checked />{echo:lp{pol_no_limit};/}
			<input type="radio" name="sex" value="1" />{echo:lp{pol_man};/}
			<input type="radio" name="sex" value="0" />{echo:lp{pol_woman};/}
		</td>
	</tr>
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_com_limit};/}</td>
		<td>
			<input type="radio" name="noreply" value="0" checked />{echo:lp{pol_no_limit};/}
			<input type="radio" name="noreply" value="1" />{echo:lp{pol_only_fri};/}
		</td>
	</tr>
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_award};/}</td>
		<td>
			<input type="radio" name="reward" value="0" checked onclick="initReward(this.value);" />{echo:lp{pol_no};/}
			<input type="radio" name="reward" value="1" onclick="initReward(this.value);" />{echo:lp{pol_yes};/}
		</td>
	</tr>
	<tbody id="rewardlist" style="display: none;">
		<tr>
			<td style='width:20%;text-align:right'>{echo:lp{pol_a_total};/}</td>
			<td>
				<input type="text" size="5" id="credit" name="credit" value="" maxlength="5" onblur='get_min();'>
				{echo:str_replace("{max_p}",$user_info['integral'],$pol_langpackage->pol_r_point);/}
			</td>
		</tr>
		<tr>
			<td style='width:20%;text-align:right'>{echo:lp{pol_per_award};/}</td>
			<td>
				<input type="text"  size="5" id="percredit" name="percredit" value="" maxlength="5">
				<span id='m_point'></span>
			</td>
		</tr>
	</tbody>
	
	<tr>
		<td style='width:20%;text-align:right'>{echo:lp{pol_aff_o};/}</td>
		<td>
			<input type="checkbox"  name="makefeed" id="makefeed" value="1" checked>{echo:lp{pol_affair};/}
		</td>
	</tr>	<tr><td colspan="2" style="line-height: 8px;">&nbsp;</td></tr>

		<tr><td class="dotted_line" colspan="2">&nbsp;</td></tr>

	<tr>
		<td></td>
		<td>
			<input class="anniu" style="border: 0;" type="submit" name="action" value="{echo:lp{pol_con};/}" />
		</td>
	</tr>
</table>
</form>
    </div></div>
</body>
</html>