

//fonction qui enleve le onclick de la fleche next si il n'y a pas de prochain item dans le pf
function pfNavigIsNext(nombre){

	//image fleche next
	im=safeFindObj('flechenext');
	if(nombre<=1){ //pas d'item next
		im.onclick=null;
		im.className='';
		
		//eneleve le onload
		im.onload=null;
		
		//change le src de l'image
		imsrc=new String(im.src);
		imsrc=imsrc.replace(/_off/,'_nolink');
		im.src=imsrc;
		return true;
	//sinon, init le hover
	} else {
		initImHov(im);
	}
	
}


function fetchPortfolio(direction, type, categId, itemId, itemNo){
	
	var xmlLoader=new cLoadXsltPortfolio('portfolio', 'main', 10, folderDiv+'/xslt/portfolio.xml');
	
	//ajoute des variables à passer en get
	xmlLoader.addGetVars('type',type);
	xmlLoader.addGetVars('dir',direction);
	xmlLoader.addGetVars('itemno',itemNo);
	xmlLoader.addGetVars('categId',categId);//categorie
	xmlLoader.addGetVars('itemId',itemId);//item a partir duquel on fetch
		
	xmlLoader.start();//load le document
	
}

/* Sous-classe (main classe dans loadXslt)**************************************************************************************/
/* Sous-classe *****************************************************************************************************************/


cLoadXsltPortfolio=function(contId, table, recId, xsltUrl){
	//_debug(xsltUrl);
	xsltUrl+='?i=11';
	this.init(contId, table, recId, xsltUrl)
}
cLoadXsltPortfolio.prototype=new cLoadXslt;
cLoadXsltPortfolio.prototype.start = function(){

	this.showloading();//image de loading
	this.loadXsltXml('main.php',this.table, this.recId, '0');//load le document xml
		

}
cLoadXsltPortfolio.prototype.showloading = function(){
	//trouve le loading
	var dvl=safeFindObj('loading');
	dvl.style.display='block';
	/*//append une image de "loading"
	this.imLoad=document.createElement('img');
	this.imLoad.src=folderDiv + '/img/loading.gif';
	this.imLoad.className='imageLoad';
	this.cont.appendChild(this.imLoad);*/

}
cLoadXsltPortfolio.prototype.apres_parse = function(){

	//trouve le loading
	var dvl=safeFindObj('loading');
	dvl.style.display='none';//le cache

	//remplace l'item de portfolio par le nouveau loadé
	
	var res=this.cont.replaceChild(this.output,this.cont.firstChild);

	
	
}
