
_KCat.prototype.opencat=_KCopencat;
_KCat.prototype.viewport=_KCviewport;
_KCat.prototype.viewobr=_KCviewobr;

_KCat.prototype.viewv2 = _KCviewv2;
_KCat.prototype.openlin=_KCopenlin;
_KCat.prototype.openmysel=_KCopenmysel;
_KCat.prototype.showzoom=_KCshowzoom;
_KCat.prototype.hidezoom=_KChidezoom;
_KCat.prototype.startsug=_KCstartsug;
_KCat.prototype.stopsug=_KCstopsug;
_KCat.prototype.changesug=_KCchangesug;
_KCat.prototype.randomsug=_KCrandomsug;
_KCat.prototype.clicksug=_KCclicksug;

_KCat.prototype.prevpg=_KCprevpg;
_KCat.prototype.nextpg=_KCnextpg;
_KCat.prototype.allpg=_KCallpg;
_KCat.prototype.setv2mode=_KCsetv2mode;
_KCat.prototype.clickFil=_KCclickFil;
_KCat.prototype.closeFil=_KCcloseFil;
_KCat.prototype.clickFind=_KCclickFind;
_KCat.prototype.closeFind=_KCcloseFind;
_KCat.prototype.clickBkColor=_KCclickBkColor;
_KCat.prototype.closeBkColor=_KCcloseBkColor;
_KCat.prototype.setbkcolor=_KCsetbkcolor;
_KCat.prototype.clickmysel=_KCclickmysel;
_KCat.prototype.closePops=_KCclosePops;

_KCat.prototype.fillport=_KCfillport;
_KCat.prototype.changepor=_KCchangepor;

_KCat.prototype.fillosel=_KCfillosel;
_KCat.prototype.oselempty=_KCoselempty;
_KCat.prototype.dofillosel=_KCdofillosel;
_KCat.prototype.dofilloselpila=_KCdofilloselpila;
_KCat.prototype.dofillpila=_KCdofillpila;
_KCat.prototype.pilaover=_KCpilaover;
_KCat.prototype.dofilloselfilm=_KCdofilloselfilm;
_KCat.prototype.fillfilm=_KCfillfilm;
_KCat.prototype.filmplay=_KCfilmplay;
_KCat.prototype.filmstop=_KCfilmstop;
_KCat.prototype.filmprev=_KCfilmprev;
_KCat.prototype.filmnext=_KCfilmnext;
_KCat.prototype.openfullfilm=_KCopenfullfilm;
_KCat.prototype.exitfullfilm=_KCexitfullfilm;
_KCat.prototype.filmtimer=_KCfilmtimer;
_KCat.prototype.filmtmenys=_KCfilmtmenys;
_KCat.prototype.filmtmes=_KCfilmtmes;
_KCat.prototype.fillEfa=_KCfillEfa;

_KCat.prototype.changeMySel=_KCchangeMySel;
_KCat.prototype.addMySel=_KCaddMySel;
_KCat.prototype.delMySel=_KCdelMySel;
_KCat.prototype.ismysel=_KCismysel;
_KCat.prototype.sizeinmsel=_KCsizeinmsel;
_KCat.prototype.packmysel=_KCpackmysel;
_KCat.prototype.updbtnmysel=_KCupdbtnmysel;
_KCat.prototype.addSelList=_KCaddSelList;

_KCat.prototype.paginate=_KCpaginate;
_KCat.prototype.paginateOne=_KCpaginateOne;
_KCat.prototype.doPaginate=_KCdoPaginate;
_KCat.prototype.tryFit=_KCtryFit;
_KCat.prototype.tryFitAt=_KCtryFitAt;

_KCat.prototype.getcat=_KCgetcat;
_KCat.prototype.preloadThumbs=_KCpreloadThumbs;
_KCat.prototype.getObraId=_KCgetObraId;

_KCat.prototype.expandLay=_KCexpandLay;
_KCat.prototype.docXML=_KCdocXML;
_KCat.prototype.getNode=_KCgetNode;

_KCat.prototype.enableBtnPg=_KCenableBtnPg;

_KCat.prototype.filMidChange=_KCfilMidChange;
_KCat.prototype.filColChange=_KCfilColChange;
_KCat.prototype.filApply=_KCfilApply;
_KCat.prototype.clearfilters=_KCclearfilters;

_KCat.prototype.findRef=_KCfindRef;

_KCat.prototype.resize=_KCresize;
_KCat.prototype.preload=_KCpreload;
_KCat.prototype.openInfo=_KCopenInfo;
_KCat.prototype.openEfas=_KCopenEfas;
_KCat.prototype.setLang=_KCsetLang;

function _KCat()
{
	this.xcat = this.docXML();
	this.lins = new Array();
	this.sug = new Object();
	this.sug.l = new Array();
	this.sug.ton = false;
	this.sug.stop = false;
	this.sug.nxcat = 0;
	this.sug.nxref = 0;
	this.sug.pimg = new Image();
	this.osel = new Object();
	this.osel.l = new Array();
	this.osel.used = 0;
	this.mysel = new Object();
	this.mysel.l = new Array();
	this.mysel.used = 0;
	this.mysel.insel = 0;
	this.mysel.visible = false;
	this.lay = new Object();
	this.lay.l = new Array();
	this.lay.used = 0;
	this.btpila = new Array();
	this.film = new Object();
	this.film.ixsel = 0;
	this.film.on = false;
	this.film.ton = false;
	this.film.stop = false;
	this.film.time = 4;
	this.film.pimg = new Image();
	
	this.siz = new Array();
	this.colors = new Array();
	this.fil = new Object();
	this.fil.active = false;
	this.fil.smode = 1;
	this.fil.clmode = 1;
	this.fil.ofer = false;
	this.pl = new Array();

	this.pgcw = 0;
	this.pgch = 0;
	this.minpgcols = 4;
	this.minpgrows = 4;
	this.pgcols = 4;
	this.pgrows = 4;
	this.hsc = hi?132:106;
	this.wsug = hi?278:226;

	this.nlangs = 0;
	this.langPref = "";	
	this.porsel = 0;
	this.actsel = 0;
	this.actview = 0;
	this.v2mode = 1;
	this.inzoom = false;
	this.fullfilm = false;
	this.actlin = 0;
	this.actpage = 1;
	this.obrasshow = 0;
	this.pila = new Object();
	this.pila.imgxrow = 0;
	this.pila.cntimg = 0;
	this.pila.size = 0;
	this.pila.btsel = 0;
	this.pila.ixmidasel = 0;
	this.pila.pilasel = 0;
	this.pila.imgsel = 0;
	this.pila.iximgsel = 0;
	this.ixbkcsel = 0;
	this.bkcsel = '#000';
	this.bkcfont = '#fff';
	this.txvenut = "v";
}

function _KCopencat()
{
	this.T1 = document.getElementById('T1');
	this.T2 = document.getElementById('T2');
	this.T3 = document.getElementById('T3');
	this.T2pages = document.getElementById( "T2pages");
	this.T2zoom = document.getElementById( "T2zoom");
	this.T2pilabt = document.getElementById( "T2pilabt" );
	this.T2sug = document.getElementById( "T2sug");
	this.T2zoomdata = document.getElementById( "T2zoomdata");
	this.T2filmdata = document.getElementById( "T2filmdata");
	this.T2cli = document.getElementById( "T2cli");
	this.T2filt = document.getElementById( "T2filters");
	this.T2find = document.getElementById( "T2find");
	this.T2bkcolor = document.getElementById( "T2bkcolor");
	this.T2zimg = document.getElementById( "T2zimg");
	this.T3img = document.getElementById( "T3img");

	this.preload( 3, 'msel_off' );
	this.preload( 3, 'msel_on' );
	this.preload( 3, 'sc_btns' );
	this.preload( 1, 'wait.gif' );

	this.bthome = new _KBtn('sc_bthome', 'sc', (hi?159:124), 0 );
	this.btinfo = new _KBtn('sc_btinfo', 'sc', (hi?159:124), (hi?72:56) );
	this.btefas = new _KBtn('sc_btefas', 'sc', (hi?209:163), 0 );
	this.btfind = new _KBtn('sc_btfind', 'sc', (hi?209:163), (hi?72:56) );
	this.btfind.ctl._kclick="kcat.clickFind();"
	this.btselcolor = new _KBtn('sc_btselcolor', 'sc', (hi?259:202), (hi?72:56) );
	this.btselcolor.ctl._kclick="kcat.clickBkColor();"
	this.btmsel = new _KBtn('sc_btmsel', 'sc', (hi?259:202), 0, (hi?1:0), (hi?15:10), true );
	this.btmsel.ctl._kclick="kcat.clickmysel(this);"
	this.btpages = new _KBtn('sc_btpages', 'sc', (hi?309:241), (hi?72:56) );
	this.btfilm = new _KBtn('sc_btfilm', 'sc', (hi?375:292), (hi?72:56) );
	this.btstack = new _KBtn('sc_btstack', 'sc', (hi?441:343), (hi?72:56) );
	this.btfiltre = new _KBtn('sc_btfiltre', 'sc', 0, 0 );
	this.btfiltre.ctl._kclick="kcat.clickFil();"
	this.btfiltreout = new _KBtn('sc_btfiltreout', 'sc', (hi?507:394), 0, 0, 0, true );
	this.btpgprev = new _KBtn('sc_btpgprev', 'sc', (hi?309:241), 0 );
	this.btpgnext = new _KBtn('sc_btpgnext', 'sc', (hi?375:292), 0 );
	this.btallpg = new _KBtn('sc_btallpg', 'sc', (hi?441:343), 0);
	this.btallpg.ctl._kclick="kcat.allpg();"
	this.btbkpg = new _KBtn('T2Zbkpg', 'bkpg', 0, 0, (hi?24:19) );
	this.btfmplay = new _KBtn('T2_btfmplay', 'fm', 0, 0 );
	new _KBtn('T2_btfmprev', 'fm', (hi?96:76), 0 );
	new _KBtn('T2_btfmnext', 'fm', (hi?144:114), 0 );
	new _KBtn('T2_btfmfull', 'fmf', 0, 0, (hi?24:19), (hi?40:32) );

	this.getcat();
	this.fillport();
	this.viewport();
	this.btpages.setdown(true);
		
	if( is_ie ) {
		var e;

		e = document.body;
		e.style.filter="progid:DXImageTransform.Microsoft.Fade(duration='1.0', overlap='1.0')";

		this.T2zoom.style.filter="progid:DXImageTransform.Microsoft.Fade(duration='1.0', overlap='1.0')";
		this.T3.style.filter="progid:DXImageTransform.Microsoft.Fade(duration='1.0', overlap='1.0')";

		e = document.getElementById( "T2SImg1" );
		e.style.filter="progid:DXImageTransform.Microsoft.Fade(duration='2.5', overlap='2.5')";
		e = document.getElementById( "T2SImg2" );
		e.style.filter="progid:DXImageTransform.Microsoft.Fade(duration='2.5', overlap='2.5')";
	}

	this.preloadThumbs();
	if( this.sug.l.length ) {
		this.changesug( 1 );
		this.changesug( 2 );
		this.randomsug( true );
	}
	this.resize();
}

function _KCviewport()
{
var t1, t2, db, f;

	t1=this.T1; t2=this.T2;
	if(t1.style.display=='none') {
		db = document.body;
		f = db.filters && db.filters.length ? db.filters.item(0) : null;
		if(f)	f.Apply();
		t1.style.display = '';
		t2.style.display = 'none';
		if(f)	f.Play();
	}

	this.filmstop();
	this.stopsug();	
	this.actview = 1;

	this.btallpg.setdown(false);
}

function _KCviewobr(l)
{
var t1, t2, db, f;

	this.actview = 2;
	this.openlin(l,true);

	t1=this.T1; t2=this.T2;
	if(t2.style.display=='none') {
		db = document.body;
		f = db.filters && db.filters.length ? db.filters.item(0) : null;
		if(f)	f.Apply();
		t2.style.display = '';
		t1.style.display = 'none';
		if(f)	f.Play();
	}
}

function _KCviewv2()
{
var tv,th;

	if( this.inzoom || this.v2mode == 3 ) {
		if( this.inzoom ) {
			this.filmstop();
			this.T2zoomdata.style.display = '';
			this.T2filmdata.style.display = 'none';
		}
		else {
			this.T2zoomdata.style.display = 'none';
			this.T2filmdata.style.display = '';
		}
		this.stopsug();
		this.T2sug.style.display = 'none';
		this.T2zoom.vAlign = (this.inzoom || this.osel.used > 0) ? 'middle' : 'top';
		this.T2zoom.style.display = '';
		this.T2pages.style.display = 'none';
	}
	else {
		this.filmstop();
		this.startsug();
		this.T2zoom.style.display = 'none';
		this.T2pages.style.display = '';
		if( this.v2mode!=2 )	this.T2pilabt.style.display="none";
		this.T2sug.style.display = '';
		this.T2zoomdata.style.display = 'none';
		this.T2filmdata.style.display = 'none';
	}

	this.enableBtnPg();
}

function _KCopenlin(l, clmid)
{
var olin, nl, os, o;

	olin=this.lins[l];
	this.actlin = l;
	this.actpage = 1;
	this.actsel = this.osel;
	this.mysel.visible = false;
	this.packmysel();
	this.updbtnmysel();

	document.getElementById('T2txnomlin').innerHTML = ':: ' + olin.tit + ' ::';

	nl=olin.doc;
	os = this.actsel;
	os.rowsv = this.pgrows;
	if( this.btallpg.isdown() )
		os.rows = 0;
	else
		os.rows = os.rowsv;
	os.cols = this.pgcols;

	this.addSelList( os, nl, false, clmid );
	this.paginate( os );
	this.fillosel(os);

	this.inzoom = false;
	this.viewv2();
}

function _KCopenmysel()
{
	var os, cnt;

	this.actsel = this.mysel;
	os = this.mysel;
	os.visible = true;
	this.updbtnmysel();
	document.getElementById('T2txnomlin').innerHTML = tx_mysel;

	this.actpage = 1;
	os.rowsv = this.osel.rowsv;
	if( this.btallpg.isdown() )
		os.rows = 0;
	else
		os.rows = os.rowsv;
	os.cols = this.osel.cols;

	cnt = os.used;
	while( cnt )
		os.l[--cnt].pg = 0;

	this.paginate( os );
	this.fillosel(os);

	this.inzoom = false;
	this.viewv2();
}

