var objImage = {};
function AtamiAdBanner()
{
	this.initialize = function ()
	{
		var thisLocation = 'http://www.atamispa.com/';
		var sPath = new String(location.pathname);
		var firstPath = sPath.split("\/");
		thisLocation += 'ad_banner/index.php?r='+Math.floor(Math.random()*1200/4*1.5);

		var xmlHttp = getXmlHttpObject();
		xmlHttp.open('GET', thisLocation, true);
		xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		xmlHttp.onreadystatechange = function()
		{
			if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
			{
				eval("objImage = ("+xmlHttp.responseText+")");
				var banner = document.getElementById("head_ad");
				var thisLocation = 'http://www.atamispa.com/';
				var img = thisLocation+'ad_banner/m/'+objImage.file;
				var uri = objImage.link;
				var alt = objImage.alt;
				if(typeof(objImage.file) != 'undefined')
				{
					banner.innerHTML = '<a href="'+uri+'"><img src="'+img+'" alt="'+alt+'" /></a>';
				}
				else
				{
					//alert('undefined!!');
					banner.innerHTML = '';
				}
			}
		};
		xmlHttp.send('');
	}
}
