function SendData(){
}
var httpRequest = null;

SendData.getXMLHTTP = function(){	
	if(window.ActiveXObject){
		try{
			return new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				return new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e1){
				return null;
			}
		}
	}else if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	}else{
		return null;
	}
	
}

SendData.sendRequest = function(url, params,callback, method){

	httpRequest = SendData.getXMLHTTP();

	var httpMethod = method ? method : 'GET';
	if(httpMethod != 'GET' && httpMethod != 'POST'){
		httpMethod = 'GET';
	}
	
	var httpParams = (params == null || params == "") ? null : params
	
	var httpUrl = url;
	if(httpMethod == 'GET' && httpParams != null){
		httpUrl = httpUrl + "?" + httpParams;
	}
	if (httpRequest !=null) {
		
		httpRequest.open(httpMethod, httpUrl, false);
		httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		httpRequest.onreadystatechange = callback;
		httpRequest.send(httpMethod == 'POST' ? httpParams : null);	
	}else{
		alert("Your browser does not support XMLHTTP.");

	}
	
}

function shorten_doResult() {
		
	if( httpRequest.readyState != 4 ) {
			return;
		}
	
	if( httpRequest.status == 200 ) {
	
		var apiurl = 'http://twitter.com/home?status='
		var param = decodeURIComponent(httpRequest.responseText);
		param = param.replace(/\\/g,"").replace(/\s/g, "");	
		
		window.open(apiurl+encodeURIComponent(param) + ' ' + strVal);
	}
	
	
}