
var net=new Object();net.READY_STATE_UNINITIALIZED=0;net.READY_STATE_LOADING=1;net.READY_STATE_LOADED=2;net.READY_STATE_INTERACTIVE=3;net.READY_STATE_COMPLETE=4;net.ContentLoader=function(url,onload,onerror,method,params,elementId){if(url.indexOf('?')!=-1){params=url.split('?')[1]+(params?'&'+params:'');url=url.split('?')[0];}
params=(params?params+'&ajax=true':'ajax=true');this.req=null;this.url=url;this.onload=(onload)?onload:this.defaultLoad;this.onerror=(onerror)?onerror:this.defaultError;this.method=method;this.params=params;this.elementId=elementId;this.loadXMLDoc();}
net.ContentLoader.prototype.loadXMLDoc=function(){if(!this.method){this.method="GET";}
if(this.method=="POST"){var contentType='application/x-www-form-urlencoded; charset=UTF-8';}
if(window.XMLHttpRequest){this.req=new XMLHttpRequest();}else if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP");}
if(this.req){try{var loader=this;this.req.onreadystatechange=function(){net.ContentLoader.onReadyState.call(loader);}
this.req.open(this.method,this.url,true);if(contentType){this.req.setRequestHeader('Content-Type',contentType);}
this.req.send(this.params);}catch(err){this.onerror.call(this);}}}
net.ContentLoader.onReadyState=function(){var req=this.req;var ready=req.readyState;if(ready==net.READY_STATE_COMPLETE){var httpStatus=req.status;if(httpStatus==200||httpStatus==0){var resText=this.req.responseText.split(',',1)[0];if(resText=='LOGIN'){isLock=false;popupLogin();return;}
this.onload.call(this);}else{this.onerror.call(this);}}}
net.ContentLoader.prototype.defaultLoad=function(){}
net.ContentLoader.prototype.defaultError=function(){}
