function ProductCategoryHandler( max_fokat ) {
	this.lenyitva = 0;
	this.activeSubMenuItem = 0;
	this.max_fokat = max_fokat;
}

ProductCategoryHandler.prototype.osszesKatBezar = function( doNotCloseParam ) {
	var doNotClose = false;
	if( ( typeof( doNotCloseParam ) != 'undefined' ) && ( doNotCloseParam == true ) ) doNotClose = true;
	if( typeof( ws.selectedSkin ) == 'string' && ws.selectedSkin.substr( 0, 6 ) == "black." ) doNotClose = true;
	wsInputs = document.getElementsByTagName( 'div' );		// beszedjük az összes a-t
	for( var j = 0 ; j < wsInputs.length ; j++ ) {
		if( wsInputs[ j ].getAttribute( 'id' ) != null ) {
			if( wsInputs[ j ].getAttribute( 'id' ) != '' ) {
				if( wsInputs[ j ].getAttribute( 'id' ).substring( 0 , 11 ) == 'fokategoria' ) {		// ez egy főkategória
					if( get( 'alkat' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ) != null ) {		// van alkategóriája
						if( !doNotClose ) get( 'alkat' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ).style.display = 'none';		// alkategóriákat eltűntetjük
						if( !doNotClose ) get( 'fokat' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/arrowMaincateg.gif) no-repeat top right';		// lenyíló nyilat eltűntetjük
						wsSubCats = get( 'alkat' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ).getElementsByTagName( 'div' );
						for( var i = 0 ; i < wsSubCats.length ; i++ ) {
							if( wsSubCats[ i ].getAttribute( 'id' ) != null ) {
								if( wsSubCats[ i ].getAttribute( 'id' ) != '' ) {
									if( wsSubCats[ i ].getAttribute( 'id' ).substring( 0 , 11 ) == 'alkategoria' ) {		// ez egy alkategória megnevezés div
										get( 'alkategoria' + wsSubCats[ i ].getAttribute( 'id' ).substring( 11 ) ).style.background = '';		// mutató nyilat eltűntetjük az alkategóriáknál
									}
								}
							}
						}
						get( 'fokategoria' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ).style.background = '';		// mutató nyilat eltűntetjük a főkategóriánál
					} else {
						get( 'fokategoria' + wsInputs[ j ].getAttribute( 'id' ).substring( 11 ) ).style.background = '';		// csak a mutató nyilat kell etűntetni
					}
				}
			}
		}
	}
	this.lenyitva = 0;		// nincs lenyitva semmi
}
		 
ProductCategoryHandler.prototype.alKatLenyit = function( kat , seoname , doNotGo ) {
	this.osszesKatBezar( true );
	if (ws.selectedSkin != 'black.skin') get( 'alkategoria' + kat ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/categArrow.png) no-repeat 4px 4px';		// lenyíló nyilra cseréljük
	if( this.activeSubMenuItem != kat ) {
		this.activeSubMenuItem = kat;
		if( ( typeof( doNotGo ) == 'boolean' ) && ( doNotGo === true ) ) {}
		else {
			if( typeof( seoname ) == 'undefined' ) ajax.go( 'public/products/category/' + kat );
			else ajax.go( 'public/products/category/' + seoname );
//			ws.wsUtil.toTop();
		}
	}
}

ProductCategoryHandler.prototype.foKatLenyit = function( fokat , alkatvan , also , seoname , doNotGo ) {
	var fokatnev = "fokat" + fokat;
	var fokategorianev = "fokategoria" + fokat;
	var alkatnev = "alkat" + fokat;
	this.activeSubMenuItem = 0;
	if( this.lenyitva != fokat ) {
		this.osszesKatBezar();
		this.lenyitva = fokat;
		if( also == 1 ) {
			get( fokatnev ).style.border = 'none';
		}

		if( alkatvan == 1 ) {
/*			if( also == 1 ) {
				ws.wsUtil.changeCSSClass( fokatnev , 'alsofokatalkattallenyitva' );
			} else {
				ws.wsUtil.changeCSSClass( fokatnev , 'fokatalkattallenyitva' );
			} */
			if (ws.selectedSkin != 'black.skin')
			get( fokatnev ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/arrowMaincategOver.gif) no-repeat top right';		// lenyíló nyilra cseréljük
			get( alkatnev ).style.display = "block";		// alktegóriát mutatunk
		}

		if (ws.selectedSkin != 'black.skin') get( fokategorianev ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/categArrow.png) no-repeat 4px 4px';		// mutató nyilat otthagyjuk
		get( fokategorianev ).style.color = '#737759';
		if( ( typeof( doNotGo ) == 'boolean' ) && ( doNotGo === true ) ) {}
		else {
			if( typeof( seoname ) == 'undefined' ) ajax.go( 'public/products/category/' + fokat );
			else ajax.go( 'public/products/category/' + seoname );
//			ws.wsUtil.toTop();
		}
/*	} else {
		this.lenyitva = 0;
		if( also == 1 ) {
			get( fokatnev ).style.borderBottom = '0px';
		}
		if( alkatvan == 1 ) {
			get( alkatnev ).style.display = "none";
			get( fokatnev ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/arrowMaincateg.gif) no-repeat top right';		// visszarakjuk sima nyílra, nem lenyílóra
		}
//		get( fokategorianev ).style.backgroundImage = '';
		get( fokategorianev ).style.color = '#737759';
		ws.wsUtil.preload( 'kozepkozep' , 150 );
		ajax.go( 'public/products/highlighted' );
//		ws.wsUtil.toTop(); */
	}
}

ProductCategoryHandler.prototype.foKategerBe = function( fokat_id ) {
	var nev = "fokategoria" + fokat_id;
	if( fokat_id == this.lenyitva ) {
		return true;
	}
//	get( nev ).style.background = '';
	if( ws.selectedSkin != 'black.skin' ) get( nev ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/categArrow.png) no-repeat 4px 4px';
	get( nev ).style.color = '#737759';
}

ProductCategoryHandler.prototype.foKategerKi = function( fokat_id ) {
	var nev = "fokategoria" + fokat_id;
	if( fokat_id == this.lenyitva ) {
		return true;
	}
	get( nev ).style.background = 'none';
	get( nev ).style.color = '#737759';
}

ProductCategoryHandler.prototype.alKategerBe = function( alkat_id ) {
	var nev = "alkategoria" + alkat_id;
	if( alkat_id == this.activeSubMenuItem ) return true;

	if( ws.selectedSkin != 'black.skin' ) get( nev ).style.background = 'url(site/webshop/' + ws.selectedSkin + '/img/categArrow.png) no-repeat 4px 4px';
	get( nev ).style.color = '#ffffff';
}

ProductCategoryHandler.prototype.alKategerKi = function( alkat_id ) {
	var nev = "alkategoria" + alkat_id;
	
	if( alkat_id == this.activeSubMenuItem ) return true;
	
	get( nev ).style.background = 'none';
	get( nev ).style.color = '#ffffff';
}
