// JavaScript Document


function check_answer(this_form){

	if((this_form.answercontent.value.length == 0) || (this_form.answercontent.value.length > 10000)){
		alert(language["Accounts_answer_invalid_answercontent"]);
		this_form.focus();
		return false;
	}
	if(this_form.answerext.value.length > 200){
		alert(language["Account_answer_invalid_answerext"]);
		this_form.focus();
		return false;
	}
	
}

function check_ask(this_form){

	if((this_form.title.value.length == 0) || (this_form.title.value.length > 240)){
		alert(language["Accounts_ask_title_invalid"]);
		this_form.focus();
		return false;
	}
	if(this_form.content.value.length == 0 || this_form.content.value.length >  20000){
		alert(language["Accounts_ask_content_invalid"]);
		this_form.focus();
		return false;
	}
	if((this_form.select1.value == 0) || (this_form.select1.value == '')){
		alert(language["Accounts_ask_not_select_catalog"]);
		this_form.focus();
		return false;
	}

}

function check_comment(this_form){

	if((this_form.content.value.length == 0) || (this_form.content.value.length > 200)){
		alert(language["Accounts_comment_invalid"]);
		this_form.focus();
		return false;
	}
	
}

function ctlSubmit(event) {	
	if (event.ctrlKey && event.keyCode == 13) {		
	document.add_answer.submit();
	}
}

function ask(opt){
  	document.askq.word.value=opt.word.value;
	document.askq.submit();
}

function srchtype(opt, searchtype){
  	if(opt.word.value.length > 0)	   
	   window.location = "http://www.258.com/search.do?query="+opt.word.value+"&searchType="+searchtype;	  
	else		
		window.location = "http://www.258.com";
}