<!--<?php
print <<<EOT
-->
	<div>
<script language="JavaScript">
function ajaxurl(o) {
	read.obj = o;
	ajax.send(o.href,'',ajax.get);
	return false;
}
setCurrent('q_{$a_key}','q_index','current');
</script>
<!--
EOT;
if (empty($a) || $a == 'own' || $a == 'friend') {print <<<EOT
-->

<!--
EOT;
} elseif ($a == 'album') {
print <<<EOT
-->

<!--
EOT;
} elseif ($a == 'view') {
print <<<EOT
-->

<!--
EOT;
} elseif ($a == 'editphoto') {print <<<EOT
-->

<!--
EOT;
} elseif ($a == 'upload') {
$shortcut=@$_GET['s']?' target=formiframe ':'';
$formiframe=$shortcut?"<iframe src=javascript:; style='display:none;' width=0 height=0 name='formiframe' onload=\"IFRAME_FORM(this)\"></iframe>":"";
if (empty($job)) {

print <<<EOT
-->
		<div class="cc" style="width:100%;height:2000px;background:#FFF;position:absolute;left:0;top:0;">
		<script type="text/javascript">
			if(getObj('upPanel'))
			{
				getObj('upPanel').style.overflow="hidden";
				getObj('upPanel').style.overflowY="hidden";
			}
			function SETTOP ()
			{
				read.menu.style.top="50px";
			}
			function IFRAME_FORM (obj)
			{
				try
				{
					var tds = obj.contentWindow.document.getElementsByTagName('span') || [];
					var tipText = '';
					
					for (var i = 0; i < tds.length; i++)
					{
						if (tds[i].className == 'f14')
						{
							tipText = tds[i].innerHTML.replace(/<.+?>/g, '');
							break;
						}
					}

					if (obj.contentWindow.document.body.innerHTML.indexOf('操作完成') > 0)
					{
						showDialog('success', '上传成功!');
						obj.onload = null;
						SETTOP();
						getObj('uploadPhotoForm').reset();
						parent.location.href="mode.php?m=o&q=photos";
					} else
					{
						showDialog('fail', tipText);
						SETTOP()
					}
				} catch(e)
				{

				}
			}
			</script>
		$formiframe
		<form action="{$basename}a=$a&job=$job" id="uploadPhotoForm" enctype="multipart/form-data" method="post" $shortcut >
		<input type="hidden" name="step" value="3" />
		<input type="hidden" name="verify" value="$verifyhash" />
		<div class="photo-one" style="width:620px;padding:15px;margin:0;">
		<div class="mb10"><span id="allowflash"></span>&nbsp;<span class="gray">(单张照片不得大于{$o_maxfilesize}kb)</span></div>
<!--
EOT;
if ($options) {print <<<EOT
-->
			<div><select name="aid" style="width:200px;" id="aidsel_info" onchange="getallowflash(this.value);">{$options}</select></div>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
print <<<EOT
-->
			<dl class="cc">
				<dt><table><tr><td height="90"><img id="preview_1" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" src="$pwModeImg/90.png"></td></tr></table></dt>
				<dd>
					<input type="file" class="input" name="photo_1" id="p_1" accept="image/*" onchange="preview_img(1);"/> <br />
					<textarea id="pintro_1" name="pintro[1]" style="width:250px;height:40px"></textarea><br /><span id="pintro_1_warn" class="gray">限 255 字节</span>
				</dd>
			</dl>
			<dl class="cc">
				<dt><table><tr><td height="90"><img id="preview_2" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);" src="$pwModeImg/90.png"></td></tr></table></dt>
				<dd>
					<input type="file" class="input" name="photo_2" id="p_2" onchange="preview_img(2);"/> <br />
					<textarea id="pintro_2" name="pintro[2]" style="width:250px;height:40px"></textarea><br /><span id="pintro_1_warn" class="gray">限 255 字节</span>
				</dd>
			</dl>
<!--
EOT;
if ($o_photos_gdcheck) {print <<<EOT
-->
				<div>
					认证码:
<input class="input" type="text" name="gdcode" size="5" tabindex="12" onfocus="try{opencode('menu_gd',this)}catch(e){}" /><span style="cursor:pointer; margin-left:3px" onclick="this.previousSibling.focus();">点此显示验证码</span>
					<div class="menu" id="menu_gd" style="visibility:hidden;">
						<img src="ck.php?" align="absmiddle" style="cursor:pointer;" id="ckcode" alt="看不清楚，换一张" />
					</div>
				</div>
<!--
EOT;
}if($o_photos_qcheck){print <<<EOT
-->
			<div class="mt10">验证问答: {$db_question[$qkey]} （正确答案:{$db_answer[$qkey]}）
			<input class="input" name="qanswer" id="qanswer" size="25" tabindex="7" />
			<input type="hidden" name="qkey" id="qkey" value="$qkey" />	</div>
<!--
EOT;
}print <<<EOT
-->
			<div class="mt10"><span class="button" style="margin-left:0;"><span><button type="submit">开始上传</button></span></span></div>
		</div>
		</form>
		</div>
<script language="JavaScript">
var charset = '$db_charset';
initCheckTextNum('pintro_1','pintro_1_warn',255);
initCheckTextNum('pintro_2','pintro_2_warn',255);
initCheckTextNum('pintro_3','pintro_3_warn',255);
function preview_img(id){
	var photype = getObj('p_'+id);
	var patn = /\.jpg$|\.jpeg$|\.png|\.bmp|\.gif$/i;
	if(patn.test(photype.value)){
		var Preview = getObj('preview_'+id);
		if (is_gecko) {
			Preview.src = photype.files[0].getAsDataURL();
		} else if (is_ie) {
			Preview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = photype.value;
			Preview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").sizingMethod = 'scale';
		}
	} else {
		showDialog('error','您选择的似乎不是图像文件。',2);
	}
}
</script>
<!--
EOT;
} elseif ($job == 'flash') {print<<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
function getallowflash(aid) {
	ajax.send('mode.php?m=o&q=photos&a=getallowflash&aid='+aid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			if (rText[1]) {
				getObj('allowflash').innerHTML = '您还可以上传'+rText[1]+'张照片';
			} else {
				getObj('allowflash').innerHTML = '请选择相册';
			}
		} else {
			ajax.guide();
		}
	});
	return false;
}
window.onload=function()
{
getallowflash(getObj('aidsel_info').value);
};
</script>
<!--
EOT;
} elseif ($a == 'create') {print <<<EOT
-->

<!--
EOT;
}print <<<EOT
-->
<script language="JavaScript">
function ajaxdel(pid) {
	ajax.send('mode.php?m=o&q=photos&a=delphoto&pid='+pid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			window.location = 'mode.php?m=o&q=photos&a=album&aid='+rText[1];
		} else {
			ajax.guide();
		}
	});
	return false;
}
function ajaxSetCover(pid){
	ajax.send('mode.php?m=o&q=photos&a=setcover&pid='+pid,'',function() {
		var rText = ajax.request.responseText.split('\\t');
		if (rText[0] == 'ok') {
			showDialog('succes','设置封面成功!',1);
		} else {
			ajax.guide();
		}
	});
	return false;
}
</script>
</div>
<script language="JavaScript" src="js/global.js"></script>
<script language="JavaScript" src="js/app_global.js"></script>
<style>
html,body{background:#FFF}
</style>
<!--
EOT;
exit;
?>-->
