var CareersClass = Class.create({
	dateFields : {
		elem1 : {
			id: 'work-permit-date',
			name: 'work-permit-date',
			nameDashed: 'work_permit_date'
		},
		elem2 : {
			id: 'stage-2-start-date',
			name: 'start-date',
			nameDashed: 'start_date'
		},
		elem3 : {
			id: 'stage_3_employment_start_date_1',
			name: 'employment-start-date-1',
			nameDashed: 'employment_start_date_1'
		},
		elem4 : {
			id: 'stage_3_employment_end_date_1',
			name: 'employment-end-date-1',
			nameDashed: 'employment_end_date_1'
		},
		elem5 : {
			id: 'stage_3_employment_start_date_2',
			name: 'employment-start-date-2',
			nameDashed: 'employment_start_date_2'
		},
		elem6 : {
			id: 'stage_3_employment_end_date_2',
			name: 'employment-end-date-2',
			nameDashed: 'employment_end_date_2'
		},
		elem5a : {
			id: 'stage_3_employment_start_date_3',
			name: 'employment-start-date-3',
			nameDashed: 'employment_start_date_3'
		},
		elem6b : {
			id: 'stage_3_employment_end_date_3',
			name: 'employment-end-date-3',
			nameDashed: 'employment_end_date_3'
		},
		elem7 : {
			id: 'stage_4_work_before_start_date',
			name: 'work-before-start-date',
			nameDashed: 'work_before_start_date'
		},
		elem8 : {
			id: 'stage_4_work_before_end_date',
			name: 'work-before-end-date',
			nameDashed: 'work_before_end_date'
		},
		elem9 : {
			id: 'stage_5_holiday_from_date_1',
			name: 'holiday-from-date-1',
			nameDashed: 'holiday_from_date_1'
		},
		elem10 : {
			id: 'stage_5_holiday_to_date_1',
			name: 'holiday-to-date-1',
			nameDashed: 'holiday_to_date_1'
		},
		elem11 : {
			id: 'stage_5_holiday_from_date_2',
			name: 'holiday-from-date-2',
			nameDashed: 'holiday_from_date_2'
		},
		elem12 : {
			id: 'stage_5_holiday_to_date_2',
			name: 'holiday-to-date-2',
			nameDashed: 'holiday_to_date_2'
		},
		elem13 : {
			id: 'stage_5_agreement_date',
			name: 'agreement-date',
			nameDashed: 'agreement_date'
		}
	},

	dateObservationList : {
		id: '',
		name: '',
		nameDashed: ''
	},
	
	maxTextarea : 1000,

        slider_ref : null,
	
	/**
	 * Constructor
	 */
	initialize: function() {
		//do nothing
	},

	/**
	 *
	 */
	loaded: function () {
		// Observe dropdown lists filters in left side
		this.setObserveDropdownList('area');
		this.setObserveDropdownList('store');
		this.setObserveDropdownList('position');
		//this.setObserveDropdownList('vacancy');

		// Observe free-search area
		//Event.observe('careers-free-search-text', 'focus', this.clearSearchText.bindAsEventListener(this));
		//Event.observe('careers-free-search-submit-arrow', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'quicksearch'));

		// Observe search buttons click
		//Event.observe('careers-search-submit-button', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'search'));

		// Observe apply online buttons click
		if ( $p('careers-apply-online-submit-button') ) {
			Event.observe('careers-apply-online-submit-button', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'apply_online'));
		}
		

		// Observe continue buttons click
		if ( $p('careers-app-form-continue-button') ) {
			Event.observe('careers-app-form-continue-button', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'continue'));
		}

		// Observe save application buttons click
		if ( $p('careers-app-form-save-button') ) {
			Event.observe('careers-app-form-save-button', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'save'));
		}

		// Observe preview application button click
		if ( $p('careers-app-form-preview-button') ) {
			Event.observe('careers-app-form-preview-button', 'click', this.displayPreviewApplicationForm.bindAsEventListener(this, false));
		}

		// Observe print blank form button click
		if ( $p('careers-app-form-prit-blank-form-button') ) {
			Event.observe('careers-app-form-prit-blank-form-button', 'click', this.displayPreviewApplicationForm.bindAsEventListener(this, true));
		}
		
		// Observe back buttons click
		if ( $p('careers-app-form-back-button') ) {
			Event.observe('careers-app-form-back-button', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'switch', ($p('current_stage_id').value-1)));
		}
		
		
		
		// Observe stages bar click
		if ( $p('stage_1_switch_click') ) {
			Event.observe('stage_1_switch_click', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'switch', '1'));
		}
		if ( $p('stage_2_switch_click') ) {
			Event.observe('stage_2_switch_click', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'switch', '2'));
		}
		if ( $p('stage_3_switch_click') ) {
			Event.observe('stage_3_switch_click', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'switch', '3'));
		}
		if ( $p('stage_4_switch_click') ) {
			Event.observe('stage_4_switch_click', 'click', this.submitSearchForm.bindAsEventListener(this, null, 'switch', '4'));
		}

		// Initiate scroller for selected stage, right now for stage 3 and stage 4
		if ( $p('current_stage_id') ) {
			var stage_id = $p('current_stage_id').value;
			switch ( stage_id ) {
				case '1':
				case '3':
				case '4':                                        
				case '5':
					this.initiateScroller('stage_'+stage_id+'_scroller_container', 'stage_'+stage_id+'_div_to_scroll', 'stage_'+stage_id+'_scroller', 'stage_'+stage_id+'_container', 520, true);
				break;
			}

			if ( stage_id == 2 ) {
				Event.observe('availability_select_all', 'click', this.selectAllAvailabilityBox.bindAsEventListener(this));
			}
			else if ( stage_id == 3 ) {
				Event.observe('stage_3_summary_of_responsibility_1', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_reason_for_leaving_1', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_summary_of_responsibility_2', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_reason_for_leaving_2', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_summary_of_responsibility_3', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_reason_for_leaving_3', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_3_skills', 'keyup', this.countCharacters.bindAsEventListener(this));
			}
			else if ( stage_id == 4 ) {
				Event.observe('stage_4_summary_of_responsibility', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_4_reason_for_leaving', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_4_brand_question_1', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_4_brand_question_2', 'keyup', this.countCharacters.bindAsEventListener(this));
				Event.observe('stage_4_brand_question_3', 'keyup', this.countCharacters.bindAsEventListener(this));
			}
		}

		// Observe all available dates lists
		this.setObserveDropdownListDate();
		/*
		// Observe mouse move to check if we should hide dropdown lists
		if ( $p('careers-container-left-body') ) {
			Event.observe('careers-container-left-body', 'mousemove', this.hideDropdownList.bindAsEventListener(this));
		}
		*/
		/*
		if ( $p('stage_1_div_to_scroll') ) {
			Event.observe('stage_1_div_to_scroll', 'mousemove', this.hideDropdownList.bindAsEventListener(this));
		}
		else if ( $p('stage_3_div_to_scroll') ) {
			Event.observe('stage_3_div_to_scroll', 'mousemove', this.hideDropdownList.bindAsEventListener(this));
		}
		else if ( $p('stage_4_div_to_scroll') ) {
			Event.observe('stage_4_div_to_scroll', 'mousemove', this.hideDropdownList.bindAsEventListener(this));
		}
		else if ( $p('careers-container-right-body') ) {
			Event.observe('careers-container-right-body', 'mousemove', this.hideDropdownList.bindAsEventListener(this));
		}
	*/
		if ( $p('terms-and-cond-link') ) {
			Event.observe('terms-and-cond-link', 'click', this.displayTermsAndCondition.bindAsEventListener());
		}	
		
	
	},

	displayPreviewApplicationForm: function(E, isEmpty) {
                var link = null;
		if ( isEmpty == true ) {
			link = '/careers/?func=print_empty';
		}
		else {
			var application_id = document.forms['careers-filters-content'].application_id.value ?
                                            document.forms['careers-filters-content'].application_id.value :
                                            $p('application_id').getValue();
			link = '/careers/?func=preview&id=' + application_id;
		}

		window.open(link, 'preview', 'scrollbars=yes,menubar=yes,height=600,width=840,resizable=yes,toolbar=no,status=1');
	},

	selectAllAvailabilityBox: function(E) {
		var checked = E.element().checked;
		var list = $$p('#availability_div input');
		for ( var i = 0; i < list.length; i++) {
			list[i].checked = checked;
		}
	},

	countCharacters: function(E) {
		var count = $p(E.element().id).value.length;
		if ( count > this.maxTextarea ) {
			$p(E.element().id).value = $p(E.element().id).value.truncate(this.maxTextarea, '');
		}
		else {
			$p(E.element().id + '_characters').innerHTML = translateObject.translate('available','available')+ ' ' + (this.maxTextarea - count) + ' ' +translateObject.translate('characters','characters');
		}
	},

	/**
	 * Observe dropdown dates lists - each one has similar structure
	 *
	 * Observe dropdown date lists arrow click
	 *
	 * @return	{void}
	 */
	setObserveDropdownListDate: function() {
		for ( var obj in this.dateFields ) {
			if ( $p(this.dateFields[obj].id) ) {
				this.setObserveDropdownArrowClick( this.dateFields[obj].name, this.dateFields[obj].nameDashed, this.dateFields[obj]);
			}
		}

		// Observe year lists in stage 3
		if ( $p('current_stage_id') && $p('current_stage_id').value == '3') {
			for ( var i=1; i<=4; i++ ) {
				this.setObserveDropdownList('education-end-year-1-' + i, 'education_end_year_1_' + i, true);
				this.setObserveDropdownList('education-end-year-2-' + i, 'education_end_year_2_' + i, true);
				this.setObserveDropdownList('education-end-year-3-' + i, 'education_end_year_3_' + i, true);
			}
		}
	},

	setObserveDropdownArrowClick: function(elem, nameDashed, dateFieldsObj) {
		Event.observe('careers-'+elem+'-day'+'-dropdown-arrow', 'click', this.showDropdownList.bindAsEventListener(this, elem+'-day', nameDashed+'_day', dateFieldsObj, 'day'));
		Event.observe('careers-'+elem+'-month'+'-dropdown-arrow', 'click', this.showDropdownList.bindAsEventListener(this, elem+'-month', nameDashed+'_month', dateFieldsObj, 'month'));
		Event.observe('careers-'+elem+'-year'+'-dropdown-arrow', 'click', this.showDropdownList.bindAsEventListener(this, elem+'-year', nameDashed+'_year', dateFieldsObj, 'year'));
	},

	/**
	 * Observe dropdown lists
	 */
	setObserveDropdownList: function(elem, nameDashed, setHiddenValueOnClick) {
	
		Event.observe('careers_'+ elem+'_id_list', 'change', this.submitSearchForm.bindAsEventListener(this, elem, 'search_from_select'));
	
	
		var list = $$p('#careers-'+elem+'-dropdown-list option');
		
		// If this is the date list, then click action will be set value to selected
		if ( setHiddenValueOnClick == true ) {
			for ( var i = 0; i < list.length; i++) {
				Event.observe(list[i], 'mouseover', this.highlightDropdownListElement.bindAsEventListener(this, true));
				Event.observe(list[i], 'mouseout', this.highlightDropdownListElement.bindAsEventListener(this, false));

				Event.observe(list[i], 'click', this.setHiddenValue.bindAsEventListener(this, elem, nameDashed));
			}
		}
	
	},

	/**
	 * Set hidden value for select lists
	 *
	 * @param	{Event}
	 * @param	{String}	Element name, with '-'
	 * @param	{String}	Element dashed name, with '_'
	 *
	 * @return	{void}
	 */
	setHiddenValue: function(E, name, nameDashed) {
		if ( $p('id_' + nameDashed) ) {
			var newValue = E.element().id.replace(nameDashed+'_', '');
			$p('id_' + nameDashed).value = newValue;
			$p('careers-' + name + '-title').innerHTML = newValue;
		}
		
		
	},

	/**
	 * Add visualisation efect for dropdown lists
	 *
	 * @param	{Event}
	 * @param	{boolean}	true - mouse cursor is in, false - mouse cursor is out
	 *
	 * @return	{void}
	 */
	highlightDropdownListElement: function(E, isIn) {
		try {
			if ( isIn == true ) {
				$p(E.element().id).style.borderTop = "1px solid #959595";
				$p(E.element().id).style.borderBottom = "1px solid #959595";
			}
			else {
				$p(E.element().id).style.border = "1px solid #f7f6f4";
			}
		} catch(e) {}
	},

	/**
	 * Show dropdown list
	 *
	 * @param	{Event}
	 * @param	{String}
	 * @param	{String}
	 *
	 * @return	{void}
	 */
	showDropdownList: function(E, name, nameDashed, dateFieldsObj, dateType) {
		
		switch(name) {
			case 'area':
			case 'store':
			case 'position':
				$p('careers-' + name + '-dropdown-list').show();
				this.initiateScroller( name + '_scroller_container', name + '_uls', name + '_scroller', 'careers-' + name + '-dropdown-list', 200);

				
			break;
			//this is for date lists
			
			default:
				if ( $p('careers-' + name + '-dropdown-list') ) {
					$p('careers-' + name + '-dropdown-list').show();
					this.initiateScroller(nameDashed + '_scroller_container', nameDashed + '_uls', nameDashed + '_scroller', 'careers-' + name + '-dropdown-list', 100, false, dateFieldsObj, dateType);
				}
			break;
		}
	},

	/**
	 * Hide dropdown lists if required
	 *
	 * @param	{Event}
	 *
	 * @return	{void}
	 */
	hideDropdownList: function(E) {
		this.hideDropdownListSelected(E.element(), 'careers-area-dropdown-list', 'careers-area-dropdown-div');
		//this.hideDropdownListSelected(E.element(), 'careers-region-dropdown-list', 'careers-region-dropdown-div');
		this.hideDropdownListSelected(E.element(), 'careers-position-dropdown-list', 'careers-position-dropdown-div');
		//this.hideDropdownListSelected(E.element(), 'careers-vacancy-dropdown-list', 'careers-vacancy-dropdown-div');
		this.hideDropdownListSelected(E.element(), 'careers-store-dropdown-list', 'careers-store-dropdown-div');

		// Hide all dates lists
		this.hideDropdownListDate(E);
	},

	/**
	 * Hidding dates lists if require
	 *
	 * @param	{Event}
	 *
	 * @return	{void}
	 */
	hideDropdownListDate: function(E) {
		if ( this.dateObservationList.id ) {
			this.hideDropdownListSelected( E.element(), 'careers-' + this.dateObservationList.name + '-dropdown-list', 'careers-' + this.dateObservationList.name + '-dropdown-div');

			if ( !$p('careers-' + this.dateObservationList.name + '-dropdown-list').visible() ) {

				var list = $$p('#careers-'+this.dateObservationList.name+'-dropdown-list li');
				// If this is the date list, then click action will be set value to selected
				for ( var i = 0; i < list.length; i++) {
					Event.stopObserving(list[i], 'mouseover', this.highlightDropdownListElement.bindAsEventListener(this, true));
					Event.stopObserving(list[i], 'mouseout', this.highlightDropdownListElement.bindAsEventListener(this, false));

					Event.stopObserving(list[i], 'click', this.setHiddenValue.bindAsEventListener(this, this.dateObservationList.name, this.dateObservationList.nameDashed));
				}

				this.dateObservationList.id = '';
				this.dateObservationList.name = '';
				this.dateObservationList.nameDashed = '';
			}
		}

		// Small hack to hide year date fields in education section
		if ( $p('current_stage_id') && $p('current_stage_id').value == '3') {
			for ( var i=1; i<=4; i++ ) {
				this.hideDropdownListSelected(E.element(), 'careers-education-end-year-1-'+i+'-dropdown-list', 'careers-education-end-year-1-'+i+'-dropdown-div');
				this.hideDropdownListSelected(E.element(), 'careers-education-end-year-2-'+i+'-dropdown-list', 'careers-education-end-year-2-'+i+'-dropdown-div');
				this.hideDropdownListSelected(E.element(), 'careers-education-end-year-3-'+i+'-dropdown-list', 'careers-education-end-year-3-'+i+'-dropdown-div');
			}
		}
	},

	/**
	 * Check and hide the list
	 *
	 * @param	{String}
	 * @param	{String}
	 * @param	{String}
	 *
	 * @return	{void}
	 */
	hideDropdownListSelected: function(elem, elemId, containerId) {
		if ( elem.descendantOf($$p('#' + elemId + ' ul').first()) == false && elem.ancestors().indexOf($p(containerId)) == -1) {
			$p(elemId).hide();
		}
	},

	/**
	 * Crear free searchtext field
	 *
	 * @param	{Event}
	 *
	 * @return	{void}
	 */
	clearSearchText: function(E) {
		var target = E.element();
		if ( target.value == 'Keyword Search' ) {
			target.value = '';
		}
	},

	/**
	 * Set some variables (if required), and submit the form
	 *
	 * @param	{Event}
	 * @param	{String}
	 * @param	{String}
	 *
	 * @return	{void}
	 */
	submitSearchForm: function(E, elem, submitButtonClick, stageIdToSwitch) {
		
		var elemId = '';
		var form = document.forms['careers-filters-content'];

		switch ( submitButtonClick ) {
			case 'search':			
				form.vacancy_search_click.value = 'search';
				//form.searchtext.value = '';
				form.vacancy_id.value = '';
				form.vacancy_apply_online_click.value = '';
			break;
			case 'search_from_select':
				form.vacancy_search_click.value = 'search';
				//form.searchtext.value = '';
				form.vacancy_id.value = '';
				form.vacancy_apply_online_click.value = '';
					switch(elem) {
					case 'area':
						
						form.area_id.value = $p('careers_area_id_list').getValue();
						//form.vacancy_id.value = '';
						//form.searchtext.value = '';
						//form.vacancy_search_click.value = '';
						form.store_id.value ='all';
						form.view_detail.value ='';
						form.position_id.value = 'all';
					break;
					case 'store':
						form.area_id.value = $p('careers_area_id_list').getValue();
						form.store_id.value = $p('careers_store_id_list').getValue();
						form.position_id.value = 'all';
						form.view_detail.value ='';
						//form.vacancy_id.value = '';
						//form.searchtext.value = '';					
						//form.vacancy_search_click.value = '';
					break;
					case 'position':
						form.area_id.value = $p('careers_area_id_list').getValue();
						form.store_id.value = $p('careers_store_id_list').getValue();
						form.position_id.value = $p('careers_position_id_list').getValue();
						form.view_detail.value ='';
						//form.vacancy_id.value = '';
						//form.searchtext.value = '';
						//form.vacancy_search_click.value = '';
					break;
					default:
					break;
					}
			
			break;
			case 'quicksearch':
				form.vacancy_search_click.value = 'quicksearch';
				form.vacancy_id.value = '';
				form.vacancy_apply_online_click.value = '';
			break;
			case 'apply_online':
				form.vacancy_apply_online_click.value = 'apply_online';
				if ( form.stage_id ) {
					form.stage_id.value = '1';
				}
			break;
			case 'continue':
				$p('careers-application-form-processing_msg').show();
				form.careers_app_form_func.value = 'continue';
			break;
			case 'save':
				form.careers_app_form_func.value = 'save';
			break;
			case 'switch':
				form.careers_app_form_func.value = 'switch';
				form.stage_id.value = stageIdToSwitch;
			break;
			default :
				form.vacancy_apply_online_click.value = '';

				switch(elem) {
					case 'area':
						
						form.area_id.value = E.element().id.replace(/area\_/, '');
						form.vacancy_id.value = '';
						//form.searchtext.value = '';
						form.vacancy_search_click.value = '';
						form.store_id.value ='xx';
						form.position_id.value = 'xx';
					break;
					case 'store':
						form.store_id.value = E.element().id.replace(/store\_/, '');
						form.vacancy_id.value = '';
						//form.searchtext.value = '';
						
						form.vacancy_search_click.value = '';
					break;
					case 'position':
						form.position_id.value = E.element().id.replace(/position\_/, '');
						form.vacancy_id.value = '';
						//form.searchtext.value = '';
						form.vacancy_search_click.value = '';
					break;
					case 'vacancy':
						form.vacancy_id.value = E.element().id.replace(/vacancy\_/, '');
					break;
				}
			break;
		}

		setTimeout(function() {document.forms['careers-filters-content'].submit();}, 200);
	},
	
	

	/**
	 * Initiate scroller if required
	 *
	 * @param	{String}
	 * @param	{String}
	 * @param	{String}
	 * @param	{String}
	 *
	 * @return	void
	 */
	initiateScroller : function(containerId, boxId, scrollerId, divId, scrollfieldHeight, dontChangeContainerSize, dateFieldsObj, dateType) {
		var container = $p(containerId);
		var box = $p(boxId);
		var	scroller = $p(scrollerId);
		var divId = $p(divId);

		if ( typeof(dateFieldsObj) != 'undefined' ) {
			this.dateObservationList.id = dateFieldsObj.id + '-' + dateType;
			this.dateObservationList.name = dateFieldsObj.name + '-' + dateType;
			this.dateObservationList.nameDashed = dateFieldsObj.nameDashed + '_' + dateType;

			var list = $$p('#careers-'+this.dateObservationList.name+'-dropdown-list li');
			// If this is the date list, then click action will be set value to selected
			for ( var i = 0; i < list.length; i++) {
				Event.observe(list[i], 'mouseover', this.highlightDropdownListElement.bindAsEventListener(this, true));
				Event.observe(list[i], 'mouseout', this.highlightDropdownListElement.bindAsEventListener(this, false));

				Event.observe(list[i], 'click', this.setHiddenValue.bindAsEventListener(this, this.dateObservationList.name, this.dateObservationList.nameDashed));
			}
		}
		else {
			var elemTemp = null;
			switch ( containerId ) {
				case 'area_scroller_container' :
					elemTemp = 'area';
				break;
				case 'region_scroller_container' :
					elemTemp = 'region';
				break;
				case 'store_scroller_container' :
					elemTemp = 'store';
				break;
				case 'position_scroller_container' :
					elemTemp = 'position';
				break;
				case 'vacancy_scroller_container' :
					elemTemp = 'vacancy';
				break;
			}

			if ( elemTemp != null ) {
				var list = $$p('#careers-'+elemTemp+'-dropdown-list li');
				for ( var i = 0; i < list.length; i++) {
					Event.observe(list[i], 'mouseover', this.highlightDropdownListElement.bindAsEventListener(this, true));
					Event.observe(list[i], 'mouseout', this.highlightDropdownListElement.bindAsEventListener(this, false));

					Event.observe(list[i], 'click', this.submitSearchForm.bindAsEventListener(this, elemTemp, false));
				}
			}
		}

		if ( !scrollfieldHeight ) {
			scrollfieldHeight = 200;
		}

		if ( divId.getHeight() > scrollfieldHeight ) {
			divId.setStyle({height: scrollfieldHeight + 'px'});
		}

		// Small hack to use same function for application form and select lists
		if ( dontChangeContainerSize == true ) {
		}
		else {
			container.setStyle({height: $p(divId).getHeight() + 'px'});
		}

		var height = box.getHeight();
		if(height > scrollfieldHeight) {
			this.slider_ref = new Control.Slider(scroller, container, {
				  axis:'vertical',
				  range: $R(0, (box.getHeight() - scrollfieldHeight)),
				  minimum: 29,
				  maximum: scrollfieldHeight,
				  alignX: 0,
				  alignY: 0,
				  disabled: false,
				  onSlide: function(value) {
			        box.setStyle({ position: 'relative', top: -value + 'px' });
			      },
			      onChange: function(value) {
			    	  box.setStyle({ position: 'relative', top: -value + 'px' });
			      }
			});                       
		}
		else {
			container.hide();
			divId.setStyle({
				height: height + "px"
			});
		}
	},

	/**
	 * Display window with terms and conditional
	 */
	displayTermsAndCondition: function() {
		window.open('/careers/?func=terms', 'terms', 'scrollbars=yes,menubar=yes,height=600,width=840,resizable=yes,toolbar=no,status=1');
	},

        refreshSlider : function() {            
            this.slider_ref = null;
            this.initiateScroller('stage_5_scroller_container', 'stage_5_div_to_scroll', 'stage_5_scroller', 'stage_5_container', 520, false);
        }

});

// Create object instance of CareersClass class
var careers = new CareersClass();
Event.observe(window, "load", careers.loaded.bind(careers));