function _KCshowzoom(id)
{
var n, s, i, nt, of, f;

	n = this.getObraId(id);

	this.T2zimg.src = pimgweb+'wait.gif';
	this.T2zimg.style.display='';
	f = ( this.T2zoom.filters && this.T2zoom.filters.length ? this.T2zoom.filters.item(0) : null );
	if(f)	f.Apply();
	this.T2zimg.src = pimgcat+n.getAttribute('ref')+'.jpg';
	if(f)	f.Play();

	s = '<b>' + ( n.childNodes.length > 0 ? n.childNodes[0].data : "" ) + '<br>';
	s += n.getAttribute('mides') + '</b><br>';
	nt = this.getNode( this.xcat, '/cataleg/tecniques/tec['+n.getAttribute('tec')+']/'+this.langPref );
	if( nt && nt.childNodes.length > 0 )
		s += '<em>[ ' + nt.childNodes[0].data + ' ]</em><br>';
	s += '<img id="T2Zmysel" style="vertical-align:text-bottom; margin-top:12px; margin-right:6px;" src="'+pimgcomp+'msel_';
	if( this.ismysel(n) )	s += 'on.png" title="'+tx_delsel+'"';
	else	s += 'off.png" title="'+tx_addsel+'"';
	s += ' class="T2Zgomet" onclick="kcat.changeMySel(event,'+n.getAttribute('id')+')" />';
	s += '<b>' + n.getAttribute('ref');
	if( n.getAttribute('ve') )
		s += this.txvenut;
	s += '</b><br>';
	i = n.getAttribute('pv');
	if( i.length ) {
		of = n.getAttribute('of');
		s += '<div style="height:26px;margin-top:'+(of>0?6:11)+'px;"><b>';
		s += i + ' &euro;</b>';
		s += ' <em>' + tx_impreu + '</em>';
		if( of > 0 ) {
			s += '<img style="margin-left:12px;vertical-align:middle" src="'+pimgcomp+'bg_of.png" />';
			s += '<span style="position:relative; left:-50px; color:#000;"><b>-' + of + '%</b></span>';
		}
		s += '</div>';
	}
	
	document.getElementById( "T2Zdata" ).innerHTML = s;
	
	this.fillEfa( n.getAttribute('efa'), 'T2Zefa' );

	this.inzoom = true;
	this.viewv2();
}

function _KChidezoom()
{
	if( this.inzoom ) {
		this.inzoom = false;
		this.viewv2();
	}
}

function _KCstartsug()
{
	if( !this.sug.ton )	window.setTimeout( "kcat.changesug(0);", 6150 );
	this.sug.ton = true;
	this.sug.stop = false;
}

function _KCstopsug()
{
	if( this.sug.ton )	this.sug.stop = true;
}

function _KCchangesug( imgix )
{
var st, i, cnt, nl, cat, nom, ix, img, f, btime;

	sg = this.sug;
	if( sg.stop ) {
		sg.ton = false;
		return;
	}

	if( sg.l.length ) {
		btime = imgix == 0;
		if( imgix < 1 )
			imgix = 1 + parseInt( ( Math.random() * 2 ) % 2 );
		else
			this.randomsug( false );

		if( sg.nxref ) {
			nom = sg.nxcat.getAttribute('nom');
			img = document.getElementById( "T2SImg"+imgix);
			f = (btime && img.filters && img.filters.length) ? img.filters.item(0) : null;
			if(f)	f.Apply();
			img.src = '../'+nom+'/'+pimgsug+sg.nxref.getAttribute('ref')+'.jpg';
			img._cat = nom;
			img._ref = sg.nxref.getAttribute('ref');
			if(f)	f.Play();
		}

		if(btime) {
			this.randomsug( true );
			window.setTimeout( "kcat.changesug(0);", 6150 );
		}
	}
}

function _KCrandomsug(prel)
{
var sg, cnt, cat, ix;

	sg = this.sug;
	cat = sg.l.length;
	if( cat > 1 )
		cat = 1 + parseInt( ( Math.random() * cat ) % cat );
	
	sg.nxcat = sg.l[cat-1]
	cnt = sg.nxcat.childNodes.length;
	if( cnt > 0 ) {
		ix = parseInt( ( Math.random() * cnt ) % cnt );
		sg.nxref = sg.nxcat.childNodes[ix];
		if(prel)	sg.pimg.src = '../'+sg.nxcat.getAttribute('nom')+'/'+pimgsug+sg.nxref.getAttribute('ref')+'.jpg';
	}
	else {
		sg.nxcat = 0;
		sg.nxref = 0;
	}
}

function _KCclicksug( btn )
{
	if( btn._cat.length && btn._ref.length ) {
		var url;
		url = '../' + btn._cat + '/index.html';
		open(url, '_blank', 'location=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes');
	}
}

function _KCprevpg()
{
	if( this.actpage > 1 ) {
		this.actpage--;
		this.fillosel(this.actsel);
	}
}

function _KCnextpg()
{
	if( this.actpage < this.actsel.pg ) {
		this.actpage++;
		this.fillosel(this.actsel);
	}
}

function _KCallpg()
{
var os, i, cnt;

	if( !this.btallpg.ctl.disabled ) {
		os = this.actsel;
		if( this.btallpg.isdown() )
			os.rows = 0;
		else
			os.rows = os.rowsv;

		cnt = os.l.length;
		for( i = 0; i < cnt; i++ )
			o = os.l[i].pg = 0;

		this.actpage=1;
		this.paginate( os );
		this.fillosel(os);

		this.inzoom = false;
		this.viewv2();
	}
}

function _KCsetv2mode(m)
{
	if( this.v2mode != m ) {
		var b;
		
		if( this.v2mode == 3 )	b = this.btfilm;
		else if( this.v2mode == 2 )	b = this.btstack;
		else b = this.btpages;
		b.setdown( false );
		
		this.v2mode = m;
		if( this.v2mode == 3 )	b = this.btfilm;
		else if( this.v2mode == 2 )	b = this.btstack;
		else b = this.btpages;
		b.setdown( true );

		this.actpage = 1;
		this.fillosel(this.actsel);
	}
	this.inzoom = false;
	this.viewv2();
}

function _KCclickFil(ev)
{
var e = this.T2filt, f, sz, cl, i, cnt, ef, ret;

	if( e.style.display!='block' ) {
		this.closePops();

		f = this.fil;
		if( f.smode == 2 ) {
			ef = document.getElementById('T2Fssel');
			sz = this.siz;
			cnt = sz.length;
			for( i = 0; i < cnt; i++ )
				document.getElementById('T2Fchsiz'+i).checked = sz[i].issel;
		}
		else if( f.smode == 3 ) {
			ef = document.getElementById('T2Fsrange');
			document.getElementById('T2Fhfrom').value = f.hfrom;
			document.getElementById('T2Fhto').value = f.hto;
			document.getElementById('T2Fwfrom').value = f.wfrom;
			document.getElementById('T2Fwto').value = f.wto;
		}
		else
			ef = document.getElementById('T2Fstots')

		ef.checked = true;

		if( f.clmode == 2 ) {
			document.getElementById('T2Fcsel').checked = true;
			cl = this.colors;
			cnt = cl.length;
			for( i = 0; i < cnt; i++ )
				document.getElementById('T2Fchcol'+i).checked = cl[i].issel;
		}
		else
			document.getElementById('T2Fctots').checked = true;
		
		document.getElementById('T2Fofer').checked = f.ofer;

		e.style.left = ((document.body.offsetWidth - 494 ) / 2) + 'px';
		e.style.display='block';
		ef.focus();
		this.filMidChange(f.smode);
		this.filColChange(f.clmode);
		ret = true;
	}
	else {
		this.closeFil();
		ret = false;
	}
	return ret;
}

function _KCcloseFil()
{
var f = this.T2filt;

	if( f.style.display!='none' ) {
		f.style.display='none';
		this.btfiltre.setdown(false);
	}
}

function _KCclickFind(e)
{
var f = this.T2find, ret;

	if( f.style.display!='block' ) {
		this.closePops();
		f.style.display='block';
		f.style.left = document.getElementById( "T2cfind" ).offsetLeft + this.btfind.ctl.offsetLeft + 'px';
		document.getElementById('T2FNref' ).focus();
		ret = true;
	}
	else {
		this.closeFind();
		ret = false;
	}
	return ret;
}

function _KCcloseFind()
{
var f = this.T2find;

	if( f.style.display!='none' ) {
		f.style.display='none';
		this.btfind.setdown(false);
	}
}

function _KCclickBkColor(e)
{
var p = this.T2bkcolor, ret;

	if( p.style.display!='block' ) {
		this.closePops();
		
		p.style.display='block';
		p.style.left = document.getElementById( "T2cfind" ).offsetLeft + this.btselcolor.ctl.offsetLeft + 'px';
		ret = true;
	}
	else {
		this.closeBkColor();
		ret = false;
	}
	return ret;
}

function _KCcloseBkColor()
{
var p = this.T2bkcolor;

	if( p.style.display!='none' ) {
		p.style.display='none';
		this.btselcolor.setdown(false);
	}
}

function _KCsetbkcolor( c, cf, ix )
{
	var i, cnt = this.obrasshow;

	this.closeBkColor();
	this.T2.style.backgroundColor = c;
	this.T3.style.backgroundColor = c;

	document.getElementById( 'T2bkc' + this.ixbkcsel ).style.backgroundColor = '#000';
	document.getElementById( 'T2bkd' + this.ixbkcsel ).style.backgroundColor = this.bkcsel;

	this.bkcsel = c;
	this.bkcfont = cf;
	this.ixbkcsel = ix;
	document.getElementById( 'T2bkc' + ix ).style.backgroundColor = '#fff';
	document.getElementById( 'T2bkd' + this.ixbkcsel ).style.backgroundColor = '#000';

	if( this.v2mode == 1 ) {
		for( i = 1; i <= cnt; i++ ) {
			document.getElementById( 'limg'+i ).style.borderColor=this.bkcfont;
			document.getElementById( 'dimg'+i ).style.color=this.bkcfont;
		}
	}
	else if( this.v2mode == 2 ) {
		for( i = 0; i < cnt; i++ ) {
			document.getElementById( 'pimg'+i ).style.borderColor=this.bkcfont;
			document.getElementById( 'pimg'+i+'dat' ).style.color=this.bkcfont;
		}
	}

	this.T2zimg.style.borderColor=this.bkcfont;
	this.T3img.style.borderColor=this.bkcfont;
}

function _KCclickmysel(bt)
{
	if( !bt.disabled ) {
		if( !this.mysel.visible )	this.openmysel();
		else	this.openlin( this.actlin, true );
	}
}

function _KCclosePops()
{
	this.closeFil();
	this.closeFind();
	this.closeBkColor();
}

function _KCfillport()
{
var n, nl, lin, i, cnt, s, ts;

	nl=this.xcat.documentElement.childNodes[1];
	s = tx_update+' ' + nl.getAttribute("act");
	document.getElementById("T1data").innerHTML = s;
	document.getElementById("SCdata").innerHTML = s;

	s = '<div align="left" style="width:'+nl.getAttribute(hi?'htw':'ltw')+'px;cursor:default;">';
	ts = nl.getAttribute(hi?'ht':'lt');
	cnt=nl.childNodes.length;
	for( i=0; i<cnt; i++ ) {
		n = nl.childNodes[i];
		lin = this.lins[i];
		s += '<img id="T1thumb'+i+'" class="T1img" src="'+pthumbs+n.getAttribute(hi?'thi':'tlo')+'.jpg"';
		s += ' width="'+ts+'" height="'+ts+'"';
		s += ' onmouseover="kcat.changepor('+i+',\''+n.getAttribute(hi?'tzhi':'tzlo')+'\');"';
		s += ' onclick="kcat.viewobr('+i+');" />';
	}
	s += '</div>';
	
	document.getElementById('T1thumbs').innerHTML = s;

	this.changepor(0, nl.childNodes[0].getAttribute(hi?'tzhi':'tzlo'));
}

function _KCchangepor(l,ref)
{
	var img, lin;

	lin = this.lins[l];
	document.getElementById('T1nomlin').innerHTML = ':: ' + lin.tit.toUpperCase() + ' ::';

	img = document.getElementById('T1thumb' + l);
	if( this.porsel )
		this.porsel.className = 'T1img';
	
	this.porsel = img;
	this.porsel.className = 'T1imgsel';

	img = document.getElementById('T1zoom');
	img.src = pthumbs+ref+'.jpg';
}

function _KCfillosel(os)
{
	this.film.ixsel = 0;
	if( os.used < 1 )	this.oselempty();
	else {
		if( this.v2mode == 3 )
			this.dofilloselfilm(os);
		else if( this.v2mode == 2 )
			this.dofilloselpila(os);
		else
			this.dofillosel(os);
	}
}

function _KCoselempty()
{
	var e, s;

	s = '<br><br><span class="T2NoObra">'+tx_nopics+'</span>';
	if( this.v2mode == 3 ) {
		e = document.getElementById('T2zmsg');
		e.innerHTML = s;
		e.style.display = '';
		this.T2zimg.style.display='none';
		this.filmstop();
		document.getElementById( "T2fmdata" ).innerHTML = '';
		document.getElementById( 'T2fmpos' ).innerHTML = '';
		document.getElementById( 'T2fmefa' ).innerHTML = '';
	}
	else {
		document.getElementById( 'T2numpg' ).style.visibility='hidden';
		if( this.v2mode==2 )	this.T2pilabt.style.display="none";
		this.T2cli.innerHTML = s;
		this.actpage = 0;
		this.enableBtnPg();
	}
}

