
post_flag=0;
company_flag=0;
var my_register_class = Class.create({ 
	initialize: function(args) {
		this.args = args || new Array();
		this.post_flag=0;
		this.createEvents();
		if(args['checkboxes'] == 0) {
			$('clients_post_as_main').checked=true;
			$('clients_is_company').checked=true;	
		}
		
		if(args['is_change']) {
			if(args['check_post'] == 0) {
				$('clients_post_as_main').checked=false;		
			} else {
				$('clients_post_as_main').checked=true;
			}
			if(args['check_company'] == 0) {
				$('clients_is_company').checked=false;		
			} else {
				$('clients_is_company').checked=true;
			}
		}
		
		
		if($('clients_post_as_main').checked == true) {
			$$('.signup_post').each(function(id) {
					$(id).hide();
				});
		} else {
			post_flag=1;
		}
		if($('clients_is_company').checked == false) {	
			$$('.signup_company').each(function(id) {
					$(id).hide();
				});
		} else {
			company_flag=1;
		}
	},
	
	post_handler: function() {
		//if()
		//flag=this.post_flag;
		//flag_ar=$A(arguments);
		//flag_ar.shift();
		//flag=flag_ar[0];	
  		if(post_flag == 0) {
			$$('.signup_post').each(function(id) {
					$(id).show();
				}
			);	
				post_flag=1;
		} else {
				$$('.signup_post').each(function(id) {
					$(id).hide();
				}
			);	
			post_flag=0;
		}
				
		//this.post_flag=flag;		
		
		
	}, 

	company_handler: function() {

  		if(company_flag == 0) {
			$$('.signup_company').each(function(id) {
					$(id).show();
				}
			);	
				company_flag=1;
		} else {
				$$('.signup_company').each(function(id) {
					$(id).hide();
				}
			);	
			company_flag=0;
		}
				
		
		
	}, 
	
	createEvents: function() {

		Event.observe($('clients_post_as_main'), 'click', this.post_handler);
		Event.observe($('clients_is_company'), 'click', this.company_handler);

		
	}

	
});
