function xmlhttpPostLG(strURL,qstr,type) {	
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepageLG(self.xmlHttpReq.responseText,type);
        }
    }
    self.xmlHttpReq.send(qstr);
	/**/
}
function updatepageLG(str,type){
	switch(type){
		case 'setlang' :
			window.location.reload(true);
			break;
	}
	//alert(str);
}
function setLang(lang){
	//alert(lang);
	var url = 'api/api_lang.php';
	var qstr = 'cmd=setlang&lang='+lang;
	xmlhttpPostLG(url,qstr,'setlang');
	//window.location.reload(true);
}
