//* loadContent
//	address : url to load
//	div : div to update
function loadContent(address,div)
{
	var options = {
		url: address, 	
		method : 'get', 
		update: $(div),
		evalScripts: true,					
		onRequest: function() {	
			$(div).innerHTML='<img src="gfx/loadinfo.gif" width="16px" height="16px" border="0" alt="loading" style="width:16px;height:16px;margin:5px;">';
		},									
		onSuccess: function() {	
		}
	};									
	var monObjetAjax= new Request.HTML(options);
	monObjetAjax.send();
}

function blackloadContent(address,div)
{
	var options = {
		url: address, 	
		method : 'get', 
		update: $(div),
		evalScripts: true,					
		onRequest: function() {	
			$(div).innerHTML='<img src="gfx/blackloadinfo.gif" width="16px" height="16px" border="0" alt="loading" style="width:16px;height:16px;margin:5px;">';
		},									
		onSuccess: function() {	
		}
	};									
	var monObjetAjax= new Request.HTML(options);
	monObjetAjax.send();
}
								
//* randomizer								
function randomizer(){
	
	var options = {
		url: 'onemore.php', 
		method : 'get', 
		evalScripts: true,					
		onSuccess: function(responseTree, responseElements, responseHTML,responseJavaScript) {	
			var el = responseHTML;
			//alert(el);
			$('term').innerHTML = el;
		}
	};
	
	var monObjetAjax= new Request.HTML(options);
	monObjetAjax.send();
}	

//** openClose
	
function openClose(){
	var options = {
				url: 'imageDetails.php?id=' + currentId, 
				method : 'get', 
				update: $('detail'),
				evalScripts: true,					
				onRequest: function() {	
					$('detail').innerHTML='<img src="gfx/loadinfo.gif" width="16px" height="16px" border="0" alt="loading" style="width:16px;height:16px;margin:5px;">';
				},									
				onSuccess: function() {
					imageSlider = new Fx.Slide('detail').hide().toggle();
					$('next_img').innerHTML = '<img src="gfx/up.png" width="17" height="9" border="0" alt="up" />';
					}
				};	
	//alert(imageSlider);
	if(imageSlider == null ||imageSlider == undefined){
		var monObjetAjax= new Request.HTML(options);
		monObjetAjax.send();	
	}else{
		imageSlider.toggle().chain(function(){
			if(imageSlider.open == true){
				 $('next_img').innerHTML = '<img src="gfx/up.png" width="17" height="9" border="0" alt="down" />';
			}else{
				 $('next_img').innerHTML = '<img src="gfx/down.png" width="17" height="9" border="0" alt="down" />';
				}
			});
	}
}


function toggleIt(id)
	{
		var slider = new Fx.Slide(id,{
				duration: 200,
				onComplete: function(){
					/*
					if(this.wrapper.offsetHeight > 5){
						this.wrapper.setStyle('height', 'auto');
					}else{
						this.wrapper.setStyle('height', '0');
					}*/
				}
				}).toggle();
	}