function article_object(){
	this.toggle_id = 1;
	this.toggle_all = 8;
	this.toggle = function(id){
		this.toggle_id = id ? id : parseInt(this.toggle_id);
		this.toggle_all = parseInt(this.toggle_all);
		for (this.tmpid = 1; this.tmpid <= this.toggle_all; this.tmpid++){
			if ($('catetogglec' + this.tmpid) || $('catetogglel' + this.tmpid)){
				if (this.tmpid == this.toggle_id){
					$('catetogglec' + this.tmpid).src = Ajax_prefix + 'images/article/menus_tog_on.gif';
					$('catetogglel' + this.tmpid).style.display = '';
				}else{
					$('catetogglec' + this.tmpid).src = Ajax_prefix + 'images/article/menus_tog_off.gif';
					$('catetogglel' + this.tmpid).style.display = 'none';
				}
			}
		}
	}
	this.vsearch = function(results){
		var theform = document.wane_search;
		if (results){
			this.tmpmsg = '';
			this.focuser = '';
			switch (results){
				case 'words' 	: this.tmpmsg = jslang.search_nowords;	this.focuser = 'keywords';	break;
				case 'datas'	: this.tmpmsg = jslang.search_nodatas;	this.focuser = 'keywords';	break;
			}
			if (this.tmpmsg != ''){
				alert(this.tmpmsg);
			}
			if (this.focuser != ''){
				eval('theform.' + this.focuser + '.focus()');
			}
		}else{
			if (theform.keywords.value == ''){
				this.vsearch('words');
				return false;
			}else{
				theform.Submit.disabled = true;
			}
		}
	}

	this.fontid = function(size,id){
		this.tmpid = id ? id : 'message';
		if (!$(this.tmpid)){
			return false;
		}
		if (!isNaN(size) && size > 0){
			this.sizeid = size;
		}else{
			this.sizeid = 24;
		}
		$(this.tmpid).style.fontSize = this.sizeid + 'px';
	}
	this.replid = 'switcherf';
	this.replyer = function(id,isc){
		if (!$('switchert') || !$('switcherf')){
			return false;
		}
		if (isc){
			$('switchert').style.display = '';
			$('switcherf').style.display = 'none';
		}else{
			if (isNaN(id) || id < 1){
				return false;
			}
			$('switchert').style.display = 'none';
			$('switcherf').style.display = '';
			this.replies(id);
		}
	}
	this.replies = function(id,page){
		Ajax.xml('article&amp;option=replies&amp;info=' + id + '&amp;page=' + page,this.replid);
	}
	this.renumber = function(total){
		if (!$('myreplies')){
			return false;
		}
		if (isNaN(total) || total < 1){
			this.total = 0;
		}else{
			this.total = total;
		}
		 $('myreplies').innerHTML = this.total;
	}
	this.vreply = function(results){
		var theform = document.wane_replies;
		if (results){
			this.tmpmsg = '';
			this.focuser = '';
			switch (results){
				case 'message'	: this.tmpmsg = jslang.reply_nomessage;	this.focuser = 'message';	break;
				case 'certid'	: this.tmpmsg = jslang.reply_certid;	this.focuser = 'certid';	break;
				case 'success'	: this.tmpmsg = jslang.reply_success;								break;
			}
			if (this.tmpmsg != ''){
				alert(this.tmpmsg);
				if (theform.Submit.disabled){
					theform.Submit.value = jslang.reply_submit;
					theform.Submit.disabled = false;
				}
			}
			if (this.focuser != ''){
				eval('theform.' + this.focuser + '.focus()');
			}else{
				eval('theform.reset()');
			}
		}else{
			if (theform.message.value == ''){
				this.vreply('message');
				return false;
			}else if (theform.certid && theform.certid.value == ''){
				this.vreply('certid');
				return false;
			}else{
				theform.Submit.value = jslang.reply_process;
				theform.Submit.disabled = true;
			}
		}
	}
	this.email = function(id,isc){
		if (!$('switchert') || !$('switcherf')){
			return false;
		}
		if (isc){
			$('switchert').style.display = '';
			$('switcherf').style.display = 'none';
		}else{
			if (isNaN(id) || id < 1){
				return false;
			}
			$('switchert').style.display = 'none';
			$('switcherf').style.display = '';
			Ajax.xml('article&amp;option=email&amp;info=' + id,this.replid);
		}
	}
	this.vemail = function(results){
		var theform = document.wane_email;
		if (results){
			this.tmpmsg = '';
			this.focuser = '';
			switch (results){
				case 'unrecer'		: this.tmpmsg = jslang.email_unreceiver;	this.focuser = 'receiver';	break;
				case 'inrecer'		: this.tmpmsg = jslang.email_inreceiver;	this.focuser = 'receiver';	break;
				case 'certid'		: this.tmpmsg = jslang.email_certid;		this.focuser = 'certid';	break;
				case 'success'		: this.tmpmsg = jslang.email_success;									break;
			}
			if (this.tmpmsg != ''){
				alert(this.tmpmsg);
				if (theform.Submit.disabled){
					theform.Submit.value = jslang.email_submit;
					theform.Submit.disabled = false;
				}
			}
			if (this.focuser != ''){
				eval('theform.' + this.focuser + '.focus()');
			}else{
				this.email('',true);
			}
		}else{
			if (theform.receiver.value == ''){
				this.vemail('unrecer');
				return false;
			}else if (theform.certid && theform.certid.value == ''){
				this.vemail('certid');
				return false;
			}else{
				if ($('emailsubject')){
					theform.subject.value = $('emailsubject').innerHTML;
				}
				if ($('emailmessage')){
					theform.message.value = $('emailmessage').innerHTML;
				}
				theform.Submit.value = jslang.email_process;
				theform.Submit.disabled = true;
			}
		}
	}
	this.location = function(url){
		window.location = url;
	}
}
article = new article_object();