/**
 * Signup js functions
 *
 * @author Constantin I
 */


$('document').ready(function() {

	$('#sigup_step').attr({
		target : '_self',
		method : 'post'
	});
	
	if (location.href.indexOf('page_1.html') > -1 || location.href.indexOf('/page_') == -1) { 
		

		
		$('#user_type_add_button').click(function(){
			if (jSSaccount.userTypes.left_list.selectedIndex > -1) {
				jSSaccount.userTypes.moveRight(jSSaccount.userTypes.left_list.options[jSSaccount.userTypes.left_list.selectedIndex]);
			}
		});

		$('#user_type_remove_button').click(function(){
			if (jSSaccount.userTypes.right_list.selectedIndex > -1) {
				jSSaccount.userTypes.moveLeft(jSSaccount.userTypes.right_list.options[jSSaccount.userTypes.right_list.selectedIndex]);
			}
		});

		jSSaccount.password.init();
		
		
		$('#submit_page_1').click(function(){
			$('#sigup_step').submit();
			return false;
		});
				
		
		

		var user_picture = $('#user_picture').val();
		
		if (user_picture) {
			
			$("#profile_picture").attr({
				src : "/view.php?tmp=" + user_picture
			});
		}
			

		
	}
	

});



function uploaderState(pState) {
	jSSaccount.imageUpload.manualUploadUpdate(pState);
}

