(function() {
	/*
	 *Author Liyao
	 *Date 2009-4-8
	 *Function FuntypeLayer class extends JobLayer class
	 */
	
	//check the class name , it will be replaced when existed
	if ( window.FuntypeLayer ) {
		alert( 'variable FuntypeLayer has been used,it will be replaced with _FuntypeLayer!' );
		window._FuntypeLayer = window.FuntypeLayer;
	}

	//constructor
	window.FuntypeLayer = function( param ) {
		param = param instanceof Object ? param : {};
		param.colNum = param.colNum || 4;
		param.data = ft;
		param.headTitle = param.cfg.langs.znlb;
		param.selectedTitle = param.cfg.langs.zhineng;
		param.initTblFunc = this.initFuntypeLayer;
		param.getSubColNum = this.getFuntypeSubColNum;
		JobLayer.apply( this , [param] );
	}.$extends( JobLayer );

	//share property & method
	var pt = FuntypeLayer.prototype;
	
	{zidian}

	pt.getFuntypeSubColNum = function( len ) { return len > 16 ? 2 : 1; }

	pt.initFuntypeLayer = function() {

		//table
		this.createTbl();
		
		//title tr
		this.createTitleTr();

		
		//selected tr
		if ( this.isMulty ) {
			this.createSelectedTr();
			//seprator line
			var tr = this.tbl.insertRow( -1  );
			var td = document.createElement( 'td' );
			td.colSpan =  this.colNum;
			td.className = 'jlSeprator';
			tr.appendChild( td );
		}

		//select trs
		for ( var i = 0 ; i < this.funtypePare.length ; i++ ) {
			this.funtypePare[i]['pareName'] = this.funtypePare[i][this.cfg.fullLang] + '：';
			this.funtypePare[i]['pareClassName'] = 'bigOrange';
			if ( 0 == i % 2 ) {
				this.funtypePare[i]['trClassName'] = 'bgGray';
			}
			this.createSelectTr( this.funtypePare[i] );
		}

		//bottom line
		this.createBottomLine();
	}

	pt.confirmFunc = function( _values ) {
		if ( this._valueNodes ) {
			var _valuesStr = _values.join( ',' );
			for ( var i = 0 ; i < this._valueNodes.length ; i++ ) {
				this._valueNodes[i].value = _valuesStr;
			}
		}
		if ( this._textNodes ) {
			var _textsStr = this.getTextsByValues( _values ).join( '+' ) || this.emptyWords || '选择/修改';
			//var pixelWidth = this.cfg.pixelWidth || ( 'e' == this.cfg.lang ? 15/130 : 12/94 );
			var pixelWidth = 13/95;
			for ( var i = 0 ; i < this._textNodes.length ; i++ ) {
				this.showAutoAdaptText( this._textNodes[i] , _textsStr , pixelWidth );
			}
			try {
				if(typeof(eval(searchFunctypeKeyWords))=="function") {
					searchFunctypeKeyWords( _values , this.cfg.langs.qsrgjz);
				}
			}catch(e){
			}
		}
		this.close();
	}

})();