function _KCdofillosel(os)
{
var n,i,cnt,cells,c,r,id,s,cellA,allpg,img,smd;

	cells = os.cols * os.rows;

	cellA = new Array();
	for( i=0; i<cells; i++ )
		cellA.push("");

	allpg = this.btallpg.isdown();

	id = 1;
	cnt=os.used;
	for( i=0; i<cnt; i++ ) {
		o = os.l[i];
		if( o.pg == this.actpage ) {
			s = '<td';

			if( allpg || o.row == 0 ) s += ' valign="top"';
			else if( o.row+o.uh == os.rows )	s += ' valign="bottom"';
			else	s += ' valign="middle"';

			if( o.col == 0 ) s += ' align="left"';
			else if( o.col+o.uw == os.cols )	s += ' align="right"';
			else	s += ' align="center"';
			
			if( o.uw > 1 )	s += ' colspan="'+o.uw+'"';
			if( o.uh > 1 )	s += ' rowspan="'+o.uh+'"';

			s += '>';

			n = o.n;

			s += '<div id="dimg'+id+'" class="T2Obra" style="width:' + ( o.sz.pxw + 2 ) + 'px;height:' + ( o.sz.pxh + 17 ) + 'px;overflow:hidden;color:'+this.bkcfont+';">';
			s += '<img id="limg'+id+'" src="'+pthumbs+n.getAttribute('ref')+'.jpg" title="'+tx_hzoom+'"';
			s += ' style="border:1px solid '+this.bkcfont+';cursor:pointer;margin-bottom:1px;' 
			s += '" onclick="kcat.showzoom('+n.getAttribute('id')+');" />';

			s += '<label id="lms'+n.getAttribute('id')+'" style="cursor:pointer;" title="';
			if( this.ismysel(n) )	s += tx_delsel;
			else	s += tx_addsel;
			s += '" onclick="kcat.changeMySel(event,'+n.getAttribute('id')+')">';

			s += '<img id="ims'+n.getAttribute('id')+'" src="'+pimgcomp+'msel_';
			if( this.ismysel(n) )	s += 'on.png';	else	s += 'off.png';
			s += '" class="T2gomet" style="float:left;" />';
			s += '<span style="float:left;margin-top:1px;">'+n.getAttribute('ref');
			if( n.getAttribute('ve') )
				s += this.txvenut;
			s += '</span></label>';

			smd = n.getAttribute('mides');
			smd = smd.substring(0,smd.length-2);
			s += '<span style="float:right;margin-top:1px;">'+smd+'</span>';
			
			s += "</td>";

			for(r=o.row;r<o.row+o.uh;r++)
				for(c=o.col;c<o.col+o.uw;c++)
					cellA[(r*os.cols)+c]='x';
			cellA[(o.row*os.cols)+o.col]=s;
			
			id++;
		}			
	}

	this.obrasshow = id-1;

	s = '<table cellpadding="'+(hi?10:8)+'" cellspacing="0" align="center" width="'+(1+(this.pgcols*this.pgcw))+'" style="table-layout:fixed;">';

	s += '<colgroup><col width="1" /><col span="'+os.cols+'" width="'+this.pgcw+'" /></colgroup>';

	r = 0;
	for( i=0; i<cells; i++ ) {
		if( i%os.cols == 0 ) {
			if(i>0) s+= '</tr>';
			s += '<tr><td height="'+this.pgch+'">&nbsp;</td>';
			r++;
		}

		if( cellA[i] == 'x' )	continue;
		if( cellA[i].length > 0 )
			s += cellA[i];
		else
			s += '<td>&nbsp;</td>';
	}

	if(i>0) s+= '</tr>';
	s+= '</table>';

	document.getElementById( 'T2numpg' ).style.visibility='visible';
	if( this.btallpg.isdown() )
		document.getElementById( 'T2numpg' ).innerHTML = tx_allpg;
	else
		document.getElementById( 'T2numpg' ).innerHTML = tx_page+' '+this.actpage +' '+tx_de+' ' + os.pg;

	this.T2cli.innerHTML = s;
	this.enableBtnPg();
}

function _KCdofilloselpila(os)
{
var s, sz, ix, i, cnt, szo, bt;

	sz = this.siz;
	ix = -1;
	this.T2pilabt.style.display="";

	cnt = sz.length;
	for(i=0; i<cnt; i++) {
		szo = sz[i];
		bt = this.btpila[i];
		if( ( this.mysel == os && this.sizeinmsel(szo) ) || ( this.mysel != os && szo.hasobra ) ) {
			bt.ctl.style.display = 'block';
			if( ix == -1 )	ix = i;
		}
		else bt.ctl.style.display = 'none';
	}
	
	s = '<div id="T2clipila" align="left" style="margin-left: 11px;"></div>';
	this.T2cli.innerHTML = s;

	document.getElementById( 'T2numpg' ).style.visibility='hidden';
	this.dofillpila( ix, 0 );
}

function _KCdofillpila(ix,iximg)
{
var os, s, id, i, cnt, o, n, maxw;

	if( this.pila.btsel )	this.pila.btsel.setdown(false);
	this.pila.btsel = this.btpila[ix];
	this.pila.btsel.setdown(true);

	os = this.actsel;
	this.pila.size = this.siz[ix];
	this.pila.ixmidasel = ix;
	this.pila.pilasel = 0;
	s = '<div>';
	id = 0;
	cnt=os.used;
	maxw = parseInt(( 1 + ( this.pgcw * this.pgcols ) - this.pila.size.pxw ) / 24);
	this.pila.imgxrow = maxw;

	for( i=0; i<cnt; i++ ) {
		o = os.l[i];
		n = o.n;
		if( n.getAttribute('cm') == ix ) {
			if(id && id%maxw == 0 ) s += '</div><div style="clear:both;">';

			s += '<div style="float:left;margin:1px;">';

			s += '<img id="pimg'+id+'" style="border:1px solid '+this.bkcfont+';cursor:pointer;width:20px;height:20px;"';
			s += ' src="'+pthumbs+n.getAttribute('ref')+'.jpg' + '"';
			s += ' onmousemove="kcat.pilaover(\''+id+'\')"';
			s += ' onclick="kcat.showzoom('+n.getAttribute('id')+');" />';

			s += '<div id="pimg'+id+'dat" class="T2Obra" style="display:none;color:'+this.bkcfont+';margin-bottom:8px;">';
			s += '<label id="lms'+n.getAttribute('id')+'" style="cursor:pointer;" title="';
			if( this.ismysel(n) )	s += tx_delsel;
			else	s += tx_addsel;
			s += '" onclick="kcat.changeMySel(event,'+n.getAttribute('id')+')">';

			s += '<img id="ims'+n.getAttribute('id')+'" src="'+pimgcomp+'msel_';
			if( this.ismysel(n) )	s += 'on.png';	else	s += 'off.png';
			s += '" class="T2gomet" style="vertical-align:text-bottom;" />';
			s += n.getAttribute('ref');
			if( n.getAttribute('ve') )
				s += this.txvenut;
			s += '</label></div>';

			s += '</div>';
			id++;
		}
	}
	s += "</div>";
	this.obrasshow = id;

	document.getElementById( 'T2clipila' ).innerHTML = s;

	this.pila.cntimg = id;
	this.pila.imgsel = 0;
	this.pila.pilasel = 999;
	this.pilaover( iximg );
}

function _KCpilaover(id)
{
var i,cnt,pil,npila,minh,pt,img;

	pil = this.pila;

	minh = parseInt( pil.size.pxh / 2 );
	if( minh<60 )	minh=60;
	pt = parseInt( ( pil.size.pxh - minh ) / 2 );

	if( pil.imgsel ) {
		img = pil.imgsel;
		img.style.width = '20px';
		img.style.height = minh + 'px';
		img.style.marginTop = pt + 'px';
		document.getElementById( img.id + 'dat' ).style.display="none";
	}

	npila = parseInt( id / pil.imgxrow );
	if( npila != pil.pilasel ) {
		i = pil.pilasel * pil.imgxrow;
		cnt = i + pil.imgxrow;
		if( cnt > pil.cntimg )	cnt = pil.cntimg;
		for( ; i < cnt; i++ ) {
			img = document.getElementById( 'pimg'+i );
			img.style.height = '20px';
			img.style.marginTop = '0px';
		}
	
		pil.pilasel = npila;
		i = pil.pilasel * pil.imgxrow;
		cnt = i + pil.imgxrow;
		if( cnt > pil.cntimg )	cnt = pil.cntimg;
		for( ; i < cnt; i++ ) {
			img = document.getElementById( 'pimg'+i );
			img.style.height = minh + 'px';
			img.style.marginTop = pt + 'px';
		}

	}

	img = document.getElementById( 'pimg'+id );
	img.style.width = pil.size.pxw + 'px';
	img.style.height = pil.size.pxh + 'px';
	img.style.marginTop = '0px';
	pil.imgsel = img;
	document.getElementById( 'pimg'+id+'dat' ).style.display="block";
	this.pila.iximgsel = id;
}

function _KCdofilloselfilm(os)
{
	this.T2zimg.src = pimgweb+'wait.gif';
	this.T2zimg.style.display='';
	this.fillfilm();
	if( !this.film.on )	this.filmplay();
}

function _KCfillfilm()
{
var f,n,s,img,nt,flt,ix;

	f = this.film;
	s = (f.ixsel+1) + ' '+tx_de+' ' + this.actsel.used;
	document.getElementById( 'T2fmpos' ).innerHTML = s;

	n = this.actsel.l[f.ixsel].n;
	s = '<b>' + ( n.childNodes.length > 0 ? n.childNodes[0].data : "" ) + '<br>';
	s += n.getAttribute('mides') + '</b><br>';
	nt = this.getNode( this.xcat, '/cataleg/tecniques/tec['+n.getAttribute('tec')+']/'+this.langPref );
	if( nt && nt.childNodes.length > 0 )
		s += '<em>[ ' + nt.childNodes[0].data + ' ]</em><br>';
	s += '<img id="T2fmmysel" style="vertical-align:text-bottom; margin-top:'+(hi?12:8)+'px; margin-right:6px;" src="'+pimgcomp+'msel_';
	if( this.ismysel(n) )	s += 'on.png" title="'+tx_delsel+'"';
	else	s += 'off.png" title="'+tx_addsel+'"';
	s += ' class="T2Zgomet" onclick="kcat.changeMySel(event,'+n.getAttribute('id')+')" />';
	s += '<b>' + n.getAttribute('ref');
	if( n.getAttribute('ve') )
		s += this.txvenut;
	s += '</b><br>';
	i = n.getAttribute('pv');
	if( i.length ) {
		of = n.getAttribute('of');
		s += '<div style="'+(of>0?'height:26px;':'')+'margin-top:'+(of>0?(hi?6:0):(hi?11:6))+'px;"><b>';
		s += i + ' &euro;</b>';
		s += ' <em>' + tx_impreu + '</em>';
		if( of > 0 ) {
			s += '<img style="margin-left:12px;vertical-align:middle" src="'+pimgcomp+'bg_of.png" />';
			s += '<span style="position:relative; left:-50px; color:#000;"><b>-' + of + '%</b></span>';
		}
		s += '</div>';
	}
	s += '</b>';

	document.getElementById( "T2fmdata" ).innerHTML = s;
	this.fillEfa( n.getAttribute('efa'), 'T2fmefa' );

	if( this.fullfilm ) {
		img = this.T3img;
		flt = ( this.T3.filters && this.T3.filters.length ? this.T3.filters.item(0) : null );
	}
	else {
		img = this.T2zimg;
		flt = ( this.T2zoom.filters && this.T2zoom.filters.length ? this.T2zoom.filters.item(0) : null );
	}

	if(flt)	flt.Apply();
	img.src = pimgcat+n.getAttribute('ref')+'.jpg';
	if(flt)	flt.Play();

	ix = ( f.ixsel < this.actsel.used-1 ) ? f.ixsel+1 : 0;
	this.film.pimg.src = pimgcat+this.actsel.l[ix].n.getAttribute('ref')+'.jpg';
}

function _KCfilmplay()
{
	if( this.actsel.used > 0 ) {
		var f = this.film;
		
		if( f.on )
			this.filmstop();
		else {
			if( f.ton )	f.stop = false;
			else {
				this.fillfilm();
				f.ton = true;
				window.setTimeout( "kcat.filmtimer();", f.time * 1000 );
			}
			f.on = true;
			this.btfmplay.ctl._l = (hi?48:38);
			SetBtnBgImage(this.btfmplay.ctl,0);
			document.getElementById('T2_btfmback').style.backgroundPosition = '0px -'+(hi?64:51)+'px';
		}
	}
}

function _KCfilmstop()
{
	var f = this.film;

	if( f.ton )	f.stop = true;
	f.on = false;
	this.btfmplay.ctl._l = 0;
	SetBtnBgImage(this.btfmplay.ctl,0);
	document.getElementById('T2_btfmback').style.backgroundPosition = '0px 0px';
}

function _KCfilmprev()
{
	if( this.actsel.used > 0 ) {
		var f = this.film;

		if( f.ixsel > 0 )	f.ixsel--;
		else	f.ixsel = this.actsel.used-1;
		this.fillfilm();
	}
}

function _KCfilmnext()
{
	if( this.actsel.used > 0 ) {
		var f = this.film;

		if( f.ixsel < this.actsel.used-1 )	f.ixsel++;
		else	f.ixsel = 0;
		this.fillfilm();
	}
}

function _KCopenfullfilm()
{
	if( this.actsel.used > 0 ) {
		this.T2.style.display = 'none';
		this.T3.style.display = '';
		this.fullfilm = true;
		this.T3img.src = this.T2zimg.src;

		if( !this.film.on )
			this.filmplay();
	}
}

function _KCexitfullfilm()
{
	this.T2.style.display = '';
	this.T3.style.display = 'none';
	this.fullfilm = false;
	this.T2zimg.src = this.T3img.src;
}

function _KCfilmtimer()
{
var f = this.film;

	if( f.stop ) {
		f.stop = false;
		f.ton = false;
	}
	else {
		this.filmnext();
		window.setTimeout( "kcat.filmtimer();", f.time * 1000 );
	}
}

function _KCfilmtmenys()
{
var f = this.film;

	if( f.time > 1 ) {
		f.time--;
		document.getElementById('T2fmtime').innerHTML = f.time;
	}
}

function _KCfilmtmes()
{
var f = this.film;

	if( f.time < 10 ) {
		f.time++;
		document.getElementById('T2fmtime').innerHTML = f.time;
	}
}

function _KCfillEfa( id, e )
{
	var n, nc, s, ss, buf;

	try{
		n = this.getNode( this.xcat, "/cataleg/efas/efa[@id='" + id + "']" );
		if( n ) {
			nc = n.childNodes[0];
			s = "<b>" + (nc.childNodes.length > 0 ? nc.childNodes[0].data : "") + "</b>";
			nc = n.childNodes[1];
			ss = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			if( ss.length ) s += '<br>'+ss;
			nc = n.childNodes[2];
			ss = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			nc = n.childNodes[3];
			buf = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			if( ss.length || buf.length ) s += '<br>';
			if( ss.length )	s += ss + ' ';
			s += buf;
			nc = n.childNodes[4];
			ss = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			if( ss.length ) s += '<br>'+tx_tel+' ' + ss;
			nc = n.childNodes[5];
			ss = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			if( ss.length ) s += '<br>'+tx_fax+' ' + ss;
			nc = n.childNodes[6];
			ss = (nc.childNodes.length > 0 ? nc.childNodes[0].data : "");
			if( ss.length ) s += '<br>'+ss;

			document.getElementById( e ).innerHTML = s;
		}
	}
	catch(e){}
}

