// JavaScript Document
var objRotate = {
	objMarquee:document.getElementById('mqMoving'),
	
	ajaxUrl:'/ajax_get_moving.php',
	
	getHTTPObject:function(){
		var xmlhttp;
		/*@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;
			}
		}
		return xmlhttp;
	},
	
	initRotate:function(){
		var httpRequest = this.getHTTPObject(); // Create AJAX XMLHttpRequest
		var myRandom=parseInt(Math.random()*99999999);  // Cache Buster
		var loadURL = this.ajaxUrl+'?rand=' + myRandom;
		
		httpRequest.open("GET", loadURL, true);
		__this = this;
		// Set AJAX XMLHttpRequest Response Function
		httpRequest.onreadystatechange = function(){
			if (httpRequest.readyState == 4) { // Finish Loading
				//alert(httpRequest.responseText);
				__this.objMarquee.innerHTML = httpRequest.responseText;
			}
		};
		
		// Send Request
		httpRequest.send(null);
	}
}

objRotate.initRotate();