var xmlhttp
hex=255 // Initial color value.

function fadetext(count_id){
var label = "fadetext('"+count_id+"')"

if(hex>0) { //If color is not black yet
hex-=11; // increase color darkness
document.getElementById(count_id).style.color="rgb("+hex+","+hex+","+hex+")";
setTimeout(label,20); 
}
else
hex=255 //reset hex value
}
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}
function myXMLHttpRequest() {
  var xmlhttplocal;
  try {
    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
    xmlhttplocal=false;
  }
 }

if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
 try {
  var xmlhttplocal = new XMLHttpRequest();
 } catch (e) {
  var xmlhttplocal=false;
  alert('couldn\'t create xmlhttp object');
 }
}
return(xmlhttplocal);
}


function get_image(url) {
	
	if(url != '')
	{

    document.getElementById('main_image').innerHTML = '<img src=images/ani.gif>';
	
    xmlhttp.open('get', 'common/image_resize.php?url='+url);
    xmlhttp.onreadystatechange = handleResponse2;
    xmlhttp.send(null);
	}
	
	
}

function handleResponse2() {
    if(xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){
       	
        var response = xmlhttp.responseText;
        var update = new Array();
		//alert(xmlhttp.responseText);

				changeText2(response);

		}
    }
}

function changeText2(text) {
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0; 
    if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"
	//alert(text)
    if (DOM) {
        var viewer = document.getElementById('main_image')
        viewer.innerHTML=text


    }
    else if(IE) {
         var viewer = document.getElementById('main_image')
        viewer.innerHTML=text


    }
}

