
function CheckUserLogin(Refer)
{
	var PostData = null;
	if (Refer != null )
	{
		PostData = "act=checkuserlogin&refer=" + StrCode(Refer);
		alert(PostData);
		PostRequest(window.location.protocol + "//" + window.location.host + "/ajax_comm.php", PostData);
	}
}

function openWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function validate()
{
	var frm = document.forms['theForm'];
	var username = frm.elements['username'].value;
	var email = frm.elements['email'].value;
	var content = frm.elements['content'].value;
	var grade = 0;
	
	for(var i=0;i<frm.elements['grade'].length; i++)
	{
		if(frm.elements['grade'][i].checked)
		{
			grade = frm.elements['grade'][i].value;
		}
	}
	
	if (username.length == 0)
  {
    alert("Please type the username!");
    return false;
  }
  
	if (email.length == 0)
  {
    alert("Please type the email!");
    return false;
  }
  
	if (email.length == 0)
  {
     var reg = /^[_\+\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,4}$/;
     if (!reg.test(email))
     {
     		alert("Please check the email which you type a incorrect one!");
     		return false;
     }
  }
  
	if (content.length == 0)
  {
    alert("Please type the content");
    return false;
  }
  
    
}

