function createAccount() {	
	sndReq('account-query',true);
	return false;
}

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();


function sndReq(url, affTool, functionCall) {
	if ( typeof(affTool) == 'undefined' ) affTool = false;
	else affTool = affTool;
	if ( typeof(functionCall) == 'undefined' ) functionCall = false;
	else functionCall = functionCall;
    http.onreadystatechange = function() {
    	if(http.readyState == 4){
    		//divUnload();
    		hideSelect();
	        var response = http.responseText;
			if ( affTool ) {
				document.getElementById('ajax').innerHTML = response;
				document.getElementById('ajax').style.display='block';
				if ( document.getElementById('output') != null ) {
	    			document.getElementById('output').style.display='block';
	    		}
	    		else if ( document.getElementById('output2') != null ) {
	    			document.getElementById('output2').style.display='block';
	    		}
	    	}
	        window.scrollTo(0,0);
	        http.onreadystatechange = function(){};
	        http = null;
	        http = createRequestObject();
	        
	        
	        if ( functionCall ) {
	        	for ( var i = 0 ; i < functionCall.length ; i++ ) {
	        		var call = functionCall[i][0]+"("+functionCall[i][1]+");";
	        		setTimeout(call, 200);
	        	}
	        }
	    }
    }
    http.open('get', url, true);
    http.send(null);
}

function hideSelect() {
	var selects = document.getElementsByTagName('select');
	for ( var i = 0 ; i < selects.length ; i++ ) {
		selects[i].style.display='none';
	}
}
