
dojo.addOnLoad(function () {
	this.counter = 0;
	var _this = this;
	var newtime = 0;
	
	loadCompanyImages();
	
	this.updateTime = function () {
		_this.counter++;
		if (_this.counter < 8) {
			newtime = setTimeout(dojo.hitch(this, "updateTime"), 10000);
		} else {
			_this.counter = 1;
			loadCompanyImages();
			loadCompanyImages1();
			this.updateTime();
		}
	};
	
	this.updateTime();
});

function loadCompanyImages() {
	dojo.xhrGet({url:"servlet/LoadImage", handleAs:"text", content:{mode:"LoadByImages", cols:"4", rows:"2"}, load:function (response) {
		dojo.byId("imageholder").innerHTML = response;
	}, error:function (data) {
		console.error("Error: ", data);
	}});
}

function loadCompanyImages1() {
	dojo.xhrGet({url:"servlet/LoadImage", handleAs:"text", content:{mode:"LoadByImages", cols:"5", rows:"1"}, load:function (response) {
		dojo.byId("imageholder1").innerHTML = response;
	}, error:function (data) {
		console.error("Error: ", data);
	}});
}


function popUp(URL) {
	eval("pageView = window.open(URL, 'pageView', 'toolbar=0,scrollbars=yes,location=1,statusbar=0,menubar=0,resizable=1,width=810,height=600,top=90,left=110'); pageView.focus() ");
}

