function getXMLHTTP() {
  var result = false;
  if( typeof XMLHttpRequest != "undefined" ) {
    result = new XMLHttpRequest();
  } else {
    try {
        result = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            result = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (ie) {}
    }
  }

  if (typeof netscape != 'undefined' && typeof netscape.security != 'undefined') {
      try {
          netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
      }
      catch (e) {
      	//Do nothing
      }
  }
	return result;
}

		function select_set(id, type) {				
			var url = "change.php?id="+id+"&type="+type;
			XMLHTTP = getXMLHTTP();
			XMLHTTP.open("GET", url, true);
			XMLHTTP.send(null);
		}


function new_itemFirstInCallback(carousel, item, idx, state) {
	stopNews1();
	select_set(idx, 'new');
	$('#1').load('1.php?id='+idx, function () {
		startNews1();
	});
};

function archivio_itemFirstInCallback(carousel, item, idx, state) {
	stopNews2();
	select_set(idx, 'archivio');
	$('#2').load('2.php?id='+idx, function () {
		startNews2();
	});

};
function cooming_itemFirstInCallback(carousel, item, idx, state) {
	stopNews3();
	select_set(idx, 'cooming');
	$('#3').load('3.php?id='+idx, function () {
		startNews3();
	});
};

