function ajaxRequest(method, url, data, callback)
	{
	var ao = new AjaxObject101();
	ao.funcDone=callback;
	ao.sndReq(method,url,data);
	}
	


function GetSpotlight()
	{
	function callback(txt)
		{
		// Add to page
		spotlight = eval("(" + txt + ")");
		document.getElementById('spot_img_visible').src = spotlight.img[0];
		SpotLightAuto();
		}
	ajaxRequest('POST', '/includes/ajax.SpotLight.php', 'action=Next&spotlight=' + spotlight , callback);
	}
	
function SpotLightChange(dir)
	{
	spotlight = spotlight;
	spotlight_position = spotlight_position;
	clearTimeout(autoTimer);
	if(dir == 'next')
		{
		spotlight_position = spotlight_position+1;
		if(spotlight_position > (spotlight.img.length-1)) spotlight_position = 0;
		document.getElementById('spot_img_visible').src = spotlight.img[spotlight_position];
		}
	
	if(dir == 'prev')
		{
		spotlight_position = spotlight_position-1;
		if(spotlight_position < 0) spotlight_position = spotlight.img.length-1;
		document.getElementById('spot_img_visible').src = spotlight.img[spotlight_position];
		}
	}

var autoTimer;
function SpotLightAuto()
	{
	spotlight = spotlight;
	spotlight_position = spotlight_position;
	SpotLightChange('next');
  	autoTimer =  setTimeout("SpotLightAuto()", 3000);
	}

// JavaScript Document
ns4 = document.layers; 
ie = document.all; 
nn6 = document.getElementById && !document.all;
function showBubble(e,html) {
	if (ns4) { 
	     document.recentBubble.left = event.clientX-206; 
	     document.recentBubble.top = event.clientY-75;
		 document.recentBubble.display = "inline";
		 document.recentBubble.visibility = "show";
	} 
	else if (ie) { 
	  	var theleft = (e.clientX - 206 + document.documentElement.scrollLeft);
		var thetop = (e.clientY - 75 + document.documentElement.scrollTop);
		theleft = theleft+230;
		thetop = thetop-0;
		if(document.all['recentBubble'].style.visibility != 'visible') {
			document.getElementById('recentBubble').innerHTML = '<img src="'+html+'" />';
		}
		document.all['recentBubble'].style.display = "inline";
	    document.all['recentBubble'].style.left = theleft; 
	    document.all['recentBubble'].style.top = thetop; 
		document.all['recentBubble'].style.visibility = "visible"; 
	} 
	else if (nn6) { 
	    if (e.pageX || e.pageY) { 
			var theleft = (e.pageX + 20) + "px";
			var thetop = (e.pageY - 75) + "px";
	    } 
	    else if (e.clientX || e.clientY) { 
			var theleft = (e.clientX + 20) + "px";
			var thetop = (e.clientY - 75) + "px";
	    } 
		
		if (document.getElementById('recentBubble').style.visibility != 'visible') {
			document.getElementById('recentBubble').innerHTML = '<img src="'+html+'" />';
		}
		document.getElementById('recentBubble').style.left = theleft;
		document.getElementById('recentBubble').style.top = thetop;
		document.getElementById('recentBubble').style.display = "inline";
	    document.getElementById('recentBubble').style.visibility = "visible";
	} 
}

function hideBubble() {
if (ns4) { 
     document.recentBubble.visibility = "hide"; 
  } 
  else if (ie) { 
     document.all['recentBubble'].style.visibility = "hidden";
  } 
  else if (nn6) { 
     document.getElementById('recentBubble').style.visibility = "hidden"; 
  } 
}
