<!--//--><![CDATA[//><!--

	/* 打开新窗口 */
	function externalLinks(){
		if (!document.getElementsByTagName) return;
		var anchors = document.getElementsByTagName("a");
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
		}
	}
	
	/* flash */
	function flashElement(sName,iWidth,iHeight,imgOn) {
		if (imgOn == 1) {
			document.getElementById('banner').innerHTML = '<img src="' + sName + '" alt="" />';
		} else {
			if (imgOn == 0) {
			     iWidth = 780; // 暂时写死
			     iHeight =280; // 暂时写死
			}
			if (navigator.appName == 'Microsoft Internet Explorer') {
				sStr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + iWidth +'" height="' + iHeight + '">' + 
				       '<param name="movie" value="' + sName + '" />' + 
				       '<param name="quality" value="best" />' +
				       '<embed src="'+ sName + '" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + iWidth +'" height="' + iHeight + '"></embed>' +
				       '<param name="wmode" value="opaque">';	
			} else {
				sStr = '<object type="application/x-shockwave-flash" data="'+ sName + '" width="' + iWidth + '" height="' + iHeight + '">' +
				       '<param name="movie" value="' + sName + '">' +
				       '<param name="wmode" value="transparent">';
			
			}
			sStr += '</object>';
			document.getElementById('banner').innerHTML = sStr;
		}
	}
	
	/* menu */
	function menuFix(j,stylename) {
		var sfEls = document.getElementById("menubar").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover = function() {
				this.className += (this.className.length>0? " ": "") + "sfhover";
				document.getElementById("tm" + j).className = 'shover';
        		}
		        sfEls[i].onMouseDown=function() {
			        this.className+=(this.className.length>0? " ": "") + "sfhover";
		        }
		        sfEls[i].onMouseUp=function() {
			        this.className+=(this.className.length>0? " ": "") + "sfhover";
		        }
		        sfEls[i].onmouseout=function() {
			        this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");
				document.getElementById("tm" + j).className = stylename;
		        }
    		}
	}
	
	function chkLogin() {
		var username = document.getElementById("username");
		var password = document.getElementById("password");
		var code     = document.getElementById("code");
		if (username.value == "") {
			alert("您忘记输入用户名了！");
			username.focus();
			return false;
		}
		if (password.value == "") {
			alert("您忘记输入密码了！");
			password.focus();
			return false;
		}
		if (code.value == "") {
			alert("您忘记输入附加码了！");
			code.focus();
			return false;
		}
		return true;
	}
	
	function getCode(iN) {
		new Ajax.Request("check.php",
				{ method: "get",parameters: "?rand=" + Math.random() + "&img=1",
			  	  onComplete: function(transport) {
				  var a = transport.responseText;
				  $('codeimg' + iN).innerHTML = '<img src="' + a + '" alt="验证码" />';
			  	  }});
	}
	
	LWT = {
		rightImg : '<img src="images/tip/zc_ok.gif" alt="right"  /> ',
		wrongImg : '<img src="images/tip/error.gif" alt="error" /> ',
		loadingImg :'<img src="images/tip/loading.gif" alt="loading" />',
		rightBorder : '0px solid red',
		wrongBorder : '1px solid red',
		strEncode : function(str) {
			return base64encode(utf16to8(str));
		},
		checkuser : function() {
			if ($F('username') == '') {
				$('usernametip').style.border = this.wrongBorder;
				$('usernametip').innerHTML = this.wrongImg +' 用户名不能为空。';
				$('username').focus();
				return false;
			} else {
				if(!new RegExp("^[a-zA-Z0-9\\.\\_\\-]{5,16}$","g").test($F('username'))){
					$('usernametip').style.border = this.wrongBorder;
					$('usernametip').innerHTML = this.wrongImg + ' 对不起，您输入的用户有误，用户名以字母开头，5-16位字母、数字组成！';
					$('username').select();
					return false;
				}
				a = 0;
				$('usernametip').style.border = this.rightBorder;
				$('usernametip').innerHTML = '正在验证是否可用...';
			        new Ajax.Request("check.php",
						{ method: "get",parameters: '?sRand=' + Math.random() + "&username=" + $F('username'),
			  			  onComplete: function(transport) {
						  	var a = transport.responseText;
						  	if (a == 2) {
						  		$('usernametip').style.border = LWT.wrongBorder;
								$('usernametip').innerHTML = LWT.wrongImg + ' 对不起，您输入的用户有误，用户名以字母开头，5-16位字母、数字组成！';
								$('username').select();
						  		return false;
						  	}
						  	if (a == 1) {
								$('usernametip').style.border = LWT.wrongBorder;
								$('usernametip').innerHTML = LWT.wrongImg + ' 对不起，您输入的用户已经存在，请重新输入！';
								$('username').select();
								return false;
							} else {
								$('usernametip').style.border = LWT.rightBorder;
								$('usernametip').innerHTML = LWT.rightImg;
							}
			  			  }
						});
			}
		},
		checkpassword : function() {
			if ($F('password') == '') {
				$('passwordtip').style.border = this.wrongBorder;
				$('passwordtip').innerHTML = this.wrongImg + ' 密码不能为空。';
				return false;
			} else {
				if ($F('password').length < 6 || $F('password').length > 16) {
					$('passwordtip').style.border = this.wrongBorder;
					$('passwordtip').innerHTML = this.wrongImg + ' 密码长度只能6~16位。';
					return false;
				}
				$('passwordtip').style.border = this.rightBorder;
				$('passwordtip').innerHTML = this.rightImg;
			}
		},
		confirmpassword : function() {
			if ($F('confirmpassword') == '') {
				$('confirmpasswordtip').style.border = this.wrongBorder;
				$('confirmpasswordtip').innerHTML = this.wrongImg + ' 确认密码不能为空。';
				return false;
			} else {
				if ($F('confirmpassword') != $F('password')) {
					$('confirmpasswordtip').style.border = this.wrongBorder;
					$('confirmpasswordtip').innerHTML = this.wrongImg + ' 两次输入的密码不一致。';
					return false;
				}
				$('confirmpasswordtip').style.border = this.rightBorder;
				$('confirmpasswordtip').innerHTML = this.rightImg;		
			}
		},
		checkmail : function() {
			if ($F('femail') == '') {
				$('emailtip').style.border = this.wrongBorder;
				$('emailtip').innerHTML = this.wrongImg + ' 电子邮箱不能为空。';
				return false;
			} else {
				if (!new RegExp("^[\\w._]+@\\w+\.(\\w+\.){0,3}\\w{2,4}$","g").test($F('femail'))) {
					$('emailtip').style.border = this.wrongBorder;
					$('emailtip').innerHTML = this.wrongImg + ' 电子邮箱输入不正确!';
					return false;
				}
				a = 0;
				$('emailtip').style.border = this.rightBorder;
				$('emailtip').innerHTML = '正在验证Email ...'
				new Ajax.Request("check.php",
						{ method: "get",parameters: "?sRand=" + Math.random() + "&email=" + $F('femail'),
			  			  onComplete: function(transport) {
						  	var a = transport.responseText;
						  	if (a == 1) {
								$('emailtip').style.border = LWT.wrongBorder;
								$('emailtip').innerHTML = LWT.wrongImg + ' 对不起，您输入的Email已经存在，请重新输入！';
								$('femail').select();
								return false;
							} else {
								$('emailtip').style.border = LWT.rightBorder;
								$('emailtip').innerHTML = LWT.rightImg;
							}
			  			  }
						});
			}
		},
		checkRealName : function() {
			if ($F('realname') == '') {
				$('realnametip').style.border = this.wrongBorder;
				$('realnametip').innerHTML = this.wrongImg + ' 请输入您的真实姓名。';
				return false;
			} else {
				$('realnametip').style.border = this.rightBorder;
				$('realnametip').innerHTML = this.rightImg;
				return true;
			}
		},
		checkAddress : function() {
			if ($F('address') == '') {
				$('addresstip').style.border = this.wrongBorder;
				$('addresstip').innerHTML = this.wrongImg + ' 请输入您的联系地址。';
				return false;
			} else {
				$('addresstip').style.border = this.rightBorder;
				$('addresstip').innerHTML = this.rightImg;
				return true;
			}
		},
		checkPhone : function() {
			if ($F('telephone') == '') {
				$('teltip').style.border = this.wrongBorder;
				$('teltip').innerHTML = this.wrongImg + ' 请输入您的联系电话。';
				return false;
			} else {
				if (!new RegExp("^[\\d\\-\\+]{4,25}$","g").test($F('telephone'))) {
					$('teltip').style.border = this.wrongBorder;
					$('teltip').innerHTML = this.wrongImg + ' 您输入的电话号码不正确，电话格式如：+86-020-88888888-111！';
					return false;
				}
				$('teltip').style.border = this.rightBorder;
				$('teltip').innerHTML = this.rightImg;
				return true;
			}
		},
		checkcode : function() {
			if ($F('code') == '') {
				$('codetip').style.border = this.wrongBorder;
				$('codetip').innerHTML = this.wrongImg + ' 验证码不能为空。';
				return false;
			} else {
				a = 0;
				$('codetip').style.border = '0px solid red';
				$('codetip').innerHTML = '正在验证 ...'
				new Ajax.Request("check.php",
						{ method: "get",parameters: "?rand=" + Math.random() + "&code=" + $F('code'),
			  			  onComplete: function(transport) {
						  	var a = transport.responseText;
						  	if (a == 1) {
								$('codetip').style.border = LWT.wrongBorder;
								$('codetip').innerHTML = LWT.wrongImg + ' 对不起，您输入验证码不正确，请重新输入！';
								return false;
							} else {
								$('codetip').style.border = LWT.rightBorder;
								$('codetip').innerHTML = LWT.rightImg;
								return true;
							}
			  			  }
						});
			}
		},
		showAgreement : function() {
			$('agreement').style.display = 'block';
			$('agreementimg').innerHTML = '<a href="javascript:void(0)" onclick="$(\'agreement\').style.display=\'none\';$(\'checkagreement\').checked = true;$(\'agreementtip\').style.display = \'none\';"><img src="images/agree.gif" alt="接受协议" /></a>' +
						   '<a href="javascript:void(0)" onclick="$(\'agreement\').style.display=\'none\';$(\'checkagreement\').checked = false""><img src="images/disagree.gif" alt="不同意" />';
		},
		checkProduction : function() {
			if ($F('productionname') == '') {
				$('productionnametip').style.border = this.wrongBorder;
				$('productionnametip').innerHTML = this.wrongImg + ' 作品名不能为空！';
				$('productionname').focus();
				return false;
			} else {
				$('productionnametip').style.border = this.rightBorder;
				$('productionnametip').innerHTML = this.rightImg;
			}
		},
		checkinput : function(eName,sMsg) {
			if ($F(eName) == '') {
				$(eName + 'tip').style.border = this.wrongBorder;
				$(eName + 'tip').innerHTML = this.wrongImg + sMsg;
				$(eName).focus();
				return false;
			} else {
				$(eName + 'tip').style.border = this.rightBorder;
				$(eName + 'tip').innerHTML = this.rightImg;
			}
		},
		updateProduction : function(pid) {
			$('productionshow').innerHTML = '<input type="text" id="productionMemo" value="数据加载中..." style="width:550px;" onblur="LWT.updateMemo(\'' + pid + '\');" />';
			new Ajax.Request("update.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
							    "&pid=" + pid + 
							    "&action=true",
			  	            	onComplete: function(transport) {
							var b = transport.responseText;
							b = b.split('|');
							$('productionMemo').value = b[0];
			  	           	}
			  	         });
			$('productionMemo').select();
		},
		updateMemo : function(pid) {
			sPMemo = this.strEncode($F('productionMemo'));
			new Ajax.Request("update.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&pid=" + pid +
				        		    "&newStr=" + sPMemo,
			  	            	onComplete: function(transport) {
							var a = transport.responseText;
							a = a.split('|');
							if (a[1] == 1) {
							    alert('对不起，当前比赛的上传时间已经结束，您不能修改您的作品简介！');
							}
							$('productionshow').innerHTML = a[0];
			  	           	}
			  	         });
		},
		vote : function(userid,pid,eName) {
		    $('vote' + eName).innerHTML = this.loadingImg + ' 投票中...';
		    new Ajax.Request("vote.php",
				    { method: "get",parameters: "?rand=" + Math.random() + 
				              "&userid=" + userid +
				              "&pid=" + pid,
			  	      onComplete: function(transport) {
					          var a = transport.responseText;
					          a = a.split('|');
						  switch(a[0]) {
						  	case '-7':
								alert("对不起，您暂时不能进行投票！");break;
							case '-6':
								alert("您还没登录，请登录后投票！");break;
						  	case '-5':
						  		alert("投票时间还没开始，谢谢您的关注！");break;
						  	case '-4':
						  		alert("投票时间已经结束了，谢谢您的关注！");break;
						  	case '-3':
						  		alert("对不起，您不能对自己投票！");break;
							case '-2':
						  		alert("对不起，您所要投票的用户不存在！");break;
						  	case '-1':
						  		alert("对不起，您已经对该作品投票，谢谢您的投票！");break;
						  	case '0': 
						  		alert("对不起，您投票次数超过比赛限制的 [" + a[2] + "] 张，谢谢您的投票！");break;
							default:
						  		alert('感谢您的投票！');break;
						  }
						  $('vote' + eName).innerHTML = a[1] + ' 票';
			  	      }
				    });
		},
		insertFace : function(imgName) {
			$('commentContent').value = $('commentContent').value + '[img]images/face/' + imgName + '.gif[/img]';
		},
		checkComment : function() {
			if ($('commentContent').value == '') {
				alert('您忘记输入评论啦！');
				$('commentContent').focus();
				return false;
			}
			/*if ($('code').value == '') {
				alert('验证码不能为空！');
				$('code').focus();
				return false;
			}*/
			return true;
		},
		delImg : function(str,url) {
			if (confirm('确认要删除这张图片吗？')) {
				document.location = 'production.php?delimgid=' + str + '&url=' + url;
			}
		},
		blockID : function(msgid,userid,isblock) {
			$('msg' + msgid).innerHTML = this.loadingImg + ' 操作中 ...';
			new Ajax.Request("block.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&msgid=" + msgid +
				        		    "&userid=" + userid +
				        		    "&isblock=" + isblock,
			  	            	onComplete: function(transport) {
							var a = transport.responseText;
							a = a.split('|||');
							switch (a[0]) {
								case '-3':
									alert('您还未登录，请登录后再操作！');break;
								case '-2':
									alert('您不是管理员或评委，无法进行操作！');break;
								case '-1':
									alert('该用户是管理员或评委，不能封ID!');break;
							}
							$('msg' + msgid).innerHTML = a[1];
			  	           	}
			  	         }); 
		},
		chkPwd : function() {
			if ($F('oldpassword') == '') {
				$('oldpwdtip').style.border = this.wrongBorder;
				$('oldpwdtip').innerHTML = this.wrongImg + ' 旧密码不能为空！';
				$('oldpassword').focus();
			} else {
				new Ajax.Request("check.php",
				        	{ 
				        		method: "get",
				        		parameters: "?rand=" + Math.random() +
								    "&oldpwd=" + $F('oldpassword'),
			  	            		onComplete: function(transport) {
								var a = transport.responseText;
								if (a == 0) { 
									$('oldpwdtip').style.border = LWT.rightBorder;
									$('oldpwdtip').innerHTML = LWT.rightImg;
								} else {
									$('oldpwdtip').style.border = LWT.wrongBorder;
									$('oldpwdtip').innerHTML = LWT.wrongImg + ' 旧密码不正确，请重新输入！';
									$('oldpassword').select();
								}
			  	           		}
			  	         	});
			}
		},
		chkChangePwd : function() {
			if ($F('oldpassword') == '') {
				$('oldpwdtip').style.border = this.wrongBorder;
				$('oldpwdtip').innerHTML = this.wrongImg + ' 旧密码不能为空！';
				$('oldpassword').focus();
				return false;
			}
			if ($F('password') == '') {
				$('passwordtip').style.border = this.wrongBorder;
				$('passwordtip').innerHTML = this.wrongImg + ' 新密码不能为空！';
				$('password').focus();
				return false;
			}
			if ($F('confirmpassword') != $F('password')) {
				$('confirmpasswordtip').style.border = this.wrongBorder;
				$('confirmpasswordtip').innerHTML = this.wrongImg + ' 两次输入的密码不一致！';
				$('confirmpassword').select();
				return false;
			}
			if ($F('code') == '') {
				$('codetip').style.border = this.wrongBorder;
				$('codetip').innerHTML = this.wrongImg + ' 验证码不能为空！';
				$('code').focus();
				return false;
			}
			return true;
		},
		hiddenImg : function(id,isHidden) {
			$('himg' + id).innerHTML = this.loadingImg + ' 处理中 ...';
			new Ajax.Request("check.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&isHidden=" + isHidden + 
							    "&imgid=" + id,
			  	        	onComplete: function(transport) {
							var a = transport.responseText;
							a = a.split("|");
							if (a[0] == 0) {
								$('img_' + id).style.filter = 'Gray';
								$('h_' + id).style.display = 'block';
								$('img_' + id).style.margin = '-45px 0 0 0';
							} else {
								$('img_' + id).style.filter = '';
								$('h_' + id).style.display = 'none';
								$('img_' + id).style.margin = 'auto';
							}
							$('himg' + id).innerHTML = a[1];
			  	           	}
			  	         });
		},
		delJudgment : function(userid) {
			$('judgmentgroup').innerHTML = this.loadingImg + ' 正在处理中 。。。';
			new Ajax.Request("check.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&userid=" + userid + 
							    "&matchid=" + $F('matchid'),
			  	        	onComplete: function(transport) {
							var a = transport.responseText;
							$('judgmentgroup').innerHTML = a;
			  	           	}
			  	         });
		},
		unBlockUser : function(userid) {
			$('judgmentgroup').innerHTML = this.loadingImg + ' 正在处理中 。。。';
			new Ajax.Request("check.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&blockuserid=" + userid,
			  	        	onComplete: function(transport) {
							var a = transport.responseText;
							$('judgmentgroup').innerHTML = a;
			  	           	}
			  	         });
		},
		commendProduction : function(str) {
			$('commendproduction').innerHTML = this.loadingImg + ' 处理中...';
			new Ajax.Request("check.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
							    "&productionid=" + str,
			  	        	onComplete: function(transport) {
							var a = transport.responseText;
							$('commendproduction').innerHTML = a;
			  	           	}
			  	         });
		},
		modTitle : function(pid) {
			$('modTitle').innerHTML = '<input type="text" id="productiontitle" value="数据加载中..." style="width:250px;"  onblur="LWT.updateTitle(\'' + pid + '\');" />';
			new Ajax.Request("update.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
							    "&pid=" + pid + 
							    "&action=title",
			  	            	onComplete: function(transport) {
							var b = transport.responseText;
							b = b.split('|');
							$('productiontitle').value = b[0];
			  	           	}
			  	         });
			$('productiontitle').select();
		},
		updateTitle : function(pid) {
			sPMemo = this.strEncode($F('productiontitle'));
			new Ajax.Request("update.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        		    "&pid=" + pid +
				        		    "&newStr2=" + sPMemo,
			  	            	onComplete: function(transport) {
							var a = transport.responseText;
							a = a.split('|');
							if (a[1] == 1) {
							    alert('对不起，当前比赛的上传时间已经结束，您不能修改您的作品简介！');
							}
							$('modTitle').innerHTML = a[0];
			  	           	}
			  	         });
		},
		searchMember : function() {
			//if ($F('membername') != '') {
				sName = this.strEncode($F('membername'));
				$('usergrouplist').innerHTML = this.loadingImg + ' 正在找查 ...';
				new Ajax.Request("check.php",
				        	{ 
				        		method: "get",
				        		parameters: "?rand=" + Math.random() +
				        		    	    "&memberStr=" + sName,
			  	            		onComplete: function(transport) {
								var a = transport.responseText;
								$('usergrouplist').innerHTML = a;
			  	           		}
			  	         	});
			//}
		},
		showMember : function(str) {
			$('udetails').style.display = 'inline';
			$('userdetail').innerHTML = '<div class="mdt">' + this.loadingImg + ' 正在加载[' + str + ']的信息。。。</div>';
			
			sName = this.strEncode(str);
			new Ajax.Request("check.php",
				        { 
				        	method: "get",
				        	parameters: "?rand=" + Math.random() +
				        	    	    "&memberName=" + sName,
			  	        	onComplete: function(transport) {
							var a = transport.responseText;
							$('userdetail').innerHTML = a;
			  	           	}
			  	         });
		}
	}
	
	function checkReg() {
		LWT.checkuser();
		LWT.checkpassword();
		if ($('confirmpassword').value == '') {
				$('confirmpasswordtip').style.border = '1px solid red';
				$('confirmpasswordtip').innerHTML = '<img src="images/tip/error.gif" /> 确认密码不能为空。';
				$('confirmpassword').focus();
				return false;
		}
		if (LWT.checkmail() == false) {
			return false;
		}
		if (LWT.checkcode() == false) {
			return false;
		}
		if ($F('realname') == '') {
			$('realnametip').style.border = LWT.wrongBorder;
			$('realnametip').innerHTML = LWT.wrongImg + ' 请输入您的真实姓名。';
			return false;
		} else {
			$('realnametip').style.border = LWT.rightBorder;
			$('realnametip').innerHTML = LWT.rightImg;
		}
		
		if ($F('address') == '') {
			$('addresstip').style.border = LWT.wrongBorder;
			$('addresstip').innerHTML = LWT.wrongImg + ' 请输入您的联系地址。';
			return false;
		} else {
			$('addresstip').style.border = LWT.rightBorder;
			$('addresstip').innerHTML = LWT.rightImg;
		}
		
		if (LWT.checkPhone() == false) {
			return false;
		}
		
		if ($('checkagreement').checked == false) {
			$('agreementtip').style.display = 'inline';
			$('agreementtip').style.border = '1px solid red';
			$('agreementtip').innerHTML = '<img src="images/tip/error.gif" /> 您还没有接受我们的协议。';
			return false;
		} else {
			$('agreementtip').style.display = 'none';
			$('agreementtip').style.border = '0px solid red';
			$('agreementtip').innerHTML = '';
		}
		return true;
	}
	
	function checkAddMath() {
		LWT.checkinput('matchname','赛事名称不能为空');
		if ($('matchbegin').value == '') {
			alert('请选择输入比赛开始日期');
			$('matchbegin').focus();
			return false;
		}
		if ($('matchend').value == '') {
			alert('请选择输入比赛结束日期');
			$('matchend').focus();
			return false;
		}
		if ($('pollbegin').value == '') {
			alert('请选择输入投票开始日期');
			$('pollbegin').focus();
			return false;
		}
		if ($('pollend').value == '') {
			alert('请选择输入投票结束日期');
			$('pollend').focus();
			return false;
		}
		if ($('orgname').value == '') {
			alert('请输入比赛单位的名称');
			$('orgname').focus();
			return false;
		}
		if ($('hostname').value == '') {
			alert('请输入比赛的域名\n\n如：1.is2is.com');
			$('hostname').focus();
			return false;
		}
		if (($('submit').value == '') && $('file').value == '') {
			alert('请选择要上传的文件');
			$('file').focus();
			return false;
		}
		return true;
	}
	
	function checkaward() {
		if ($('matchid').value == '') {
			alert('请输入选择比赛！');
			$('matchid').focus();
			return false;
		}
		if ($('awardname').value == '') {
			alert('请输入奖品名称！');
			$('awardname').focus();
			return false;
		}
		if ($('file').value == '') {
			alert('请选择您要上传的文件！');
			$('file').focus();
			return false;
		}
		return true;
	}
	
	function checkUpload() {
		if ($('productionname').value == '') {
			$('productionnametip').style.border = LWT.wrongBorder;
			$('productionnametip').innerHTML = LWT.wrongImg + ' 作品名不能为空！';
			$('productionname').focus();
			return false;
		}
		return true;
	}
	
	function addImg(iImgNo) {
		sStr = '';
		for (i=2;i<=iImgNo;i++) {
			sStr += '<p>' + 
		       	        ' <label>选择图片：</label><input type="file" name="file[]" id="file' + i + '" style="width:250px"/> *' +
		                '</p>';
		}
		if (iImgNo > 1) {
			$('imgcontent').innerHTML = sStr;
		} else {
			$('imgcontent').innerHTML = '';
		}
	} 
	
	function delPic(str1,str2) {
		if (confirm('确认要删除 {' + str1 + '} 奖品吗？')) {
			document.location = 'admin.php?Module=award&action=del&str=' + str2;
		} 
	}
	
	function delProduction(id,str,url) {
		if (confirm('警告：\n\t删除此作品，将删除全部投票及评论\n\n\t您确认要删除{' + str + '} 作品吗？')) {
			document.location = 'myproduction.php?delid=' + id +'&oldurl=' + url;
		}
	}
	
	window.onload = externalLinks;
//--><!]]>
