
var xmlHttp;
function createXMLHttpRequest()
{
     if(window.ActiveXObject)
     {
         xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
     }
     else if(window.XMLHttpRequest)
     {
         xmlHttp = new XMLHttpRequest();
     }
}

function doSameAjax(method,url,parameter,target,callback)
{
    createXMLHttpRequest();
	var callurl= url+"?ts="+new Date().getTime()+parameter;
    xmlHttp.open(method,callurl);
    xmlHttp.onreadystatechange =function()
	{
		 if(xmlHttp.readyState ==4)
     	 {
			 if(xmlHttp.status ==200)
			 {
				 callback(target,xmlHttp);
			 }
			 else
			 {
				 try{GenInitItem(target,"","loading...."); }catch(e){}
				 try{GenInitItem(target); }catch(e){}
				 try{document.getElementById("loading").style.height = document.getElementById("popup").clientHeight;;document.getElementById("loading").style.display="block";}catch(e){}
				 try{document.getElementById("msgloading").style.height = document.getElementById("eShipMsg").clientHeight;;document.getElementById("msgloading").style.display="block";}catch(e){}
			 }
         }
         else
         {
             try{GenInitItem(target,"","loading...."); }catch(e){}
			 try{GenInitItem(target); }catch(e){}
			 try{document.getElementById("loading").style.height = document.getElementById("popup").clientHeight;document.getElementById("loading").style.display="block";}catch(e){}
			 try{document.getElementById("msgloading").style.height = document.getElementById("eShipMsg").clientHeight;document.getElementById("msgloading").style.display="block";}catch(e){}
         }
	}
    xmlHttp.send(null);
}


    