function _KCchangeMySel(e,id)
{
var n, sel, lms, ims, zims;

	n = this.getObraId(id);
	sel = !this.ismysel(n);

	if( this.v2mode == 1 || this.v2mode == 2 ) {
		lms = document.getElementById( "lms"+id );
		ims = document.getElementById( "ims"+id );
	}
	else { lms = 0; ims = 0; }
	
	if( this.inzoom )
		zims = document.getElementById( "T2Zmysel" );
	else if( this.v2mode == 3 )
		zims = document.getElementById( "T2fmmysel" );
	else zims = 0;

	if( sel ) {
		this.addMySel(n);
		if( ims ) {
			ims.src = pimgcomp+'msel_on.png';
			lms.title = tx_delsel;
		}
		if( zims ) {
			zims.src = pimgcomp+'msel_on.png';
			zims.title = tx_delsel;
		}
	}
	else {
		this.delMySel(n);
		if( ims ) {
			ims.src = pimgcomp+'msel_off.png';
			lms.title = tx_addsel;
		}
		if( zims ) {
			zims.src = pimgcomp+'msel_off.png';
			zims.title = tx_addsel;
		}
	}

	document.getElementById('sc_btmseltx').innerHTML = this.mysel.insel;
	this.updbtnmysel();

	CancelEvent(e);
}

function _KCaddMySel(n)
{
var i, cnt, u, ms, o, sz, szo, found, s;

	ms = this.mysel;
	sz = this.siz;
	found = false;
	cnt = ms.l.length;
	for( i = 0; !found && i < cnt; i++ )
		if( ms.l[i].n == n ) {
			if( ms.l[i].del ) {
				ms.l[i].del = false;
				ms.insel++;
			}
			found=true;
		}

	if( !found ) {	
		u = ms.used + 1;
		while( ms.l.length < u )
			ms.l.push( new Object() );

		szo = sz[parseInt(n.getAttribute('cm'))];

		o = ms.l[ms.used];
		o.n = n;
		o.pg = 0;
		o.sz = szo;
		o.uh = szo.uh;
		o.uw = szo.uw;
		o.del = false;

		ms.used++;
		ms.insel++;
	}
}

function _KCdelMySel(n)
{
var i, cnt, ms;

	ms = this.mysel;
	cnt = ms.l.length;
	for( i = 0; i < cnt; i++ )
		if( ms.l[i].n == n ) {
			if( ms.visible )
				ms.l[i].del = true;
			else {
				ms.l.splice( i, 1 );
				ms.used--;
			}
			ms.insel--;
			break;
		}
}

function _KCismysel( n )
{
var i, cnt, ms, ret;

	ret = false;
	ms = this.mysel;
	cnt = ms.l.length;
	for( i = 0; i < cnt; i++ )
		if( ms.l[i].n == n ) {
			if( !ms.l[i].del )
				ret=true;
			break;
		}

	return ret;
}

function _KCsizeinmsel( szo )
{
var i, cnt, ms, ret;

	ret = false;
	ms = this.mysel;
	cnt = ms.l.length;
	for( i = 0; !ret && i < cnt; i++ )
		if( ms.l[i].sz == szo )
			ret=true;

	return ret;
}

function _KCpackmysel()
{
var cnt, ms;

	ms = this.mysel;
	cnt = ms.l.length;
	while(cnt--)
		if( ms.l[cnt].del ) {
			ms.l.splice( cnt, 1 );
			ms.used--;
		}
}

function _KCupdbtnmysel()
{
var ms, bt, st;

	ms = this.mysel;
	st = ms.visible ? 1 : ( ms.used > 0 ? 0 : -1 );
	this.btmsel.disable( st == -1 );
	document.getElementById('sc_btmseltx').style.visibility = st==-1 ? 'hidden' : 'visible';
	if( st != -1 )
		this.btmsel.setdown( st );

	this.btmsel.ctl.title = st == 1 ? tx_hclosesel : tx_hopensel;
}

function _KCaddSelList( os, nl, append, clmid )
{
var i, cnt, u, n, o, f, sz, szo, cl, clo, ok;

	if(!append) os.used=0;

	f = this.fil;
	sz = this.siz;
	cnt = sz.length;
	for( i = 0; i < cnt; i++ ) {
		szo = sz[i];
		if(clmid)	szo.inlin = false;
		szo.hasobra = false;
	}
	cl = this.colors;
	cnt = cl.length;
	for( i = 0; i < cnt; i++ ) {
		clo = cl[i];
		if(clmid)	clo.inlin = false;
		clo.hasobra = false;
	}

	cnt = nl.childNodes.length;
	u = os.used + cnt;
	while( os.l.length < u )
		os.l.push( new Object() );

	for( i = 0; i < cnt; i++ ) {
		n = nl.childNodes[i];
		szo = sz[parseInt(n.getAttribute('cm'))];
		clo = this.colors.length ? cl[parseInt(n.getAttribute('cl'))] : 0;

		if( f.smode == 3 )
			ok = ( szo.h >= f.hfrom && ( !f.hto || szo.h <= f.hto ) && szo.w >= f.wfrom && ( !f.wto || szo.w <= f.wto ) );
		else if( f.smode == 2 )
			ok = szo.issel;
		else
			ok = true;

		if( ok && f.clmode == 2 )	ok = clo.issel;

		if( ok && f.ofer && n.getAttribute('of') == null )
			ok = false;

		if( ok ) {
			o = os.l[os.used];
			o.n = n;
			o.pg = 0;
			o.sz = szo;
			o.uh = szo.uh;
			o.uw = szo.uw;

			os.used++;
			szo.hasobra = true;
		}

		szo.inlin = true;
		if(clo)	clo.inlin = true;
	}
}

function _KCpaginate( os )
{
var o,i,cnt,minr,minc,cuw,cu;

	minr = 0; minc = 0; cuw = 0; cu = 0;
	cnt=os.used;
	for(i=0; i<cnt; i++) {
		o = os.l[i];
		cu += o.uh*o.uw;
		if(o.uh>minr)	minr=o.uh;
		if(o.uw>minc)	minc=o.uw;
		cuw+=o.uw;
		o.pg = 0;
	}

	if( os.cols > cuw )	os.cols = cuw;
	if( os.cols < minc ) os.cols = minc;

	if( !os.rows ) {
		os.rows = parseInt( cu / os.cols );
		if( cu%os.cols )	os.rows++;
		if( os.rows < minr )	os.rows = minr;
		this.paginateOne( os );
	}
	else {
		if( os.rows < minr ) {
			os.rows = minr;
			os.rowsv = minr;
		}
		this.doPaginate( os );
	}
}

function _KCpaginateOne( os )
{
var lay,o,i,cnt;

	lay = this.lay;	
	cnt = os.cols * os.rows;
	this.expandLay( lay, cnt, true );

	cnt=os.used;
	for(i=0; i<cnt; i++) {
		o = os.l[i];
		if( !this.tryFit( lay, o, 1, os.cols, os.rows ) ) {
			i--;
			os.rows++;
			this.expandLay( lay, lay.used+os.cols, false );
		}
	}
	os.pg = 1;
}

function _KCdoPaginate( os )
{
var lay, i, cnt, cells, pg, allinPage, emptyc, o;

	lay = this.lay;	
	cells = os.cols * os.rows;
	cnt = os.used;

	os.pg = 0;
	allInPage = false;
	pg = 1;
	while( !allInPage ) {
		allInPage = true;
		this.expandLay( lay, cells, true );
		emptyc = cells;

		for(i=0; i<cnt; i++) {
			o = os.l[i];
			if( !o.pg ) {
				if( this.tryFit( lay, o, pg, os.cols, os.rows ) ) {
					emptyc -= ( o.uh * o.uw );
					if(os.pg < pg) os.pg = pg;
				}
				else
					allInPage = false;

				if( emptyc < 1 ) {
					if( i < cnt-1 )	allInPage = false;
					break;
				}
			}
		}
		pg++;
	}
}


function _KCtryFit( lay, o, pg, cols, rows )
{
var i,cnt,c,ret=false;

	cnt=lay.used;
	for( i=0; !ret && i<cnt; i++ ) {
		if( lay.l[i].ix == null )
			ret = this.tryFitAt( lay, i, o, pg, cols, rows );
	}
	
	return ret;
}

function _KCtryFitAt( lay, pos, o, pg, cols, rows )
{
var col, row, r, c, ret, ol;

	ret = false;
	col = pos % cols;
	row = parseInt( pos / cols );

	if( col + o.uw <= cols && row + o.uh <= rows ) {
		ret = true;
		for( r = row; ret && r < row + o.uh; r++ ) {
			for( c = col; ret && c < col + o.uw; c++ ) {
				if( lay.l[(r*cols)+c].ix != null )
					ret = false;
			}
		}
	}

	if( ret ) {
		o.col = col;
		o.row = row;
		o.pg = pg;
		
		for( r = row; r < row + o.uh; r++ ) {
			for( c = col; c < col + o.uw; c++ ) {
				ol = lay.l[(r*cols)+c];
				ol.ix = o;
				ol.e = true;
			}
		}
		lay.l[(row*cols)+col].e=false;
	}
		
	return ret;
}

function _KCgetcat()
{
var i, cnt, nl, nlin, n, sz, cl, o, id, ic, cc, cf, s1, s2, s3, cm1, cm2, cm3, sbt, va, vas;

	nl=this.xcat.documentElement.childNodes[1];

	if( hi ) {
		this.pgcw = parseInt( nl.getAttribute('hw') );
		this.pgch = parseInt( nl.getAttribute('hh') );
	}
	else {
		this.pgcw = parseInt( nl.getAttribute('lw') );
		this.pgch = parseInt( nl.getAttribute('lh') );
	}

	id = 0;
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ ) {
		nlin=nl.childNodes[i];
		nlin.setAttribute('id', i );
		o=new Object();
		n = nlin.childNodes[0];
		o.tit=n.childNodes.length > 0 ? n.childNodes[0].data : "";
		o.doc=nlin.childNodes[1];
		this.lins.push(o);
		cc = o.doc.childNodes.length;
		for( ic = 0; ic < cc; ic++ )
			o.doc.childNodes[ic].setAttribute( 'id', id++ );
	}

	sz = this.siz;
	nl=this.xcat.documentElement.childNodes[2];
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ ) {
		n=nl.childNodes[i];
		o = new Object();
		o.id = i;
		o.h = parseInt(n.getAttribute('h'));
		o.w = parseInt(n.getAttribute('w'));
		o.mida = o.h + 'x' + o.w;
		o.uh = parseInt(n.getAttribute('uh'));
		o.uw = parseInt(n.getAttribute('uw'));
		if(hi) {
			o.pxh = parseInt(n.getAttribute('thh'));
			o.pxw = parseInt(n.getAttribute('thw'));
		}
		else {
			o.pxh = parseInt(n.getAttribute('tlh'));
			o.pxw = parseInt(n.getAttribute('tlw'));
		}
		o.inlin = false;
		o.issel = false;
		o.hasobra = false;

		sz.push( o );
	}

	va = is_ie?'position:relative;top:-1px;margin-right:2px;':'position:relative;top:-1px;margin-right:5px;height:16px;overflow:hidden;';
	vas = is_ie?'style="position:relative;top:-1px;"':'style="position:relative;top:-5px;height:16px;overflow:hidden;"';
	s1 = ''; s2 = ''; s3 = ''; cm1 = 0; cm2 = 0; cm3 = 0, sbt = '';
	for( i = 0; i < cnt; i++ ) {
		o = sz[i];
		s = '<div style="height:16px;overflow:hidden;"><label id="T2Flsiz'+i+'">';
		s += '<input id="T2Fchsiz'+i+'" type="checkbox" style="visibility:hidden;'+va+'">';
		s += '<span '+vas+'>'+o.mida+'</span></label></div>';

		if( o.h > o.w ) { s3 += s; cm3++; }
		else if( o.w > o.h ) { s2 += s; cm2++; }
		else { s1 += s; cm1++; }


		sbt += '<div id="BtPilaM'+i+'" class="T2pilabtmida" onclick="kcat.dofillpila('+i+',0)">';
		sbt += '<div id="BtPilaM'+i+'tx" style="padding-top:'+(hi?3:2)+'px;">' + o.mida+'</div></div>';
	}
	document.getElementById( "T2Fls1" ).innerHTML = s1;
	document.getElementById( "T2Fls2" ).innerHTML = s2;
	document.getElementById( "T2Fls3" ).innerHTML = s3;
	document.getElementById( "T2pilabt" ).innerHTML = sbt;

	for( i = 0; i < cnt; i++ )
		this.btpila.push( new _KBtn('BtPilaM'+i, 'pi', 0, 0, (hi?3:2) ) );

	cl = this.colors;
	nl=this.xcat.documentElement.childNodes[4];
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ ) {
		n=nl.childNodes[i];
		o = new Object();
		o.tit=n.childNodes.length > 0 ? n.childNodes[0].data : "";
		o.inlin = false;
		o.issel = false;
		o.hasobra = false;

		cl.push( o );
	}

//	vas = is_ie?'style="position:relative;top:-1px;"':'style="position:relative;top:-5px;height:16px;overflow:hidden;"';
	va = is_ie?'style="position:relative;top:-2px;':'style="position:relative;top:-3px;';
	vas = is_ie?'':'&nbsp;&nbsp;&nbsp;';
	ic = 1;
	cc = 0;
	s1 = ''; s2 = ''; s3 = ''
	for( i = 0; i < cnt; i++ ) {
		o = cl[i];
		s = '<div style="height:16px;overflow:hidden;"><label id="T2Flcol'+i+'">';
		s += '<input id="T2Fchcol'+i+'" type="checkbox" style="visibility:hidden;'+va+'">';
		s += '<span '+va+'font-size:8px;background-color:#'+o.tit+';border:#fff 1px solid;height:12px;width:12px;">'+vas+'</span></label></div>';

		if( ic > 2 )
			{ s3 += s; ic=1; cc++; }
		else {
			if( ic == 1 ) s1 += s;
			else	s2 += s;
			ic++;
		}
	}
	document.getElementById( "T2Flc1" ).innerHTML = s1;
	document.getElementById( "T2Flc2" ).innerHTML = s2;
	document.getElementById( "T2Flc3" ).innerHTML = s3;

	if( cm2 > cm1 ) cm1 = cm2;
	if( cm3 > cm1 )	cm1 = cm3;

	cm1 = 150 + ( cm1 * 16 );
	cm2 = 185 + ( cc * 16 );
	if( cm2 > cm1 )	cm1 = cm2;	

	document.getElementById( "T2Fimgl" ).style.height = cm1 + 'px';
	document.getElementById( "T2Fimgr" ).style.height = cm1 + 'px';
	document.getElementById( "T2Ftable" ).style.height = ( cm1 - 33 ) + 'px';

	s1 = '', s2 = 'fff', s3 = '000';
	nl=this.xcat.documentElement.childNodes[5];
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ ) {
		n=nl.childNodes[i];
		cc = n.getAttribute('bk');
		cf = n.getAttribute('font');
		if( i == 0 )	{ s2 = cc; s3 = cf; }
		s1 += '<div id="T2bkc'+i+'" style="float:left;width:18px;height:18px;overflow:hidden;background-color:#000;">';
		s1 += '<div id="T2bkd'+i+'" style="float:left;width:16px;height:16px;overflow:hidden;background-color:#'+ cc +';margin:1px;">';
		s1 += '<div style="float:left;width:14px;height:14px;overflow:hidden;background-color:#'+ cc +';margin:1px;cursor:pointer;" onclick="kcat.setbkcolor(\'#'+ cc +'\', \'#'+ cf +'\', '+i+');">';
		s1 += '</div></div></div>';
	}
	document.getElementById( "T2bkccli" ).innerHTML = s1;
	this.setbkcolor( '#'+s2, '#'+s3, 0 );

	nl=this.xcat.documentElement.childNodes[6];
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ ) {
		n=nl.childNodes[i];
		this.sug.l.push(n);
	}

	SetNews();
}

