function validate_registration()
{
	$('.err').text('');
	if($('#stud_name').val()=='')
	{
		$('#stud_name').siblings('.err').text('*Full Name Required*');
		$('#stud_name').focus();
		return false;
	}
	
	if($('#stud_email').val()=='')
	{
		$('#stud_email').siblings('.err').text('*Email Address Required*');
		$('#stud_email').focus();
		return false;
	}
	
	if($('#stud_mobile').val()=='')
	{
		$('#stud_mobile').siblings('.err').text('*Mobile Number Required*');
		$('#stud_mobile').focus();
		return false;
	}
	
	/*if($('#password').val()=='')
	{
		$('#password').siblings('.err').text('*Password Required*');
		$('#password').focus();
		return false;
	}*/
	
	var password = $('#password').val();

	var passwordPattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&]).{8,}$/;
	
	if(password == '')
	{
		$('#password').siblings('.err').text('*Password Required*');
		$('#password').focus();
		return false;
	}
	else if(!passwordPattern.test(password))
	{
		$('#password').siblings('.err').text('*Password must be at least 8 characters, include 1 uppercase, 1 lowercase, 1 number, and 1 special character*');
		$('#password').focus();
		return false;
	}
	else
	{
		$('#password').siblings('.err').text('');
	}
	
	if($('#password').val()=='')
	{
		$('#password').siblings('.err').text('*Password Required*');
		$('#password').focus();
		return false;
	}
	
	if($('#stud_education').val()=='')
	{
		$('#stud_education').siblings('.err').text('*Education Level / Degree Required*');
		$('#stud_education').focus();
		return false;
	}
	
	if($('#university_major').val()=='')
	{
		$('#university_major').siblings('.err').text('*University Major/Specialization Required*');
		$('#university_major').focus();
		return false;
	}
	
	if($('#university_name').val()=='')
	{
		$('#university_name').siblings('.err').text('*University Name Required*');
		$('#university_name').focus();
		return false;
	}
	
	if($('#stud_linkedin').val()=='')
	{
		$('#stud_linkedin').siblings('.err').text('*Linkedin Profile Url Required*');
		$('#stud_linkedin').focus();
		return false;
	} 
	
	if($('#stud_address').val()=='')
	{
		$('#stud_address').siblings('.err').text('*Address Required*');
		$('#stud_address').focus();
		return false;
	}
	
	if($('#stud_resume').val()=='')
	{
		$('#stud_resume').siblings('.err').text('*Resume Required*');
		$('#stud_resume').focus();
		return false;
	}
	
	else
	return true;
} 


function validate_login()
{
	
	if($('#email_id').val()=='')
	{
		$('#email_id').siblings('.err').text('*Email Address Required*');
		$('#email_id').focus();
		return false;
	}
	
	
	var password = $('#password').val();

	if(password == '')
	{
		$('#password').siblings('.err').text('*Password Required*');
		$('#password').focus();
		return false;
	}
	
	else if(password.length < 8)
	{
		$('#password').siblings('.err').text('*Password must be at least 8 characters*');
		$('#password').focus();
		return false;
	}
	
	else
	return true;
}

function validate_change_password()
{
	$('.err').html('');
	$('.error').html('');
	if($('#oldpassword').val()=='')
	{
		$('#oldpassword').siblings('.err').html('Enter Old Password');
		$('#oldpassword').focus();
		return false;
	}
	if($('#newpassword').val()=='')
	{
		$('#newpassword').siblings('.err').html('Enter New Password');
		$('#newpassword').focus();
		return false;
	}
	if($('#cnfpassword').val()=='')
	{
		$('#cnfpassword').siblings('.err').html('Confirm Your Password');
		$('#cnfpassword').focus();
		return false;
	}
	if($('#cnfpassword').val()!=$('#newpassword').val())
	{
		$('#cnfpassword').siblings('.err').html('New Password and Confirm Password Not Matching');
		$('#cnfpassword').val('');
		$('#cnfpassword').focus();
		return false;
	}
	return true;
}

//------------- Tranfor Check out To Cart 
function validate_cart(id,status,page,action)
{ 
	if(confirm("Are You Sure To Transfor Courses"))
	{
		location.href=page+"?sid="+id;
	}
	else
	{
		return false;
	}
}

//----------- Transfor Cart To Check Out 
function validate_payment(id,status,page,action)
{ 
	if(confirm("Are You Sure To Proced Payment"))
	{
		location.href=page+"?course_id="+id;
	}
	else
	{
		return false;
	}
}


//------ Add Cart Or Remove Cart
function purchage_status(id,status,page,action)
{ 
	var process="Remove From Cart";
		
	if(confirm("Are You Sure To "+process))
	{
		location.href=page+"?course_id="+id+"&child_id="+status+"&action="+action;
	}
	else
	{
		return false;
	}
}

//--------------- Checkout Function
function validate_status(id,status,page)
{
	if(confirm("Are You Sure to Transfor Courses To Check Out"))
	{
		location.href=page+"?sid="+id+"&status="+status;
	}
	else
	{
		return false;
	}
}

