// 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(){
		document.getElementById(myid).innerHTML="";
		if(xmlHttp.readyState==4){  		
			document.getElementById(myid).innerHTML = stripslashes(xmlHttp.responseText);
		}else{
			document.getElementById(myid).innerHTML = '<table width="100%"><tr><td align="center"><img src="images/loading.gif" border="0" /></td></tr></table>';
		}
	}
	xmlHttp.open("GET",myurl,true);
	xmlHttp.send(null);

}
//-------------------------------------------------------------------------------------------
function ajaxview1( myid, myurl){
	//initial
	function GetXmlHttpObject1(){
		var xmlHttp1=null;
		try{
			// Firefox, Opera 8.0+, Safari
			xmlHttp1=new XMLHttpRequest();
		}
		catch (e){
			// Internet Explorer
			try{
				xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e){
				xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp1;
	}
	//create XmlHttp object
	xmlHttp1= GetXmlHttpObject1();
	if (xmlHttp1==null){
		alert ("Your browser does not support AJAX!");
		return;
	} 
	xmlHttp1.onreadystatechange=function(){
		document.getElementById(myid).innerHTML="";
		if(xmlHttp1.readyState==4){  		
			document.getElementById(myid).innerHTML = stripslashes(xmlHttp1.responseText);
		}else{
			document.getElementById(myid).innerHTML = '<table width="100%"><tr><td align="center"><img src="images/loading.gif" border="0" /></td></tr></table>';
		}
	}
	xmlHttp1.open("GET",myurl,true);
	xmlHttp1.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;
}
