// JavaScript Document
function $(id) {return document.getElementById(id)}

function reinitIframe(){
var iframe = document.getElementById("main");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height =  height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 100);

function chk_login(theform)
{
	 if (theform.username.value == "") 
		{
               alert("请填写会员名！");
			   theform.username.focus();
               return false;
         }
	if (theform.password.value =="") 
		{
               alert("请填写密码！");
			   theform.password.focus();
               return false;
         }
   if (theform.code.value =="") 
		{
               alert("请填写验证码！");
			   theform.code.focus();
               return false;
         }
	return true;	 
}
function chk_password(theform)
{
	if (theform.password.value !=theform.mpassword.value) 
		{
               alert("两次输入的密码不同！");
			   theform.password.focus();
               return false;
         }
	return true;	 
}
function chk_reg(theform)
{
	 if (theform.username.value == ""|| theform.username.value.length<2) 
		{
               alert("会员名为空或少于2个字符！");
			   theform.username.focus();
               return false;
         }
	if (theform.password.value ==""||theform.password.value.length<6) 
		{
               alert("密码为空或少于6位！");
			   theform.password.focus();
               return false;
         }
   if (theform.password.value !=theform.mpassword.value) 
		{
               alert("两次输入的密码不同！");
			   theform.password.focus();
               return false;
         }
  if (theform.qq.value =="") 
		{
               alert("请填写qq号！");
			   theform.qq.focus();
               return false;
         }	 
   if (theform.code.value =="") 
		{
               alert("请填写验证码！");
			   theform.code.focus();
               return false;
         }
	return true;	 
}
function chk_mess(theform)
{
	if (theform.content.value =="") 
		{
               alert("请填写内容！");
			   theform.content.focus();
               return false;
         }
	if (theform.code.value =="") 
		{
               alert("请填写验证码！");
			   theform.code.focus();
               return false;
         }
	return true;	 
}
