var loc = window.location.toString();
var ROOT = loc.substring(0,loc.indexOf("/",loc.indexOf("//")+2))+'/news/get/';

//var ROOT = "http://www.bkanen.net/test/wwwnew/news/get/";
var req=null;
var READY_STATE_UNINITIALIZED=0;
var READY_STATE_LOADING=1;
var READY_STATE_LOADED=2;
var READY_STATE_INTERACTIVE=3;
var READY_STATE_COMPLETE=4;

var News ={
	loadXMLDoc: function(url) {
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		if (req) {
			req.onreadystatechange = this.processReqChange;
			req.open("GET", url, true);
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			req.send(null);
		}
	},

	processReqChange: function(){
		var ready=req.readyState;
		var data=null;
		if (ready==READY_STATE_COMPLETE){
			var strRes = req.responseText;
			document.getElementById("newsmenu").innerHTML = strRes;

		}
	},

	get: function (val){
		var url;
		url= ROOT + val + '.html';
		this.loadXMLDoc(url);
	},

	write: function (str){
		document.write(str);
	}
};

function opnews(theURL){
order=window.open(theURL,'','width=580,height=500,toolbar=1,location=0,directories=1,status=0,menubar=1,resizable=1,scrollbars=1');
order.focus();
}; 