function _KCpreloadThumbs()
{
var i, cnt, nl;

	nl=this.xcat.documentElement.childNodes[1];
	cnt = nl.childNodes.length;
	for( i = 0; i < cnt; i++ )
		this.preload( 2, nl.childNodes[i].getAttribute(hi?'tzhi':'tzlo') );
}

function _KCgetObraId(id)
{
var i, cnt, l, n = 0;

	cnt = this.lins.length;
	for( i = 0; i < cnt; i++ ) {
		l = this.lins[i];
		if( id < l.doc.childNodes.length ) {
			n = l.doc.childNodes[id];
			break;
		}
		id -= l.doc.childNodes.length;
	}
	
	return n;
}

function _KCexpandLay( lay, l, cl )
{
var i,cnt, o;

	if( cl ) {
		if( l > lay.l.length )	cnt = lay.l.length;
		else	cnt = l;
		for( i=0; i< cnt; i++ )
			lay.l[i].ix = null;
	}
	else if( l > lay.used ) {
		if( l > lay.l.length )	cnt = lay.l.length;
		else	cnt = l;
		for( i=lay.used; i< cnt; i++ )
			lay.l[i].ix = null;
	}
	
	while( lay.l.length < l ) {
		o = new Object();
		o.ix = null;
		o.e = false;
		lay.l.push( o );
	}

	lay.used = l;
}

function _KCdocXML()
{
var xdoc=is_ie?new ActiveXObject( "MSXML2.DOMDocument" ):document.implementation.createDocument("","",null);

	if( is_ie ) {
		xdoc.resolveExternals = false;
		xdoc.validateOnParse = false;
		xdoc.setProperty( "SelectionLanguage", "XPath" );
	}
	xdoc.async = false; 

	return xdoc;
}

