/*
	sxFramework 2.1
	by Tobias Jacksteit
*/

function init() {
	// input file based width fix
	if( document.getElementById( 'main_file' ) != undefined ) {
		document.getElementById( 'main_file' ).value = document.getElementById( 'main_file' ).title;
	}
	
	if( document.getElementById( 'main_file_hidden_field' ) != undefined ) {
		document.getElementById( 'main_file_hidden_field' ).style.display = '';
		document.getElementById( 'main_file_hidden_field' ).size = 57;
		sx_addEvent( document.getElementById( 'main_file_hidden_field' ), 'change', onFileSelectChange );
		if( document.getElementById( 'main_file_hidden_field' ).value != '' ) {
			document.getElementById( 'main_file' ).value = document.getElementById( 'main_file_hidden_field' ).value;
		}
	}
}

function onFileSelectChange() {
	document.getElementById( 'main_file' ).value = document.getElementById( 'main_file_hidden_field' ).value;
	document.getElementById( 'main_file' ).className = 'main_file_b';
}

popLayer( 'Die Seite wird geladen, bitte warten...', null, '#FFFFFF' );
sx_addLoad( init );
sx_addLoad( popLayer_hide );