function getNewXMLHttp() {
	xmlhttp = null;

    // branch for native XMLHttpRequest object
    if(window.XMLHttpRequest) {
    	try {
			xmlhttp = new XMLHttpRequest();
        } catch(e) {
			xmlhttp = null;
        }
   
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		xmlhttp = null;
        	}
		}
    }
    
    return xmlhttp;
}

function startScrolling() {
	currentNews++;
	if(currentNews >= news.length - 3) currentNews = 0;
	containerWidth = $('news').getSize().x;
	$('the-news').style.display = 'inline';
	$('the-news').innerHTML = news[currentNews];
	$('the-news').style.marginLeft = String(containerWidth + 20) + 'px' ;
	width = $('the-news').getSize().x;
	
	var finalWidth = - width - 20;

//alert(width);

	var d = (containerWidth + width) / 90 * 1000;  
  	
  	var morph = new Fx.Morph( $('the-news'), {
  		duration: d,
  		onComplete: function() {
  			morph.cancel();
  			startScrolling();
  		},
  		transition: Fx.Transitions.linear 
  	} );
 
  	morph.start( { 'marginLeft': finalWidth } );
  	
}

function disclaimer() {
	ajaxDiscApprove = getNewXMLHttp();
	ajaxDiscApprove.open("GET", "/index.php.assets/appdisc.php", true);
	ajaxDiscApprove.send(null);

	var bgMorph = new Fx.Morph( $('disclaimer-bg'), {
  		duration: 1000,
  		onComplete: function() {
  			$('disclaimer-bg').style.display = 'none';
  		},
  		transition: Fx.Transitions.linear
  	} );
  	var discMorph = new Fx.Morph( $('disclaimer'), {
  		duration: 400,
  		onComplete: function() {
  			$('disclaimer').style.display = 'none';
  		},
  		transition: Fx.Transitions.Sine.easeIn
  	} );
  	
  	bgMorph.start( { 'opacity': 0 } );
  	discMorph.start( { 'marginTop': -610 } );
  	
  	return false;
}