function _KCgetNode( d, p )
{
	var n;

	try {
		if( is_ie )     n = d.selectSingleNode( p );
		else {
			var oNSResolver = d.createNSResolver(d.documentElement);
			var l = d.evaluate(p, d, oNSResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

			if(l.snapshotLength)	n = l.snapshotItem(0);
			else n = null;
		}
	}
	catch(e) { n = null; }

	return n;
}

function _KCenableBtnPg()
{
var e,b,bv;

	bv = this.v2mode!=1 || this.inzoom;

	b = bv || this.actpage <= 1;
	this.btpgprev.disable(b);

	b = bv || this.actpage >= this.actsel.pg;
	this.btpgnext.disable(b);

	b = bv || this.actsel.pg < 2 && !this.btallpg.isdown();
	this.btallpg.disable(b);
	if( !b && this.btallpg.isdown() )
		this.btallpg.setdown( true );
}

function _KCfilMidChange(sel)
{
var i, cnt, sz, e, ds, da;

	if( sel == 3 ) {ds='none';da='block';}
	else {
		if( sel == 2 )	ds='visible';
		else			ds='hidden';
		sz = this.siz;
		cnt = sz.length;
		for( i = 0; i < cnt; i++ ) {
			e = document.getElementById('T2Fchsiz'+i);
			e.style.visibility=ds;
			e.disabled = !sz[i].inlin;
			document.getElementById('T2Flsiz'+i).className = ( sel==2 && !sz[i].inlin ? "SCPmidaoff" : "SCPmidaon" );
		}
		ds='block';da='none';
	}

	document.getElementById('T2Flsize').style.display=ds;
	document.getElementById('T2Frsize').style.display=da;
	if( sel == 3 ) {
		e = document.getElementById('T2Fhfrom');
		e.select();
		e.focus();
	}
}

function _KCfilColChange(sel)
{
var i, cnt, cl, e, ds, da;

	if( sel == 2 )	ds='visible';
	else			ds='hidden';
	cl = this.colors;
	cnt = cl.length;
	for( i = 0; i < cnt; i++ ) {
		e = document.getElementById('T2Fchcol'+i);
		e.style.visibility=ds;
		e.disabled = !cl[i].inlin;
		document.getElementById('T2Flcol'+i).className = ( sel==2 && !cl[i].inlin ? "SCPmidaoff" : "SCPmidaon" );
	}
}

function _KCfilApply()
{
var f, i, cnt, coma, hasfil, sz, cl, s, tmp;

	f = this.fil;
	if( document.getElementById('T2Fssel').checked )	f.smode = 2;
	else if( document.getElementById('T2Fsrange').checked )	f.smode = 3;
	else f.smode = 1;

	if( document.getElementById('T2Fcsel').checked )	f.clmode = 2;
	else	f.clmode = 1;
	
	f.ofer = document.getElementById('T2Fofer').checked;

	s = tx_viewpics+' ';
	if( f.ofer ) s+=tx_inofer+' ';
	hasfil = f.ofer;
	
	if( f.smode == 2 ) {
		s += tx_de+' ';
		coma=false;
		sz = this.siz;
		cnt = sz.length;
		for( i = 0; i < cnt; i++ ) {
			sz[i].issel = document.getElementById('T2Fchsiz'+i).checked;
			if( sz[i].issel ) {
				if(coma)	s+=', ';
				else coma=true;
				s += sz[i].mida;
			}
		}
		if( !coma )	f.smode = 1;
		else	hasfil=true;
	}	
	else if( f.smode == 3 ) {
		f.hfrom = parseInt( document.getElementById('T2Fhfrom').value );
		if( isNaN( f.hfrom ) )	f.hfrom = 0;
		f.hto = parseInt( document.getElementById('T2Fhto').value );
		if( isNaN( f.hto ) )	f.hto = 0;
		f.wfrom = parseInt( document.getElementById('T2Fwfrom').value );
		if( isNaN( f.wfrom ) )	f.wfrom = 0;
		f.wto = parseInt( document.getElementById('T2Fwto').value );
		if( isNaN( f.wto ) )	f.wto = 0;
		s += tx_intoh+' '+f.hfrom+' '+tx_and+' '+f.hto+' cm, '+tx_and+' '+tx_intow+' '+f.wfrom+' '+tx_and+' '+f.wto+' cm';
		hasfil=true;
	}

	if( f.smode == 1 ) {
		if( f.ofer ) s+=' '+tx_allsizes;
		else	s=tx_allpics;
	}

	if( f.clmode == 2 ) {
		coma=false;
		cl = this.colors;
		cnt = cl.length;
		for( i = 0; i < cnt; i++ ) {
			cl[i].issel = document.getElementById('T2Fchcol'+i).checked;
			if( cl[i].issel ) {
				if(coma)	s+=', ';
				else {
					s += ', '+tx_ofcolors+' ';
					coma=true;
				}
				s += cl[i].tit;
			}
		}
		if( !coma )	f.clmode = 1;
		else	hasfil=true;
	}
	if( f.clmode == 1 )
		s += ', '+tx_allcolors;
	
	f.active=hasfil;
	this.btfiltre.seton(f.active);
	this.btfiltreout.disable( !hasfil );
	document.getElementById('T2txfilter').innerHTML = s;

	this.closeFil();
	this.openlin( this.actlin, false );
}

function _KCclearfilters()
{
var f;

	f = this.fil;
	f.active=false;
	f.smode=1;
	f.clmode=1;
	f.ofer=false;
	this.btfiltre.seton(false);
	this.btfiltreout.disable( true );
	document.getElementById('T2txfilter').innerHTML = tx_allpics;
	this.openlin( this.actlin, false );
}

function _KCfindRef(e)
{
var ln, ref, i, cnt, nl, ic, cc, n;

	this.closeFind();
	
	n = 0;
	ref = document.getElementById( 'T2FNref' ).value.toUpperCase();
	ln = this.lins;
	cnt = ln.length;
	for( i = 0; !n && i < cnt; i++ ) {
		nl = ln[i].doc;
		cc = nl.childNodes.length;
		for( ic = 0; ic < cc; ic++ ) {
			n = nl.childNodes[ic];
			if( n.getAttribute('ref').toUpperCase() == ref )
				break;
			n = 0;
		}
	}

	if( n )	this.showzoom(n.getAttribute('id'));
	else alert( ref + '\n\n'+tx_nofref );
}

function _KCresize()
{
	var w, h, c, r, os, ph = (hi?60:48);

	if( typeof( window.innerWidth ) == 'number' ) {
		w = window.innerWidth;
		h = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}
	else {
		w = document.body.offsetWidth;
		h = document.body.offsetHeight;
	}
	
	w -= this.wsug + 60;
	h -= this.hsc + ph;
	c = parseInt( w / this.pgcw );
	r = parseInt( h / this.pgch );
	if( c < this.minpgcols )	c = this.minpgcols;
	if( r < this.minpgrows )	r = this.minpgrows;

	if( c != this.pgcols || r != this.pgrows ) {
		this.pgcols = c;
		this.pgrows = r;
		w = 1 + ( this.pgcw * c );
		document.getElementById("T2pgdiv").style.width = w + 'px';

		os = this.actsel;
		os.rowsv = r;
		if( this.btallpg.isdown() )
			os.rows = 0;
		else
			os.rows = os.rowsv;
		os.cols = c;

		this.actpage = 1;
		this.paginate(os);
		if( this.v2mode == 1 )
			this.fillosel(os);
		else if( this.v2mode == 2 )
			this.dofillpila( this.pila.ixmidasel, this.pila.iximgsel );
		this.viewv2();
	}

	h += ph - (hi?614:492);
	if( h < 31 ) h = 31;
	document.getElementById("T2news").style.height = h + 'px';
}

function _KCpreload(p,n)
{
var img,s;

	if( p == 3 )	s = pimgcomp+n+'.png';
	else if( p == 2 )	s = pthumbs+n+'.jpg';
	else	s = pimgweb+n;
	
	img = new Image();
	img.src = s;
	this.pl[this.pl.length] = img;
}

function _KCopenInfo()
{
var u;
	u='pages/kinfo_'+kcat.langPref+'.html'
	open(u, '_blank', 'location=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes');
}

function _KCopenEfas()
{
	open('pages/kpvenda.html', '_blank', 'location=yes,status=yes,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes');
}

function _KCsetLang(pref)
{
var n, e;

	n = this.getNode( this.xcat, '/cataleg/idiomes/'+pref );
	if(!n||pref==this.langPref) return;

	this.langPref = pref;
	if( n.getAttribute('loaded') == '1' )
		LoadLangEnd();
	else {
		n.setAttribute('loaded', '1');

		e = document.createElement("script");
		if(is_ie)	e.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded") LoadLang2();}
		else	e.onload=LoadLang2;
		e.src="lang_"+this.langPref+".js";
		e.type="text/javascript";
		document.getElementsByTagName("head")[0].appendChild(e);
	}
}

function LoadLang2()
{
var e;

	e = document.createElement("script");
	if(is_ie)	e.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded") LoadLangEnd();}
	else	e.onload=LoadLangEnd;
	e.src="../_comp/lang_"+kcat.langPref+".js";
	e.type="text/javascript";
	document.getElementsByTagName("head")[0].appendChild(e);
}

function LoadLangEnd()
{
var e,n,s;

	try {eval(kcat.langPref+'_mail');}
	catch(e){
		if(!kcat.pgcw)	LoadCat2();
		return;
	}

	tx_mail=eval(kcat.langPref+'_mail');
	tx_peulogo=eval(kcat.langPref+'_peulogo');
	tx_copy=eval(kcat.langPref+'_copy');
	tx_update=eval(kcat.langPref+'_update');
	tx_mysel=eval(kcat.langPref+'_mysel');
	tx_addsel=eval(kcat.langPref+'_addsel');
	tx_delsel=eval(kcat.langPref+'_delsel');
	tx_viewpics=eval(kcat.langPref+'_viewpics');
	tx_inofer=eval(kcat.langPref+'_inofer');
	tx_intoh=eval(kcat.langPref+'_intoh');
	tx_intow=eval(kcat.langPref+'_intow');
	tx_allsizes=eval(kcat.langPref+'_allsizes');
	tx_allpics=eval(kcat.langPref+'_allpics');
	tx_ofcolors=eval(kcat.langPref+'_ofcolors');
	tx_allcolors=eval(kcat.langPref+'_allcolors');
	tx_allpg=eval(kcat.langPref+'_allpg');
	tx_page=eval(kcat.langPref+'_page');
	tx_nopics=eval(kcat.langPref+'_nopics');
	tx_nofref=eval(kcat.langPref+'_nofref');
	tx_hzoom=eval(kcat.langPref+'_hzoom');
	tx_refe=eval(kcat.langPref+'_refe');
	tx_showpic=eval(kcat.langPref+'_showpic');
	tx_bgcolor=eval(kcat.langPref+'_bgcolor');
	tx_de=eval(kcat.langPref+'_de');
	tx_and=eval(kcat.langPref+'_and');
	tx_tel=eval(kcat.langPref+'_tel');
	tx_fax=eval(kcat.langPref+'_fax');
	tx_hmail=eval(kcat.langPref+'_hmail');
	tx_hhome=eval(kcat.langPref+'_hhome');
	tx_hinfo=eval(kcat.langPref+'_hinfo');
	tx_hefas=eval(kcat.langPref+'_hefas');
	tx_hfind=eval(kcat.langPref+'_hfind');
	tx_hselbg=eval(kcat.langPref+'_hselbg');
	tx_hopensel=eval(kcat.langPref+'_hopensel');
	tx_hclosesel=eval(kcat.langPref+'_hclosesel');
	tx_hpages=eval(kcat.langPref+'_hpages');
	tx_hfilm=eval(kcat.langPref+'_hfilm');
	tx_hstack=eval(kcat.langPref+'_hstack');
	tx_hfilt=eval(kcat.langPref+'_hfilt');
	tx_hfiltoff=eval(kcat.langPref+'_hfiltoff');
	tx_hpgprev=eval(kcat.langPref+'_hpgprev');
	tx_hpgnext=eval(kcat.langPref+'_hpgnext');
	tx_hallpg=eval(kcat.langPref+'_hallpg');
	tx_tfilt=eval(kcat.langPref+'_tfilt');
	tx_sizes=eval(kcat.langPref+'_sizes');
	tx_colors=eval(kcat.langPref+'_colors');
	tx_totes=eval(kcat.langPref+'_totes');
	tx_tots=eval(kcat.langPref+'_tots');
	tx_sel=eval(kcat.langPref+'_sel');
	tx_limit=eval(kcat.langPref+'_limit');
	tx_fintoh=eval(kcat.langPref+'_fintoh');
	tx_fintow=eval(kcat.langPref+'_fintow');
	tx_fonlyof=eval(kcat.langPref+'_fonlyof');
	tx_falllin=eval(kcat.langPref+'_falllin');
	tx_sizecm=eval(kcat.langPref+'_sizecm');
	tx_apply=eval(kcat.langPref+'_apply');
	tx_backpg=eval(kcat.langPref+'_backpg');
	tx_expoat=eval(kcat.langPref+'_expoat');
	tx_viewpic=eval(kcat.langPref+'_viewpic');
	tx_timefilm=eval(kcat.langPref+'_timefilm');
	tx_secs=eval(kcat.langPref+'_secs');
	tx_filmctrl=eval(kcat.langPref+'_filmctrl');
	tx_filmdo=eval(kcat.langPref+'_filmdo');
	tx_filmprev=eval(kcat.langPref+'_filmprev');
	tx_filmnext=eval(kcat.langPref+'_filmnext');
	tx_fullscr=eval(kcat.langPref+'_fullscr');
	tx_hfullscr=eval(kcat.langPref+'_hfullscr');
	tx_impreu=eval(kcat.langPref+'_impreu');

	if(kcat.pgcw) {
		e=document.getElementById('T1nomcat');
		e.src=pimgweb+'p_nomcat_'+kcat.langPref+'.png'

		e=document.getElementById('T1logo');
		e.src=pimgweb+'p_logo_'+kcat.langPref+'.png'

		e=document.getElementById('T1mail');
		e.href='mailto:'+tx_mail;
		e.title=tx_hmail;
		e.innerHTML = tx_mail;

		e=document.getElementById('SCmail');
		e.href='mailto:'+tx_mail;
		e.title=tx_hmail;
		e.innerHTML = tx_mail;

		document.getElementById('T1peulogo').innerHTML = tx_peulogo;
		document.getElementById('SCpeulogo').innerHTML = tx_peulogo;
		document.getElementById('T1copy').innerHTML = tx_copy;

		n=kcat.xcat.documentElement.childNodes[1];
		s = tx_update+' ' + n.getAttribute("act");
		document.getElementById("T1data").innerHTML = s;
		document.getElementById("SCdata").innerHTML = s;

		e=document.getElementById('T2logo');
		e.src=pimgweb+'p_logo_'+kcat.langPref+'.png'

		e=document.getElementById('T2bg1');
		e.style.backgroundImage = 'url('+pimgweb+'sc_bg1_'+kcat.langPref+'.jpg)';

		document.getElementById('T2Freft').innerHTML = tx_refe;
		document.getElementById('T2FRok').value = tx_showpic;
		document.getElementById('T2bkcl').innerHTML = tx_bgcolor;
		document.getElementById('T2Fhfi').innerHTML = tx_and;
		document.getElementById('T2Fwfi').innerHTML = tx_and;
		document.getElementById('sc_bthome').title = tx_hhome;
		document.getElementById('sc_btinfo').title = tx_hinfo;
		document.getElementById('sc_btefas').title = tx_hefas;
		document.getElementById('sc_btfind').title = tx_hfind;
		document.getElementById('sc_btselcolor').title = tx_hselbg;
		document.getElementById('sc_btmsel').title = tx_hopensel;
		document.getElementById('sc_btpages').title = tx_hpages;
		document.getElementById('sc_btfilm').title = tx_hfilm;
		document.getElementById('sc_btstack').title = tx_hstack;
		document.getElementById('sc_btfiltre').title = tx_hfilt;
		document.getElementById('sc_btfiltreout').title = tx_hfiltoff;
		document.getElementById('sc_btpgprev').title = tx_hpgprev;
		document.getElementById('sc_btpgnext').title = tx_hpgnext;
		document.getElementById('sc_btallpg').title = tx_hallpg;
		document.getElementById('T2Ftit').innerHTML = tx_tfilt;
		document.getElementById('T2Flstit').innerHTML = tx_sizes;
		document.getElementById('T2Flctit').innerHTML = tx_colors;
		document.getElementById('T2Fstot').innerHTML = tx_totes;
		document.getElementById('T2Fctot').innerHTML = tx_tots;
		document.getElementById('T2Fsselt').innerHTML = tx_sel;
		document.getElementById('T2Fcselt').innerHTML = tx_sel;
		document.getElementById('T2Fsrt').innerHTML = tx_limit;
		document.getElementById('T2Frf').innerHTML = tx_fintoh;
		document.getElementById('T2Frt').innerHTML = tx_fintow;
		document.getElementById('T2Foft').innerHTML = tx_fonlyof;
		document.getElementById('T2Fallit').innerHTML = tx_falllin;
		document.getElementById('T2Fscm').innerHTML = tx_sizecm;
		document.getElementById('T2Fappy').value = tx_apply;
		document.getElementById('T2Zbkpgtx').innerHTML = tx_backpg;
		document.getElementById('T2Zexat').innerHTML = tx_expoat;
		document.getElementById('T2fmexat').innerHTML = '<b>'+tx_expoat+'</b>';
		document.getElementById('T2flvp').innerHTML = tx_viewpic;
		document.getElementById('T2fltt').innerHTML = tx_timefilm;
		document.getElementById('T2fmsecs').innerHTML = tx_secs;
		document.getElementById('T2fmctrl').innerHTML = '<b>'+tx_filmctrl+'</b>';
		document.getElementById('T2_btfmplay').title = tx_filmdo;
		document.getElementById('T2_btfmprev').title = tx_filmprev;
		document.getElementById('T2_btfmnext').title = tx_filmnext;
		document.getElementById('T2_btfmfulltx').innerHTML = tx_fullscr;
		document.getElementById('T2_btfmfull').title = tx_hfullscr;

		kcat.clearfilters();
		SetNews();
	}
	else
		LoadCat2();

	createCookie("lang",kcat.langPref);
}

function SetNews()
{
var n = kcat.getNode( kcat.xcat, "/cataleg/news/" + kcat.langPref );
	document.getElementById("T2news").innerHTML = ( n && n.childNodes.length ) ? n.childNodes[0].data : '';
}
// ------------------------------------------------------------

var _Kbtdn = null;

_KBtn.prototype.disable=_KBdisable;
_KBtn.prototype.isdown=_KBisdown;
_KBtn.prototype.setdown=_KBsetdown;
_KBtn.prototype.seton=_KBseton;

function _KBtn(n,img,l,t,mt,ml,ds)
{
var c;

	c = document.getElementById(n);
	this.ctl = c;
	c.disabled = ds != true ? false : true;
	c._l = l;
	c._t = t;
	c._dn = false;
	c._on = false;
	c._over = false;
	c.onmousedown=KBMouseDown;
	c.onmouseup=KBMouseUp;
	c.onmouseover=KBMouseOver;
	c.onmouseout=KBMouseOut;
	c._kclick=0;
	if( img == 'fm' )	{ c.style.backgroundImage = 'url('+pimgcomp+'film_btns.png)'; c._h = (hi?48:38); }
	else if( img == 'pi' )	{ c.style.backgroundImage = 'url('+pimgcomp+'pila_btn.png)'; c._h = (hi?22:18); }
	else if( img == 'bkpg' )	{ c.style.backgroundImage = 'url('+pimgcomp+'backpg_btn.png)'; c._h = (hi?64:51); }
	else if( img == 'fmf' )	{ c.style.backgroundImage = 'url('+pimgcomp+'/film_btfull.png)'; c._h = (hi?64:51); }
	else				{ c.style.backgroundImage = 'url('+pimgcomp+'sc_btns.png)'; c._h = (hi?18:14); }
	SetBtnBgImage( c, 0 );

	if( mt || ml ) {
		c._tx = document.getElementById( n+'tx');
		c._mt = mt ? mt : 0;
		c._ml = ml ? ml : 0;
	}
	else c._tx = 0;
}
function _KBdisable(b)
{
var e = this.ctl;

	if( e.disabled != b ) {
		e.disabled = b;
		SetBtnBgImage(e,0);
	}
}
function _KBisdown()
{
var e = this.ctl;

	return e._dn;	
}
function _KBsetdown(b)
{
var e = this.ctl;

	e._dn = b;
	if( !e.disabled )
		SetBtnBgImage( e, 0 );
}
function _KBseton(b)
{
var e = this.ctl;

	if( e._on != b ) {
		e._on = b;
		SetBtnBgImage( e, 0 );
	}
}

function KBMouseDown()
{
	if(!this.disabled){
		_Kbtdn=this;
		SetBtnBgImage(this,1);
	}
}
function KBMouseUp(e)
{
	_Kbtdn = null;
	if( this._kclick ) {
		this._dn = !this._dn;
		eval( this._kclick );
		if( this._dn )	CancelEvent(e);
	}
	SetBtnBgImage(this,0);
}
function KBMouseOver()
{
	this._over = true;
	if(_Kbtdn==this||(!_Kbtdn&&!this._dn)) SetBtnBgImage(this,_Kbtdn==this?1:0);
}
function KBMouseOut()
{
	this._over = false;
	if(_Kbtdn==this||(!_Kbtdn&&!this._dn))	SetBtnBgImage(this,0);
}

function SetBtnBgImage( b, st )
{
	var h = 0;
	if( b.disabled ) h=3;
	else {
		if( st == 1 || b._dn ) h=2;
		else if( b._over )	h = 1;
		if( b._on ) h += 4;

	if(b._tx) {
		b._tx.style.paddingTop = b._mt + (h==2?2:0) + 'px';
		b._tx.style.paddingLeft = b._ml + (h==2?4:0) + 'px';
	}

	}
	b.style.backgroundPosition = '-' + b._l + 'px -' + ((h*b._h)+b._t) + 'px';
}

function CancelEvent(e)
{
	if( window.event )	window.event.cancelBubble = true;
	else	e.stopPropagation();
}

function createCookie(name,value) {
var date;
	date = new Date();
	date.setTime(date.getTime()+(365*24*60*60*1000));
	document.cookie = name+"="+value+"; expires="+date.toGMTString()+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
var i,c;
	for(i=0;i < ca.length;i++) {
		c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// ------------------------------------------------------------

function AddHTML()
{
var _TABLE= '<table cellpadding="0" cellspacing="0"';
var _TABLES = _TABLE + ' style="';
var _TABLE100 = _TABLES + 'width:100%;height:100%;';
var s,html,i,cnt,n;

s = _TABLE100 + '" id="T1"><tr><td valign="middle" align="center">';

s += _TABLE + ' class="T1box">';
if(hi)	s += '<colgroup><col width="22"><col width="37"><col width="422"><col width="416"><col width="37"><col width="22"></colgroup>';
else	s += '<colgroup><col width="18"><col width="30"><col width="336"><col width="334"><col width="30"><col width="18"></colgroup>';
s += '<tr>';
	s += '<td rowspan="4"></td>';
	s += '<td colspan="4" valign="top" align="center" style="height:'+(hi?75:60)+'px;width:'+(hi?912:730)+'px;">';
		s += _TABLES + 'width:'+(hi?912:730)+'px;table-layout:fixed;">';
		if(hi)	s += '<colgroup><col width="351"><col width="210"><col width="351"></colgroup>';
		else	s += '<colgroup><col width="281"><col width="168"><col width="281"></colgroup><tr>';
		s += '<td align="left" valign="top" style="padding-left:'+(hi?45:35)+'px;"><img id="T1nomcat" src="'+pimgweb+'p_nomcat_'+kcat.langPref+'.png" /></td>';
		s += '<td align="center" valign="top"><img id="T1logo" src="'+pimgweb+'p_logo_'+kcat.langPref+'.png" style="margin-bottom:4px;" /><br><span id="T1peulogo">'+tx_peulogo+'</span></td>';
		s += '<td id="T1data" align="right" valign="top" style="padding-top:4px;padding-right:'+(hi?45:35)+'px;"></td></tr></table>';
	s += '</td>';
	s += '<td rowspan="4" valign="top" style="padding-top:'+(hi?137:110)+'px;">';
cnt=kcat.nlangs.childNodes.length;
if(cnt>1)
for(i=0;i<cnt;i++) {
	n=kcat.nlangs.childNodes[i];
	s += '<img class="T1Lang" src="'+pimgcomp+'p_'+n.tagName+'.png" title="'+(n.childNodes.length > 0 ? n.childNodes[0].data : "")+'" onclick="kcat.setLang(\''+n.tagName+'\');" /><br>';
}
	s += '</td>';
html = s;
s = '</tr><tr>';
	s += '<td colspan="4" style="height:'+(hi?60:48)+'px;background:url('+pimgweb+'pp_t.png) no-repeat scroll top left;"></td>';
s += '</tr><tr>';
	s += '<td style="height:'+(hi?522:418)+'px;background:url('+pimgweb+'pp_l.png) repeat-y scroll top left;"></td>';
	s += '<td id="T1thumbs" class="TAMA1verd" align="center" valign="middle" style="padding:'+(hi?11:9)+'px;"></td>';
	s += '<td class="TAMA1verd" style="padding:'+(hi?16:13)+'px;padding-left:0;">';
		s += '<div class="TAMA1negre" style="height:'+(hi?23:18)+'px;margin-bottom:'+(hi?7:6)+'px;"><div id="T1nomlin"></div></div>';
		s += '<div class="TAMA1negre" style="height:'+(hi?460:368)+'px;">';
			s+='<img id="T1zoom" style="width:'+(hi?368:294)+'px;height:'+(hi?412:330)+'px;margin:'+(hi?16:13)+'px;margin-top:'+(hi?32:25)+'px;" /></div>';
	s += '</td>';
	s += '<td style="height:'+(hi?522:418)+'px;width:'+(hi?37:30)+'px;background:url('+pimgweb+'pp_r.png) repeat-y scroll top left;"></td>';
s += '</tr><tr>';
	s += '<td colspan="4" align="center" valign="top" style="height:'+(hi?70:56)+'px;background:url('+pimgweb+'pp_b.png) no-repeat scroll top left; padding-top:'+(hi?22:18)+'px;">';
		s += '<a id="T1mail" href="mailto:'+tx_mail+'" title="'+tx_hmail+'">'+tx_mail+'</a>';
		s += '<div id="T1copy">'+tx_copy+'</div>';
s += '</td></tr></table>';

s += '</td></tr></table>';
html += s;

s = _TABLE100 + 'display:none;" id="T2">';
if(hi)	s += '<colgroup><col width="100%"><col width="292"></colgroup>';
else	s += '<colgroup><col width="100%"><col width="244"></colgroup>';
s += '<tr>';
	s += '<td colspan="2" height="'+(hi?108:86)+'px">';

		s += _TABLES + 'table-layout:fixed;height:'+(hi?108:86)+'px;width:100%;">';
		if(hi)	s += '<colgroup><col width="*"><col width="288"><col width="224"><col width="288"><col width="*"></colgroup>';
		else	s += '<colgroup><col width="*"><col width="230"><col width="180"><col width="230"><col width="*"></colgroup>';
		s += '<tr>';
			s += '<td rowspan="3" height="'+(hi?108:86)+'" style="background:url('+pimgweb+'sc_bgl.jpg) no-repeat scroll top right;"></td>';
			s += '<td id="T2bg1" height="'+(hi?56:45)+'" style="background:url('+pimgweb+'sc_bg1_'+kcat.langPref+'.jpg) scroll top left;"></td>';
			s += '<td rowspan="2" align="center" valign="bottom" height="'+(hi?80:65)+'" style="background:url('+pimgweb+'sc_bg2.jpg) scroll top left;padding-bottom:10px">';
				s += '<img id="T2logo" src="'+pimgweb+'p_logo_'+kcat.langPref+'.png" style="margin-bottom:4px;" /><br>';
				s += '<div id="SCpeulogo">'+tx_peulogo+'</div>';
			s += '</td>';
			s += '<td height="'+(hi?56:45)+'" valign="top" align="right" style="background:url('+pimgweb+'sc_bg3.jpg) scroll top left;padding-top:2px;">';
				s += '<span id="SCdata"></span><br>';
				s += '<a id="SCmail" href="mailto:'+tx_mail+'" title="'+tx_hmail+'"><b>'+tx_mail+'</b></a>';
			s += '</td>';
			s += '<td rowspan="3" height="'+(hi?108:86)+'" style="background:url('+pimgweb+'sc_bgr.jpg) no-repeat scroll top left;"></td>';
		s += '</tr><tr>';
html += s;
			s = '<td align="right" valign="top" height="'+(hi?24:20)+'" style="padding-top:'+(hi?4:2)+'px;padding-right:10px;background:url('+pimgweb+'sc_bg4.jpg) scroll top left;">';
				s += '<div id="sc_btefas" class="SCbtnP" style="float:right;margin-left:4px;" onclick="kcat.openEfas();" title="'+tx_hefas+'"></div>';
				s += '<div id="sc_btinfo" class="SCbtnP" style="float:right;margin-left:4px;" onclick="kcat.openInfo();" title="'+tx_hinfo+'"></div>';
				s += '<div id="sc_bthome" class="SCbtnP" style="float:right;" onclick="kcat.viewport();" title="'+tx_hhome+'"></div>';
			s += '</td>';
			s += '<td id="T2cfind" align="left" valign="top" height="'+(hi?24:20)+'" nowrap style="padding-top:'+(hi?4:2)+'px;padding-left:14px;background:url('+pimgweb+'sc_bg6.jpg) scroll top left;">';

				s += _TABLE + ' id="T2find" class="SCpopup" style="margin-top:18px; width:200px;" onmouseup="CancelEvent(event);">';
				s += '<colgroup><col width="18"><col width="164"><col width="18"></colgroup>';
				s += '<tr>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_t.png" style="width:164px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top right;"></td>';
				s += '</tr><tr>';
					s += '<td><img src="'+pimgweb+'bp_l.png" style="width:18px;height:98px;" /></td>';
					s += '<td class="TAMA2verd" style="padding:4px;padding-top:0;">';
						s += '<div id="T2Freft" class="SCPtitol">'+tx_refe+'</div>';
						s += '<div class="TAMA2negre" style="padding:8px;text-align:center;">';
						s += '<input id="T2FNref" class="SCPeditref" type="text" />';
						s += '<input id="T2FRok" type="button" class="SCPbtn" value="'+tx_showpic+'" style="margin-top:8px;" onclick="kcat.findRef(event);">';
						s += '</div>';
					s += '</td>';
					s += '<td><img src="'+pimgweb+'bp_r.png" style="width:18px;height:98px;" /></td>';
				s += '</tr><tr>';
html += s;
					s = '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_b.png" style="width:164px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom right;"></td>';
				s += '</tr></table>';

				s += _TABLE + ' id="T2bkcolor" class="SCpopup" style="margin-top:18px; width:188px;" onmouseup="CancelEvent(event);">';
				s += '<colgroup><col width="18"><col width="152"><col width="18"></colgroup>';
				s += '<tr>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_t.png" style="width:152px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top right;"></td>';
				s += '</tr><tr>';
					s += '<td><img src="'+pimgweb+'bp_l.png" style="width:18px;height:159px;" /></td>';
					s += '<td valign="top" class="TAMA2verd" style="padding:4px;padding-top:0;">';
						s += '<div id="T2bkcl" class="SCPtitol">'+tx_bgcolor+'</div>';
						s += '<div id="T2bkccli" class="TAMA2negre" style="text-align:left;height:126px;line-height:18px;"></div>';
					s += '</td>';
					s += '<td><img src="'+pimgweb+'bp_r.png" style="width:18px;height:159px;" /></td>';
				s += '</tr><tr>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_b.png" style="width:152px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom right;"></td>';
				s += '</tr></table>';

				s += '<div id="sc_btfind" class="SCbtnP" style="margin-right:4px;" title="'+tx_hfind+'"></div>';
				s += '<div id="sc_btselcolor" class="SCbtnP" style="margin-right:4px;" title="'+tx_hselbg+'"></div>';
				s += '<div id="sc_btmsel" class="SCbtnP" title="'+tx_hopensel+'">';
				s += '<div id="sc_btmseltx" class="SCbtmseltx"></div></div>';
			s += '</td>';
html += s;
		s = '</tr><tr>';
			s += '<td align="right" valign="top" height="'+(hi?28:21)+'" style="padding-top:'+(hi?3:1)+'px;padding-right:10px;background:url('+pimgweb+'sc_bg0.jpg) repeat-x scroll top left;">';
				s += '<div id="sc_btstack" class="SCbtnG" style="float:right;margin-left:4px;" onclick="kcat.setv2mode(2)" title="'+tx_hstack+'"></div>';
				s += '<div id="sc_btfilm" class="SCbtnG" style="float:right;margin-left:4px;" onclick="kcat.setv2mode(3)" title="'+tx_hfilm+'"></div>';
				s += '<div id="sc_btpages" class="SCbtnG" style="float:right;" onclick="kcat.setv2mode(1)" title="'+tx_hpages+'"></div>';
			s += '</td>';
			s += '<td align="center" valign="top" height="'+(hi?28:21)+'" style="padding-top:'+(hi?3:1)+'px;padding-left:8px;background:url('+pimgweb+'sc_bg0.jpg) repeat-x scroll top left;">';

				s += _TABLE + ' id="T2filters" class="SCpopup" style="margin-top:26px; width:494px;" onmouseup="CancelEvent(event);">';
				s += '<colgroup><col width="18"><col width="458"><col width="18"></colgroup>';
				s += '<tr>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_t.png" style="width:458px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll top right;"></td>';
				s += '</tr><tr>';
					s += '<td><img id="T2Fimgl" src="'+pimgweb+'bp_l.png" style="width:18px;height:183px;" /></td>';
					s += '<td valign="top" class="TAMA2verd">';
						s += '<div id="T2Ftit" class="SCPtitol">'+tx_tfilt+'</div>';

						s += _TABLE + ' id="T2Ftable" class="TAMA2negre" style="width:450px;margin:4px;margin-top:0;table-layout:fixed;">';
						s += '<colgroup><col width="248"><col width="202"></colgroup>';
						s += '<tr>';
							s += '<td valign="top" nowrap rowspan="2" style="padding:8px;padding-bottom:3px;padding-right:2px;">';
								s += '<div style="height:42px;">';
								s += '<span id="T2Flstit" class="SCPtitgrup" style="margin-left:4px;">'+tx_sizes+'</span><br>';
								s += '<label style="margin-right:2px;"><input id="T2Fstots" type="radio" name="KFradmid" checked onclick="kcat.filMidChange(1)"><span id="T2Fstot" class="SCPtext">'+tx_totes+'</span></label>';
								s += '<label style="margin-right:2px;"><input id="T2Fssel" type="radio" name="KFradmid" onclick="kcat.filMidChange(2)"><span id="T2Fsselt" class="SCPtext">'+tx_sel+'</span></label>';
								s += '<label><input id="T2Fsrange" type="radio" name="KFradmid" onclick="kcat.filMidChange(3)"><span id="T2Fsrt" class="SCPtext">'+tx_limit+'</span></label>';
								s += '</div>';
html += s;
								s = _TABLE + ' id="T2Flsize">';
								s += '<tr>';
									s += '<td valign="middle" align="left"><div style="width:11px;height:11px;margin-left:34px;background-color:#b4cbaf;overflow:hidden;"></div></td>';
									s += '<td valign="middle" align="left"><div style="width:16px;height:6px;margin-left:31px;background-color:#b4cbaf;overflow:hidden;"></div></td>';
									s += '<td valign="middle" align="left"><div style="width:6px;height:16px;margin-left:36px;background-color:#b4cbaf;overflow:hidden;"></div></td>';
								s += '</tr><tr>';
									s += '<td id="T2Fls1" valign="top" nowrap class="SCPtext" style="line-height:16px;padding-right:10px;"></td>';
									s += '<td id="T2Fls2" valign="top" nowrap class="SCPtext" style="line-height:16px;padding-right:10px;"></td>';
									s += '<td id="T2Fls3" valign="top" nowrap class="SCPtext" style="line-height:16px;"></td>';
								s += '</tr></table>';

								s += '<div id="T2Frsize" class="SCPtext" style="display:none;padding-left:4px;padding-top:8px;">';
								s += '<span id="T2Frf" style="margin-right:4px;">'+tx_fintoh+'</span>';
								s += '<input id="T2Fhfrom" type="text" class="SCPeditmida" maxlength ="3" value="30">';
								s += '<span id="T2Fhfi" style="margin-left:4px;margin-right:4px;">'+tx_and+'</span>';
								s += '<input id="T2Fhto" type="text" class="SCPeditmida" style="margin-right:4px;" maxlength ="3" value="80">cm<br>';
								s += '<span id="T2Frt" style="margin-right:4px;">'+tx_fintow+'</span>';
								s += '<input id="T2Fwfrom" type="text" class="SCPeditmida" maxlength ="3" value="30">';
								s += '<span id="T2Fwfi" style="margin-left:4px;margin-right:4px;">'+tx_and+'</span>';
								s += '<input id="T2Fwto" type="text" class="SCPeditmida" style="margin-right:4px;" maxlength ="3" value="80">cm';
								s += '</div>';
							s += '</td>';
							s += '<td valign="top" nowrap style="padding:8px;">';
								s += '<div style="height:36px;">';
								s += '<span id="T2Flctit" class="SCPtitgrup" style="margin-left:4px;">'+tx_colors+'</span><br>';
								s += '<label style="margin-right:2px;"><input id="T2Fctots" type="radio" name="KFradcol" checked onclick="kcat.filColChange(1)"><span id="T2Fctot" class="SCPtext">'+tx_tots+'</span></label>';
								s += '<label><input id="T2Fcsel" type="radio" name="KFradcol" onclick="kcat.filColChange(2)"><span id="T2Fcselt" class="SCPtext">'+tx_sel+'</span></label>';
								s += '</div>';

								s += _TABLE + '>';
								s += '<tr>';
									s += '<td nowrap id="T2Flc1" valign="top" class="SCPtext" style="line-height:16px;padding-right:16px;"></td>';
									s += '<td nowrap id="T2Flc2" valign="top" class="SCPtext" style="line-height:16px;padding-right:16px;"></td>';
									s += '<td nowrap id="T2Flc3" valign="top" class="SCPtext" style="line-height:16px;"></td>';
								s += '</tr></table>';
html += s;
							s = '</td>';
						s += '</tr><tr>';
							s += '<td valign="bottom" align="left" style="padding-left:8px;padding-top:12px;">';
								s += '<label><input id="T2Fofer" type="checkbox"><span id="T2Foft" class="SCPtext">'+tx_fonlyof+'</span></label><br>';
								s += '<label style="visibility:hidden;"><input id="T2Falllin" type="checkbox" disabled><span id="T2Fallit" class="SCPtext" disabled>'+tx_falllin+'</span></label>';
							s += '</td>';
						s += '</tr><tr height="38">';
							s += '<td colspan="2" valign="bottom" style="padding:8px;padding-top:0;">';

								s += _TABLE + ' width="100%">';
								s += '<tr><td nowrap valign="bottom" align="left">';
									s += '<span id="T2Fscm" class="SPCmidescm" style="margin-left:4px;">'+tx_sizecm+'</span>';
								s += '</td>';
								s += '<td nowrap valign="bottom" align="right">';
									s += '<input id="T2Fappy" type="button" class="SCPbtn" value="'+tx_apply+'" onclick="kcat.filApply();">';
								s += '</td></tr></table>';

							s += '</td>';
						s += '</tr></table>';

					s += '</td>';
					s += '<td><img id="T2Fimgr" src="'+pimgweb+'bp_r.png" style="width:18px;height:183px;" /></td>';
				s += '</tr><tr>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom left;"></td>';
					s += '<td style="height:18px;"><img src="'+pimgweb+'bp_b.png" style="width:458px;height:18px;" /></td>';
					s += '<td style="height:18px;background:url('+pimgweb+'bp_corn.png) no-repeat scroll bottom right;"></td>';
				s += '</tr></table>';
				
				s += '<div id="sc_btfiltre" class="SCbtnG" style="width:'+(hi?159:124)+'px;" title="'+tx_hfilt+'"></div>';
				s += '<div id="sc_btfiltreout" class="SCbtnP" style="margin-left:4px;" title="'+tx_hfiltoff+'" onclick="kcat.clearfilters();"></div>';
			s += '</td>';
html += s;
			s = '<td align="center" valign="top" height="'+(hi?28:21)+'" nowrap style="padding-top:'+(hi?3:1)+'px;padding-left:14px;background:url('+pimgweb+'sc_bg0.jpg) repeat-x scroll top left;">';
				s += '<div id="sc_btpgprev" class="SCbtnG" style="margin-right:6px;;" title="'+tx_hpgprev+'" onclick="kcat.prevpg();"></div>';
				s += '<div id="sc_btpgnext" class="SCbtnG" style="margin-right:6px;" title="'+tx_hpgnext+'" onclick="kcat.nextpg();"></div>';
				s += '<div id="sc_btallpg" class="SCbtnG" title="'+tx_hallpg+'"></div>';
			s += '</td>';
		s += '</tr></table>';

	s += '</td>';
s += '</tr>';

s += '<tr>';
	s += '<td valign="top" align="center" height="100%">';

		s += _TABLE100 + 'width:100%;height:100%;">';
		s += '<tr>';
			s += '<td valign="middle" align="center" style="height:'+(hi?24:20)+'px;background:url('+pimgweb+'bg_txfil.png) repeat-x scroll top left;">';
				s += '<span id="T2txfilter">'+tx_allpics+'</span>';
			s += '</td>';
		s += '</tr><tr>';
			s += '<td id="T2pages" valign="top" align="center" style="padding-top:'+(hi?10:6)+'px;">';
				s += '<div id="T2pgdiv">';
				s += '<div class="T2nomlin">';
					s += '<span id="T2numpg"></span>';
					s += '<span id="T2txnomlin"></span>';
				s += '</div>';
				s += '<div id="T2pilabt" style="height:22px;margin-top:10px;margin-left:11px;margin-right:10px;display:none;"></div>';
				s += '<div style="clear:both;height:'+(hi?10:1)+'px;line-height:'+(hi?10:1)+'px;overflow:hidden;"></div>';
				s += '<div id="T2cli" align="center"></div></div>';
			s += '</td>'
		s += '</tr><tr>';
			s += '<td valign="middle" align="center" id="T2zoom" style="height:100%;" onclick="kcat.hidezoom();">';
				s += '<div id="T2zmsg" style="display:none;"></div>';
				s += '<img id="T2zimg" style="border:1px solid #fff;" />';
			s += '</td>';
		s += '</tr></table>';
	s += '</td>';
	s += '<td valign="top" height="100%" style="background:url('+pimgweb+'bg_txfil.png) repeat scroll top left;padding:7px;">';
html += s;
		s = _TABLE + ' id="T2sug" style="width:'+(hi?278:226)+'px;table-layout:fixed;">';
		s += '<colgroup><col width="11"><col width="'+(hi?256:204)+'"><col width="11"></colgroup>';
		s += '<tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px; padding-top:'+(hi?12:6)+'px; padding-bottom:'+(hi?12:6)+'px;">';
				s += _TABLES + 'width:'+(hi?232:184)+'px;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr><td align="left" valign="top" class="TAMA2negre" style="padding:8px;">';
					s += '<div id="T2news" style="width:'+(hi?216:168)+'px;overflow:auto;"></div>';
				s += '</td></tr></table>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="height:'+(hi?18:12)+'px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?500:390)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px; padding-top:'+(hi?12:6)+'px; padding-bottom:'+(hi?12:6)+'px;">';
				s += '<div style="width:'+(hi?232:184)+'px;height:'+(hi?476:378)+'px;overflow:hidden;">';
					s += _TABLES + 'width:'+(hi?232:184)+'px;height:'+(hi?476:366)+'px;table-layout:fixed;">';
					s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
					s += '<tr height="'+(hi?232:184)+'"><td align="center" valign="middle" class="TAMA2negre"><img id="T2SImg1" width="'+(hi?220:176)+'" height="'+(hi?220:176)+'" style="cursor:pointer;" onclick="kcat.clicksug(this);" /></td></tr>';
					s += '<tr><td style="height:'+(hi?12:10)+'px;"></td></tr>';
					s += '<tr height="'+(hi?232:184)+'"><td align="center" valign="middle" class="TAMA2negre"><img id="T2SImg2" width="'+(hi?220:176)+'" height="'+(hi?220:176)+'" style="cursor:pointer;" onclick="kcat.clicksug(this);" /></td></tr>';
					s += '</table>';
				s += '</div>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr></table>';

html += s;
		s = _TABLE + ' id="T2zoomdata" style="width:'+(hi?278:226)+'px;height:100%;table-layout:fixed;">';
		s += '<colgroup><col width="11"><col width="'+(hi?256:204)+'"><col width="11"></colgroup>';
		s += '<tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?88:71)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td class="TAMA2verd" style="padding:'+(hi?12:10)+'px;">';
				s += '<div id="T2Zbkpg" style="width: '+(hi?232:184)+'px; height:'+(hi?64:51)+'px;" onclick="kcat.hidezoom();">';
				s += '<div id="T2Zbkpgtx" class="T2Ztornar" style="padding-top:'+(hi?24:19)+'px;">'+tx_backpg+'</div></div>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="height:18px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?148:144)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td align="left" valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px;">';

				s += _TABLES + 'width:'+(hi?232:184)+'px;height:100%;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr><td nowrap align="left" valign="top" class="TAMA2negre" style="padding:8px;">';
					s += '<div nowrap id="T2Zdata" class="T2txdreta" style="width:'+(hi?216:168)+'px;overflow:hidden;line-height:16px;"></div>';
				s += '</td></tr></table>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="height:18px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?150:146)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td align="left" valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px; padding-top:4px;">';
html += s;
				s = _TABLES + 'width:'+(hi?232:184)+'px;height:100%;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr><td align="center" valign="top">';
					s += '<div id="T2Zexat" class="T2ZtitolEFA" style="padding-bottom:8px;">'+tx_expoat+'</div>';
				s += '</td></tr>';
				s += '<tr><td align="left" valign="top" class="TAMAbgEFA" style="padding:8px;">';
					s += '<div id="T2Zefa" class="T2txdreta" style="width:'+(hi?216:168)+'px;height:96px;overflow:hidden;line-height:16px;"></div>';
				s += '</td></tr></table>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr></table>';

		s += _TABLE + ' id="T2filmdata" style="width:'+(hi?278:226)+'px;height:100%;table-layout:fixed;">';
		s += '<colgroup><col width="11"><col width="'+(hi?256:204)+'"><col width="11"></colgroup>';
		s += '<tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?148:110)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td align="left" valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px;padding-top:'+(hi?12:6)+'px;padding-bottom:'+(hi?12:6)+'px;">';
				s += _TABLES + 'width:'+(hi?232:184)+'px;height:100%;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr><td nowrap align="left" class="TAMA2negre" valign="top" style="padding:'+(hi?8:5)+'px;padding-bottom:'+(hi?8:0)+'px;">';
					s += '<div nowrap id="T2fmdata" class="T2txdreta" style="width:'+(hi?216:168)+'px;overflow:hidden;line-height:'+(hi?16:14)+'px;"></div>';
				s += '</td></tr></table>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?295:206)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td align="left" valign="top" class="TAMA2verd" style="padding:'+(hi?12:10)+'px;padding-top:0px;padding-bottom:'+(hi?12:6)+'px;">';
html += s;
				s = _TABLES + 'width:'+(hi?232:178)+'px;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr height="'+(hi?26:14)+'">';
					s += '<td id="T2flvp" align="center" valign="'+(hi?'middle':'top')+'" class="T2filmtit">'+tx_viewpic+'</td>';
				s += '</tr><tr height="'+(hi?30:20)+'">';
					s += '<td align="center" valign="middle" class="TAMA2negre"><span id="T2fmpos" class="T2txdreta"></span></td>';
				s += '</tr><tr height="'+(hi?30:20)+'">';
					s += '<td id="T2fltt" align="center" valign="middle" class="T2filmtit">'+tx_timefilm+'</td>';
				s += '</tr><tr height="'+(hi?30:20)+'">';
					s += '<td align="center" valign="middle" class="TAMA2negre" style="padding-left:'+(hi?48:34)+'px;padding-right:'+(hi?48:34)+'px;">';
						s += '<span class="T2txdreta" style="float:left;height:'+(hi?20:14)+'px;width:'+(hi?20:14)+'px;border:1px solid #fff;text-align:center;font-size:'+(hi?11:8)+'pt;cursor:pointer;" onclick="kcat.filmtmenys();"><b>-</b></span>';
						s += '<span class="T2txdreta" style="float:right;height:'+(hi?20:14)+'px;width:'+(hi?20:14)+'px;border:1px solid #fff;text-align:center;font-size:'+(hi?11:8)+'pt;cursor:pointer;" onclick="kcat.filmtmes();"><b>+</b></span>';
						s += '<span id="T2fmtime" class="T2txdreta" style="font-size:'+(hi?10:8)+'pt;font-weight:bold;margin-right:3px;">4</span>';
						s += '<span id="T2fmsecs" class="T2txdreta">'+tx_secs+'</span>';
					s += '</td>';
				s += '</tr><tr height="'+(hi?30:20)+'">';
					s += '<td id="T2fmctrl" align="center" valign="middle" class="T2filmtit">';
						s += '<b>'+tx_filmctrl+'</b>';
					s += '</td>';
				s += '</tr><tr>';
					s += '<td id="T2_btfmback" align="center" valign="top" style="height:'+(hi?64:51)+'px;background:url('+pimgcomp+'film_bgbtns.png) no-repeat scroll top left;">';
						s += '<div style="margin-left:'+(hi?32:24)+'px;height:'+(hi?48:38)+'px;padding-top:'+(hi?8:6)+'px;">';
							s += '<div id="T2_btfmplay" class="T2btfilmnav" style="margin-right:'+(hi?22:17)+'px;" title="'+tx_filmdo+'" onclick="kcat.filmplay();"></div>';
							s += '<div id="T2_btfmprev" class="T2btfilmnav" style="margin-right:'+(hi?7:5)+'px;" title="'+tx_filmprev+'" onclick="kcat.filmprev();"></div>';
							s += '<div id="T2_btfmnext" class="T2btfilmnav" title="'+tx_filmnext+'" onclick="kcat.filmnext();"></div>';
						s += '</div>';
					s += '</td>';
				s += '</tr><tr>';
					s += '<td align="center" valign="top" style="padding-top:'+(hi?12:4)+'px;">';
						s += '<div id="T2_btfmfull" style="width:'+(hi?232:184)+'px; height:'+(hi?64:51)+'px;" onclick="kcat.openfullfilm();" title="'+tx_hfullscr+'">';
							s += '<div id="T2_btfmfulltx" class="T2filmbtfull">'+tx_fullscr+'</div>';
						s += '</div>';
					s += '</td>';
				s += '</tr></table>';
html += s;
			s = '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_t.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr><tr height="'+(hi?148:114)+'">';
			s += '<td style="background:url('+pimgweb+'br_l.png) repeat-y scroll top left;"></td>';
			s += '<td align="left" valign="top" class="TAMA1verd" style="padding:'+(hi?12:10)+'px; padding-top:'+(hi?4:0)+'px;padding-bottom:'+(hi?12:6)+'px;">';
				s += _TABLES + 'width:'+(hi?232:184)+'px;height:100%;table-layout:fixed;">';
				s += '<colgroup><col width="'+(hi?232:184)+'"></colgroup>';
				s += '<tr><td align="center" valign="top">';
					s += '<div id="T2fmexat" class="T2filmtit" style="padding-bottom:'+(hi?8:2)+'px;"><b>'+tx_expoat+'</b></div>';
				s += '</td></tr>';
				s += '<tr><td align="left" valign="top" class="TAMAbgEFA" style="padding:'+(hi?8:5)+'px;">';
					s += '<div id="T2fmefa" class="T2txdreta" style="width:'+(hi?216:168)+'px;height:'+(hi?96:84)+'px;overflow:hidden;line-height:'+(hi?16:14)+'px;"></div>';
				s += '</td></tr></table>';
			s += '</td>';
			s += '<td style="background:url('+pimgweb+'br_r.png) repeat-y scroll top left;"></td>';
		s += '</tr><tr>';
			s += '<td colspan="3" style="background:url('+pimgweb+'br_b.png) no-repeat scroll top left; height:15px;"></td>';
		s += '</tr>';
	s += '</td>';
s += '</tr></table>';

s += '</td></tr></table>';

s += _TABLE100 + 'display:none;" id="T3">';
s += '<tr><td valign="middle" align="center" onclick="kcat.exitfullfilm();">';
	s += '<img id="T3img" style="border:1px solid #fff;" />';
s += '</td></tr></table>';
html += s;
document.body.innerHTML = html;
}

function LoadCat()
{
var lng;
kcat = new _KCat();
kcat.xcat.load('data.xml');
kcat.nlangs=kcat.xcat.documentElement.childNodes[9];
lng = readCookie("lang");
if(!kcat.getNode(kcat.xcat, '/cataleg/idiomes/'+lng)) {
	if(navigator.userLanguage)
		lng = navigator.userLanguage.toLowerCase().substring(0,2);
	else if(navigator.language)
		lng = navigator.language.toLowerCase().substring(0,2);
	else lng = "";

	if( lng=="ca" || lng=="es" )	lng='cat';
	else if( lng=="de" )	lng='deu';
	else if( lng=="pt" )	lng='por';
	else if( lng=="eu" )	lng='eus';
	else	lng = "eng";

	if(!kcat.getNode(kcat.xcat, '/cataleg/idiomes/'+lng))
		lng = 'cat';
}
kcat.setLang(lng);
}

function LoadCat2()
{
AddHTML();
kcat.opencat();
}

var agt=navigator.userAgent.toLowerCase();
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_aol = (agt.indexOf("aol") != -1) || agt.indexOf("firefox");
var pimgcomp='../_comp/img/';
var pimgweb='imgweb/';
var pimgcat='imgcat/';
var pthumbs='thumbs/';
var pimgsug='imgsug/';
var kcat, hi;
var tx_mail,tx_peulogo,tx_copy;
var tx_update,tx_mysel,tx_addsel,tx_delsel,tx_viewpics,tx_inofer,tx_intoh,tx_intow,tx_allsizes,tx_allpics,tx_ofcolors,tx_allcolors,tx_allpg,tx_page;
var tx_nopics,tx_nofref,tx_hzoom,tx_refe,tx_showpic,tx_bgcolor,tx_de,tx_and,tx_tel,tx_fax,tx_hmail,tx_hhome,tx_hinfo,tx_hefas,tx_hfind,tx_hselbg;
var tx_hopensel,tx_hclosesel,tx_hpages,tx_hfilm,tx_hstack,tx_hfilt,tx_hfiltoff,tx_hpgprev,tx_hpgnext,tx_hallpg,tx_tfilt,tx_sizes,tx_colors,tx_totes;
var tx_tots,tx_sel,tx_limit,tx_fintoh,tx_fintow,tx_fonlyof,tx_falllin,tx_sizecm,tx_apply,tx_backpg,tx_expoat,tx_viewpic,tx_timefilm,tx_secs;
var tx_filmctrl,tx_filmdo,tx_filmprev,tx_filmnext,tx_fullscr,tx_hfullscr,tx_impreu;

if( screen.width >= 1280 ) {
	pimgcomp+='high/';
	pimgweb+='high/';
	pimgcat+='high/';
	pthumbs+='high/';
	pimgsug+='high/';
	hi=true;
}
else {
	pimgcomp+='low/';
	pimgweb+='low/';
	pimgcat+='low/';
	pthumbs+='low/';
	pimgsug+='low/';
	hi=false;
}


