function validateSetSettings(form)
{
	var upmovies = form.addUpcomming.checked;
	var addmovies =  form.addNew.checked;
	var newComments = form.newComments.checked; 
	var newsLetters = form.newsLetters.checked;
	var friendRequest = form.friendRequest.checked; 
	var approbeProfileCms= form.approbeProfileCms.checked; 
	var profilePrivacy = valButton(form.profilePrivacy); 
	
	
	
	
	doPost('s_mailNotifications', 'php/actions/settings.action.php', {upmovies:upmovies,addmovies:addmovies,newComments:newComments,newsLetters:newsLetters,friendRequest:friendRequest,approbeProfileCms:approbeProfileCms,profilePrivacy:profilePrivacy,method:'updateSettings',reloaded:1}, form.id, '', '', false, '<img src=web/img/other/loading_wheel.gif >');
	


}


function validateSetPwd(form, pwdToShort, pwdNotMatch, fillAllblanks)
{
	var old = form.cOldPwd.value;
	var newPwd = form.newPwd.value;
	var cNewPwd = form.cNewPwd.value;
	var recovery = form.pwdRecovery.value;
	var mail = form.email.value;
	
	if(old.length < 3 || newPwd.length == 0 ||  cNewPwd.length == 0)
	{
		alert(fillAllblanks);
		return false;
	}
	else if(newPwd.length < 8 )
	{
		alert(pwdToShort);
		return false;
	}
	else if(newPwd != cNewPwd)
	{
		alert(pwdNotMatch);
		return false;
	}
	
	if( recovery == "1" )
		doPost('chgResults', 'php/actions/settings.action.php', {oldPwd:old,newPwd:newPwd,pwdRecov:'1',email:mail,method:'setPassword'}, form.id, '', {toHide:'recoverpasswd'}, false, '<img src=web/img/other/loading_wheel.gif >');
	else
		doPost('loadingPassword', 'php/actions/settings.action.php', {oldPwd:old,newPwd:newPwd,method:'setPassword'}, form.id, '', {toHide:'chgPassword'}, false, '<img src=web/img/other/loading_wheel.gif >');
	


}

function validateSetMail(form, notvalidMail, mailNotMatch, fillAllBlanks)
{
	var currentMail = form.currentMail.value.trim();
	var pwd = form.pwd.value.trim();
	var newMail = form.newMail.value.trim();
	var cNewMail = form.cNewMail.value.trim();
	
	if(!isValidEmail(newMail) || !isValidEmail(currentMail))
	{
		alert(notvalidMail);
		return false;
	}
	
	else if(newMail != cNewMail)
	{
		alert(mailNotMatch);
		return false;
	}
	
	else if(currentMail.lenght < 4 || pwd.lenght <8 || newMail.lenght <4 || cNewMail.lenght <4)
	{
		
		alert(fillAllBlanks);
		return false;
	}
	
	doPost('loadingMail', 'php/actions/settings.action.php', {currentMail:currentMail,pwd:pwd,newMail:newMail,method:'setEmail'}, form.id, '', {toHide:'chgMail'}, false, '<img src=web/img/other/loading_wheel.gif >');
	

}


