// JavaScript Document
function ajaxview( myid, myurl){
	//initial
	function GetXmlHttpObject(){
		var xmlHttp=null;
		try{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
		catch (e){
			// Internet Explorer
			try{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e){
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
	}
	//create XmlHttp object
	xmlHttp= GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	} 
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){  		
			document.getElementById(myid).innerHTML = stripslashes(xmlHttp.responseText);
		}else{
			document.getElementById(myid).innerHTML = '<img src="http://localhost:9981/ofst/images/loading.gif" border="0" />';
		}
	}
	xmlHttp.open("GET",myurl,true);
	xmlHttp.send(null);
}
//-------------------------------------------------------------------------------------------
//show correct character.
function addslashes(str){
	str=str.replace(/\'/g,'\\\'');
	str=str.replace(/\"/g,'\\"');
	str=str.replace(/\\/g,'\\\\');
	str=str.replace(/\0/g,'\\0');
	return str;
}
//-------------------------------------------------------------------------------------------
function stripslashes(str){
	str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\\\/g,'\\');
	str=str.replace(/\\0/g,'\0');
	return str;
}
