<!--
var http = createRequestObject();


function createRequestObject() {
	var xmlhttp;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(f) {
			xmlhttp = null;
		}
	}
	if (!xmlhttp && typeof XMLHttpRequest != "undefined") {
		xmlhttp = new XMLHttpRequest();
	}
	return  xmlhttp;
}


//===================================================
function getShortURL(longurl)  {
	var ppage = "";
	try {
		ppage = "../shortgen.asp?" + longurl;
		http.open('GET', ppage);
		http.onreadystatechange = handleSURL;
		http.send(null);
		ajax_wait = true;
	}
	catch(e) {}
	finally {}
}


function handleSURL() {
	try {
		if ((http.readyState == 4) && (http.status == 200)) {
			if (http.responseText != "") {
				var d = '<img src="images/be-one-of-us.gif" alt="be one of us @" />'
				d += '<input type="text" class="txt" name="output" value="' + http.responseText + '" />'
				document.getElementById('status').innerHTML = d;
			}
			else {
				document.getElementById('status').innerHTML =  "<p><strong>OOPS: An error occurred. Short URL was not returned.</strong></p>";	
			}
			
		}
	}
	catch(e) {
		document.getElementById('status').innerHTML =  "<p><strong>OOPS: An error occurred. </strong></p>";	
	}
	finally {}
}





