var TipActivo=null;
var aacctivo=new Array();


function getParam( name )
{	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null )
		return "";
	else
		return results[1];
}
function toggleTip(e)
{	if(TipActivo!=null)
		TipActivo.fade('out');
	TipActivo=$(e);
	TipActivo.fade('in');
}
function hideTip()
{	TipActivo.fade('out');
	TipActivo=null;
}

function togglejj(){
	this.d.slide('toggle');
	if(this.open==true)
	{
		this.a.setStyle('background-image','url(img/linkr.png)');
		this.open=false;
	}
	else
	{
		this.a.setStyle('background-image','url(img/linkd.png)');
		this.open=true;
	}
}

window.addEvent('domready',function(){
	$$('.divtip').each(function(e){e.fade('hide');});
	s=getParam('art');
	if(s!="")
	{	h=s.split(',');
		StartDiv=h[0];
		StartLinkId=h[1];
	}
	if(typeof(StartDiv)!="undefined")
	{ 
		toggleActivo(StartDiv);
	}
	if(typeof(StartLinkId)!="undefined")
	{
		markItemId(StartLinkId);
		}
	$$('.item').each(function(e){
		dv=e.getElement('div.subitem');
		if(dv){
			dv.set('slide');
			dv.slide('hide');
			}
		aa=e.getElement('a');
		var jj={d:dv,a:aa,open:false};
		aa.addEvent('click',togglejj.bindWithEvent(jj));
	});
});

