		j(document).ready(function(){
		j(".textbox_valid").blur(function(){
		if(j(this).isEmpty())
		{	
			j(this).attr('style','border:1px solid #FF0000');		
			j(this).addClass('denied');		
		}
		else if(!j(this).emailCheck() && j(this).attr('id') == 'email_id')
		{   
				j(this).attr('style','border:1px solid #FF0000');		
				j(this).addClass('denied');
		}
		else if(j(this).attr('id') == 'con_password')
		{
				
			if(j('#con_password').val() != j('#password').val())
			{
				
				j(this).attr('style','border:1px solid #FF0000');		
				j(this).addClass('denied');
			}
			else
			{
				j(this).attr('style','border:1px solid #347C17');		
				j(this).removeClass('denied');
				
				
			}
		}		
		else
		{
			j(this).attr('style','border:1px solid #347C17');		
			j(this).removeClass('denied');
			
			
		}
		});
	});
		
		
		function doRegister()
		{
			
				
			
			j(".textbox_valid").blur();
			
			var cssDefault = {
				border: 'none',
				background: 'transparent',
				width:	'250px',
				cursor: 'default',
				top: '150px'
			};
			
			if(j(".denied").length == 0)
			{	
				if(j('#terms:checked').size() != 1)
				{
					j('#termserr').show();
				}
				else
				{
					j('#termserr').hide();
				var param = {
					'action' : 'doRegister',
					'module' : 'user',
					'email_id' : j('#email_id').val(),
					'password' : j('#password').val(),
					'con_password' : j('#con_password').val(),
					'first_name' : j('#first_name').val(),
					'last_name' : j('#last_name').val(),
					'age' : j('#age').val(),
					'gender' : j('.check:checked').val(),
					'status_id' : j('#status_id:selected').val(),
					'country_id' : j('#country_id:selected').val()
					
					};
					//j.unblockUI();
					/*j.blockUI({
						message: '<img src="images/loading.gif" alt="Loading" width="100" height="100" />',
						css: cssDefault,
						overlayCSS: {
							'background-color': '#000000',
							opacity: 0.7
						}
					}); */
					
				j.ajax({
					url: ajaxUrl,
					data: param,
					type: 'POST',
					dataType: 'json',
					success: function(jData){
						//j.unblockUI();
                        j('#ajax-msg').html('<img src="/images/ajax-loader.gif">');
						if(jData.flag)
							window.location.href='welcome.php';
						else
						{
                            j('#ajax-msg').html('');
                            j('#divErrorSuccess').html(jData.message);
							j('#divErrorSuccess').show();
						}
					},
					timeout: 60000,
					error: function(XMLHttpRequest, textStatus, errorThrown){
					
							alert('Error: A critical error occured.');
							j.unblockUI();
					}
					   
				})
				
				}
			}
		}
