//flotantes
function flotante(num,ref,tip,cols,rows,ll,tt){
	this.parteNumero=num;
	this.referencia=ref;
	this.tipo=tip;
	this.colspan=cols;
	this.rowspan=rows;
	this.left=ll;
	this.top=tt;
	this.x;this.y;this.w;this.h;
	this.miTimer;
	this.indice=flotOjetos.length;
	//methods
	this.reubica=fl_reubica;
	this.grabberReubica=fl_greubica;
	this.obtieneValores=fl_obValores;
}
function fl_obValores(){
	eval('tm=dd.elements.wc_parte_'+this.parteNumero);
	if(!tm){
		this.miTimer=window.setTimeout('flotOjetos['+this.indice+'].obtieneValores()',100);
	}else{
		this.x=tm.x;
		this.y=tm.y;
		this.w=tm.w;
		this.h=tm.h;
		eval('tmg=dd.elements.grabber'+this.parteNumero);
		if(tmg){
			tmg.setDraggable(true);
		}
	}
}
function fl_reubica(){
	if(this.referencia!=''){
		eval('dd.elements.wc_parte_'+this.parteNumero+'.moveTo(dd.elements.'+this.referencia+'.x+('+this.left+'),dd.elements.'+this.referencia+'.y+pfr_corr+('+this.top+'))');
	}
}
function fl_greubica(){
       eval('tgm=dd.elements.grabber'+this.parteNumero);
       if(tgm) eval('tgm.moveTo(dd.elements.wc_parte_'+this.parteNumero+'.x,dd.elements.wc_parte_'+this.parteNumero+'.y)');
}
function switchItem(obj,typ,loadid) {
	var el = document.getElementById(obj);
	var elI = document.getElementById("i"+obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
		elI.src='piezas/'+typ+'plus.gif';
	}else{
		el.style.display = '';
		elI.src='piezas/'+typ+'minus.gif';
		if(loadid===''){//nothing
		}else{
			loadSubject(loadid);
		}
	}
}
function loadSubject(subjId){
	new Ajax.Updater('subj_'+subjId, 'subjectMap.php?subjid='+subjId, {asynchronous:true});
}
function showTerm(glosid,glosrand){
	if($('glos_'+glosid+glosrand).style.display=='none'){
		new Ajax.Updater('glos_'+glosid+glosrand,'glossaryGetDefinition.php?glosid='+glosid+'&rand='+glosrand, {asynchronous:true});
		$('glos_'+glosid+glosrand).style.display='';
	}else{
		$('glos_'+glosid+glosrand).style.display='none';
	}
}
function getAnswerToFaq(faqid,faqkey,faqrand){
	if($('faq_'+faqid+faqrand).style.display=='none'){
		new Ajax.Updater('faq_'+faqid+faqrand,'faqGetAnswer.php?faqid='+faqid+'&faqkey='+faqkey+'&rand='+faqrand, {asynchronous:true});
		$('faq_'+faqid+faqrand).style.display='';
	}else{
		$('faq_'+faqid+faqrand).style.display='none';
	}
}
