/* */

function display_user_trust(oElement){
	var parent = oElement.parentNode.parentNode;
	var aEo = $('li',parent);
	$(aEo).css('display','block');
	$(oElement.parentNode).css('display','none');
}

var myDataSource, lastQuerySend;
var myAutoComp = new Array();

var TagControl = {
	init: function(){
		var me = this;
		this.oAdd = $('.interests [interest]');
		this.post_sending = false;
		
		
		for(var i = 0, l = this.oAdd.length; i < l; i++){
			this.autocomplete(this.oAdd[i]);
		}
		
		add(this.oAdd,'click', function(){
			var input = $('input',this.parentNode.parentNode)[0];
			if(!input)
				return;
			var text = input.value;
			if(!YAHOO.lang.trim(text).length || me.post_sending)
				return;
			var obj = this;
			var interest = this.getAttribute('interest');
			if(input.d_value && input.value == input.title)
				return;
			me.post_sending = true;
			sorry.registration.post('/xml/', 'request=set&raction=client_interest&sub_type='+interest+'&name='+text, function(o){
				me.post_sending = false;
				try {
					var response = YAHOO.lang.JSON.parse(o.responseText).response;
					if(response.result){
						input.value = input.d_value ? input.title : '';
						if(input.e_class)
							$(input).addClass(input.e_class);
						var el = document.createElement('li');
						if(parseInt(response.count) > 1)
							el.innerHTML = '<a href="http://'+sorry.host+'/'+interest+'/'+response.name+'/">'+response.name+'</a><sub class="cnt">'+response.count+'</sub>';
						else
							el.innerHTML = response.name;
						el.innerHTML += '<span class="action"><span class="pseudo" onclick="TagControl.remove(this)" interest="'+interest+'" tag_id="'+response.id+'"><img class="it-tagdel" src="/f/e.gif"/></span></span>';
						obj.parentNode.parentNode.parentNode.insertBefore(el, obj.parentNode.parentNode);
						$(el).css('display','none').show(150);
						Global.Pseudo.init(el);
					}
				} catch (e) { }
			});
		});
	}
	, autocomplete: function(oElement){
		myDataSource = new YAHOO.widget.DS_XHR('/xml/', ["response.taglist", "title"]);
		myDataSource.scriptQueryAppend = 'request=get&amp;raction=taglist';
		myDataSource.scriptQueryParam = 'tag';
		myDataSource.responseType = YAHOO.widget.DS_XHR.TYPE_JSON;
		myDataSource.maxCacheEntries = 50;

		var interest = oElement.getAttribute('interest');
		var i = myAutoComp.length;
		myAutoComp[i] = new YAHOO.widget.AutoComplete('text_'+interest, 'autocomplete_'+interest, myDataSource);
		myAutoComp[i].useShadow = true;
		myAutoComp[i].animSpeed = 0.1;
		myAutoComp[i].queryDelay = 0.3;
		myAutoComp[i].maxResultsDisplayed = 15;
		
		myAutoComp[i].tmFunction = myAutoComp[i]._sendQuery;
		myAutoComp[i]._sendQuery = function(sQuery){
			if(lastQuerySend == sQuery)
				return;
			lastQuerySend = sQuery;
			myAutoComp[i].tmFunction(sQuery);
		};
	}
	, remove: function(oElement){
		var el = oElement.parentNode.parentNode;
		var id = oElement.getAttribute('tag_id');
		var interest = oElement.getAttribute('interest');
		if(!id)
			return;
		sorry.registration.post('/xml/', 'request=remove&raction=client_interest&sub_type='+interest+'&interest='+id, function(o){
			try {
				var response = YAHOO.lang.JSON.parse(o.responseText).response;
				if(response.result){
					$(el).hide(250);
				}
			} catch (e) { }
		});
	}
};

/*
var UploaderImages = {
	init: function(){
		var me = this;
		add($('.change .pseudo'),'click',function(){
			PopupGallery.show('upload');
		});
	}
};
*/

var UploaderPics = {
	sPathUserPic: false,
	sPathUserImage: false,
	init: function(){
		var me = this;
		this.storage_server = 'http://'+sorry.storage;
		this.sPathUserPic = sorry.userpic;
		this.sPathUserImage = sorry.userimage;
		add($('.change .pseudo'),'click',function(){
			var oForm = $('form',this.parentNode.parentNode)[0];
			if(!oForm)
				return;
			var step1 = this.parentNode;
			YAHOO.util.Dom.setStyle(step1,'display','none');
			YAHOO.util.Dom.setStyle(oForm,'display','block');
			me.file_submit(oForm, step1);
		});
	}
	, file_submit: function(oForm, oStep1){
		var form = oForm, me = this;
		var oWaiting = $('.upload_pic_waiting',form.parentNode);
		$(oForm).ajaxForm({
			beforeSubmit: function(a,f,o) {
				YAHOO.util.Dom.setStyle(oWaiting,'display','block');
				YAHOO.util.Dom.setStyle(form,'display','none');
			},
			complete: function(data){
				setTimeout(function(){
					YAHOO.util.Dom.setStyle(oWaiting,'display','none');
					YAHOO.util.Dom.setStyle(oStep1,'display','block');
					me.update_user_pics();
				}, 300);
			}
		});
		return false;
	}
	, update_userpic: function(){
		var me = this;
		if(!this.sPathUserPic){
			sorry.registration.post('/xml/', 'request=get&raction=userpic', function(o){
				try {
					var response = YAHOO.lang.JSON.parse(o.responseText).response;
					me.sPathUserPic = response.userpic;
				} catch (e) { }
			});
		}
		var img1 = $('#header .usercard img.pic');
		var img2 = $('#content .profile_head .userpic img.pic');
		if(this.sPathUserPic && img1.length && img2.length){
			var random = Math.ceil(1000*Math.random());
			img1[0].src = this.storage_server+this.sPathUserPic+'30px'+'?'+random;
			img2[0].src = this.storage_server+this.sPathUserPic+'100px'+'?'+random;
		}
	}
	, update_userimage: function(){
		var me = this;
		if(!this.sPathUserImage){
			sorry.registration.post('/xml/', 'request=get&raction=userimage', function(o){
				try {
					var response = YAHOO.lang.JSON.parse(o.responseText).response;
					me.sPathUserImage = response.userimage;
				} catch (e) { }
			});
		}
		var img = $('img#main_userimage');
		if(this.sPathUserImage && img.length){
			var random = Math.ceil(1000*Math.random());
			img[0].src = this.storage_server+this.sPathUserImage+'320px'+'?'+random;
		}
	}
	, update_user_pics: function(){
		this.update_userpic();
		this.update_userimage();
	}
};

var ContactEdit = {
	init: function(){
		var oViewAble, access, me = this;
		this.oViewAble = $('#content ul.contacts .viewable');
		for(var i = 0, l = this.oViewAble.length; i < l; i++){
			oViewAble = this.oViewAble[i];
			oViewAble.editable = YAHOO.util.Dom.getNextSibling(oViewAble);
			oViewAble.aInput = $('input[type="text"]', oViewAble.editable)[0];
			oViewAble.aText = YAHOO.lang.trim(oViewAble.innerHTML);
			oViewAble.aInput.def_value = (oViewAble.aInput.value != oViewAble.aInput.title ? oViewAble.aInput.value : '');
			oViewAble.aEdit = $('.edit_controls .edit', oViewAble.parentNode);
			oViewAble.aSave = $('.edit_controls .save', oViewAble.parentNode);
			oViewAble.aCancel = $('.edit_controls .cancel', oViewAble.parentNode);
			oViewAble.aSaving = $('.edit_controls .saving', oViewAble.parentNode);
			oViewAble.field_id = oViewAble.aInput.getAttribute('field_id');
			oViewAble.access = $('[access_status]', oViewAble.parentNode)[0];
			this.init_object(oViewAble);
		}
	}
	, init_object: function(oElement){
		var me = this;
		if(!oElement.aText.length){
			this.view_editable(oElement, true);
			YAHOO.util.Dom.setStyle(oElement.access,'display','none');
		} else {
			this.view_editable(oElement, false);
		}
		add(oElement.aEdit, 'click', function(){
			if(oElement.editable.style.display != 'none'){
				me.view_editable(oElement);
			} else {
				me.view_editable(oElement, true);
			}
			YAHOO.util.Dom.setStyle(oElement.aCancel,'display','inline');
		});
		add(oElement.aCancel, 'click', function(){
			if(YAHOO.lang.trim(oElement.innerHTML).length){
				me.view_editable(oElement);
			}
			enableSave();
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aCancel,'display','none');
			if(YAHOO.lang.trim(oElement.aInput.value) && oElement.aInput.value != oElement.aInput.title){
				oElement.aInput.value = oElement.aInput.def_value;
			}
		});
		var enableCancel = function(){
			if(!oElement.aText.length)
				YAHOO.util.Dom.setStyle(oElement.aCancel,'display','none');
			if(!YAHOO.lang.trim(oElement.aInput.value).length || oElement.aInput.value == oElement.aInput.def_value || oElement.aInput.value == oElement.aInput.title){
				return false;
			}
			if(oElement.aText.length)
				YAHOO.util.Dom.setStyle(oElement.aCancel,'display','inline');
			return true;
		};
		this.TimerCheckEmail = false;
		this.cache_email = [];
		var check_email = function(){
			var regexp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
			var regexp = /^[\w-](\.?[\w-])*(\+?\w*)?@[\w-](\.?[\w-])*\.[a-z]{2,}$/i;
			if(!regexp.test(oElement.aInput.value))
				return false;
			var aEmail = me.cache_email[oElement.aInput.value];
			if(!aEmail){
				clearTimeout(this.TimerCheckEmail);
				this.TimerCheckEmail = setTimeout(function(){
					sorry.registration.post('/xml/', 'request=check&raction=sorry_email&name='+oElement.aInput.value, function(o){
						try {
							var response = YAHOO.lang.JSON.parse(o.responseText).response;
							me.cache_email[oElement.aInput.value] = {result: response.result, error: (response.error ? response.error : 0)};
							enableSave();
						} catch (e) { }
					});
				}, 500);
				return false;
			} else {
				if(aEmail.error || !aEmail.result){
					return false;
				} else {
					return true;
				}
			}
		};
		var enableSave = function(){
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','none');
			if(!enableCancel())
				return false;
			switch(oElement.aInput.name){
				case'email':
						if(!check_email())
							return false;
					break;
				case 'icq':
						var regexp = /^([- 0-9]+)$/i;
						if(!regexp.test(oElement.aInput.value))
							return false;
				default:
					break;
			}
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','inline');
			return true;
		};
		add(oElement.aInput, 'focus', enableSave);
		add(oElement.aInput, 'keyup', enableSave);
		add(oElement.aInput, 'change', enableSave);
		add(oElement.aInput, 'blur', enableSave);
		
		add(oElement.aSave, 'click', function(){
			if(!enableSave())
				return;
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aCancel,'display','none');
			$(oElement.aSaving).fadeIn(800);
			this.TimerCheckEmail = setTimeout(function(){
				sorry.registration.post('/xml/', 'request=profile&raction=profile_field&value='+oElement.aInput.value+'&code='+oElement.aInput.name+(oElement.field_id ? '&field_id='+oElement.field_id : '' ), function(o){
					YAHOO.util.Dom.setStyle(oElement.aSaving,'display','none');
					try {
						var response = YAHOO.lang.JSON.parse(o.responseText).response;
						if(response.result == 'true'){
							if(oElement.aInput.name == 'email'){
								oElement.aText = oElement.innerHTML = '<a href="mailto:'+response.value+'">'+response.value+'</a>';
							} else {
								oElement.aText = oElement.innerHTML = response.value;
							}
							oElement.aInput.value = oElement.aInput.def_value = response.value;
							me.view_editable(oElement);
							YAHOO.util.Dom.setStyle(oElement.access,'display','inline');
							oElement.access.setAttribute('raction','profile');
							oElement.access.setAttribute('obj_id',response.field_id);
						} else {
							YAHOO.util.Dom.setStyle(oElement.aSave,'display','inline');
							YAHOO.util.Dom.setStyle(oElement.aCancel,'display','inline');
						}
					} catch (e) { }
				});
			}, 100);
		});
	}
	, view_editable: function(oElement, view){
		if(view){
			YAHOO.util.Dom.setStyle(oElement,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aEdit,'display','none');
			YAHOO.util.Dom.setStyle(oElement.editable,'display','inline');
			YAHOO.util.Dom.setStyle(oElement.aCancel,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','none');
		} else {
			YAHOO.util.Dom.setStyle(oElement,'display','inline');
			YAHOO.util.Dom.setStyle(oElement.aEdit,'display','inline');
			YAHOO.util.Dom.setStyle(oElement.editable,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aSave,'display','none');
			YAHOO.util.Dom.setStyle(oElement.aCancel,'display','none');
		}
	}
}

var ProfileEdit = {
	init: function(){
		var me = this;
		this.oButtonEdit = $('.col2 .edit_profile .edit');
		this.oButtonSave = $('.col2 .edit_profile .save');
		this.oSaving = $('.col2 .edit_profile .saving');
		if(!this.oButtonEdit.length)
			return;
		
		this.oTrust = $('.col2 .count_trust');
		if(this.oTrust.length){
			this.oTrust = this.oTrust[0];
			this.oTrust.text = $('.col2 .count_trust_text')[0];
			UserCard2.callback_trust_remove = function(){ me.update_count_trust(); };
		}
		
		this.oName = $('.profile_head .view_name')[0];
		this.oName.eElement = $('.edit_name', this.oName.parentNode)[0];
		this.oName.eInputFName = $('.first_name input', this.oName.eElement)[0];
		this.oName.eInputSName = $('.sur_name input', this.oName.eElement)[0];
		this.oName.eInputLName = $('.last_name input', this.oName.eElement)[0];
		
		this.oAbout = $('.col2 .about .view_about')[0];
		this.oAbout.eElement = $('.edit_about', this.oAbout.parentNode)[0];
		this.oAbout.eInput = $('textarea', this.oAbout.eElement)[0];
		
		this.oSex = $('.info .view_sex')[0];
		this.oSex.eElement = $('.edit_sex', this.oSex.parentNode)[0];
		this.oSex.eInput = $('select', this.oSex.eElement)[0];
		
		this.oBirthday = $('.info .view_birthday')[0];
		
		this.oBirthdaymd = $('.info .view_birthdaymd')[0];
		this.oBirthdaymd.eElement = $('.edit_birthdaymd', this.oBirthdaymd.parentNode)[0];
		this.oBirthdaymd.eDay = $('[name="birthday_day"]', this.oBirthdaymd.eElement)[0];
		this.oBirthdaymd.eMonth = $('[name="birthday_month"]', this.oBirthdaymd.eElement)[0];
		this.oBirthdaymd.access = $('[raction="access_birthday_md"]', this.oBirthdaymd.eElement)[0];
		
		this.oBirthdayy = $('.info .view_birthday_year')[0];
		this.oBirthdayy.eElement = $('.edit_birthday_year', this.oBirthdayy.parentNode)[0];
		this.oBirthdayy.eYear = $('[name="birthday_year"]', this.oBirthdayy.eElement)[0];
		this.oBirthdayy.access = $('[raction="access_birthday_year"]', this.oBirthdayy.eElement)[0];
		
		this.oZodiac = $('.info .view_zodiac')[0];
		
		add(this.oButtonEdit, 'click', function(){ me.display_edit(); });
		add(this.oButtonSave, 'click', function(){ me.save(); });
		
		var checkBIRHmd = function(){
			me.oBirthdaymd.eDay.value = me.oBirthdaymd.eDay.value.replace(/[^\d]+/g, '');
			me.oBirthdaymd.eMonth.value = me.oBirthdaymd.eMonth.value.replace(/[^\d]+/g, '');
			me.oBirthdayy.eYear.value = me.oBirthdayy.eYear.value.replace(/[^\d]+/g, '');
			if(me.oBirthdaymd.eDay.value > 31)
				me.oBirthdaymd.eDay.value = 31;
			if(me.oBirthdaymd.eMonth.value > 12)
				me.oBirthdaymd.eMonth.value = 12;
			if(me.oBirthdayy.eYear.value > 2008)
				me.oBirthdayy.eYear.value = 2008;
		};
		add([this.oBirthdaymd.eDay, this.oBirthdaymd.eMonth, this.oBirthdayy.eYear], 'keyup', checkBIRHmd);
		add([this.oBirthdaymd.eDay, this.oBirthdaymd.eMonth, this.oBirthdayy.eYear], 'change', checkBIRHmd);
		add([this.oBirthdaymd.eDay, this.oBirthdaymd.eMonth, this.oBirthdayy.eYear], 'click', checkBIRHmd);
		add([this.oBirthdaymd.eDay, this.oBirthdaymd.eMonth, this.oBirthdayy.eYear], 'focus', checkBIRHmd);
		add([this.oBirthdaymd.eDay, this.oBirthdaymd.eMonth, this.oBirthdayy.eYear], 'blur', checkBIRHmd);
		
		if(edit_mode && edit_mode == 1){
			this.display_edit();
		}
	}
	, display_edit: function(){
		YAHOO.util.Dom.setStyle(this.oButtonEdit,'display','none');
		YAHOO.util.Dom.setStyle(this.oButtonSave,'display','inline');
		
		YAHOO.util.Dom.setStyle(this.oName,'display','none');
		YAHOO.util.Dom.setStyle(this.oName.eElement,'display','inline');
		
		YAHOO.util.Dom.setStyle(this.oAbout.parentNode,'display','block');
		YAHOO.util.Dom.setStyle(this.oAbout,'display','none');
		YAHOO.util.Dom.setStyle(this.oAbout.eElement,'display','block');
		
		YAHOO.util.Dom.setStyle(this.oSex,'display','none');
		YAHOO.util.Dom.setStyle(this.oSex.parentNode,'display','block');
		YAHOO.util.Dom.setStyle(this.oSex.eElement,'display','inline');
		
		YAHOO.util.Dom.setStyle(this.oBirthdaymd,'display','none');
		YAHOO.util.Dom.setStyle(this.oBirthdaymd.parentNode,'display','block');
		YAHOO.util.Dom.setStyle(this.oBirthdaymd.eElement,'display','inline');
		
		YAHOO.util.Dom.setStyle(this.oBirthdayy,'display','none');
		YAHOO.util.Dom.setStyle(this.oBirthdayy.parentNode,'display','block');
		YAHOO.util.Dom.setStyle(this.oBirthdayy.eElement,'display','inline');
	}
	, save: function(){
		YAHOO.util.Dom.setStyle(this.oButtonEdit,'display','none');
		YAHOO.util.Dom.setStyle(this.oButtonSave,'display','none');
		YAHOO.util.Dom.setStyle(this.oSaving,'display','inline');
		
		var q = '&', me = this;
			if(this.oName.eInputSName.value != this.oName.eInputSName.title)
				q += '&sur_name='+this.oName.eInputSName.value;
			else
				q += '&sur_name=';
			if(this.oName.eInputFName.value != this.oName.eInputFName.title)
				q += '&first_name='+this.oName.eInputFName.value;
			else
				q += '&first_name=';
			if(this.oName.eInputLName.value != this.oName.eInputLName.title)
				q += '&last_name='+this.oName.eInputLName.value;
			else
				q += '&last_name=';
			if(this.oAbout.eInput.value != this.oAbout.eInput.title)
				q += '&about='+this.oAbout.eInput.value;
			else
				q += '&about=';
			q += '&sex='+this.oSex.eInput.options[this.oSex.eInput.selectedIndex].value;
			if(this.oBirthdaymd.eDay.value > 0 && this.oBirthdaymd.eMonth.value > 0){
				q += '&birthday_day='+this.oBirthdaymd.eDay.value+'&birthday_month='+this.oBirthdaymd.eMonth.value;
			} else {
				q += '&birthday_day=0&birthday_month=0';
			}
			q += '&birthday_year='+this.oBirthdayy.eYear.value;
		sorry.registration.post('/xml/', 'request=profile&raction=client'+q, function(o){
			try {
				var response = YAHOO.lang.JSON.parse(o.responseText).response;
				if(response.result == 'true')
					me.update(response);
			} catch (e) { }
			setTimeout(function(){me.display_view();}, 800);
		});
		//this.display_view();
	}
	, update: function(sResponse){
		this.oAbout.innerHTML = sResponse.about;
		this.oName.innerHTML = '';
		if(this.oName.eInputFName.value != this.oName.eInputFName.title)
			this.oName.innerHTML += '<a href="http://'+sorry.host+'/name/'+YAHOO.lang.trim(this.oName.eInputFName.value)+'/">'+YAHOO.lang.trim(this.oName.eInputFName.value)+'</a> ';
		if(this.oName.eInputSName.value != this.oName.eInputSName.title)
			this.oName.innerHTML += '<a href="http://'+sorry.host+'/name/'+this.oName.eInputFName.value+'/'+YAHOO.lang.trim(this.oName.eInputSName.value)+'/">'+YAHOO.lang.trim(this.oName.eInputSName.value)+'</a> ';
		if(this.oName.eInputLName.value != this.oName.eInputLName.title)
			this.oName.innerHTML += '<a href="http://'+sorry.host+'/lastname/'+YAHOO.lang.trim(this.oName.eInputLName.value)+'/">'+YAHOO.lang.trim(this.oName.eInputLName.value)+'</a>';
		if(this.oBirthdayy.eYear.value > 0)
			this.oBirthdayy.innerHTML = '<a href="http://'+sorry.host+'/birthday_year/'+this.oBirthdayy.eYear+'/">'+this.oBirthdayy.eYear.value+'</a><sub class="cnt">'+sResponse.birthday_year_count+'</sub>';
		else
			this.oBirthdayy.innerHTML = '';
		if(this.oBirthdaymd.eDay.value > 0 && this.oBirthdaymd.eMonth.value > 0)
			this.oBirthdaymd.innerHTML = '<a href="http://'+sorry.host+'/birthdaymd/'+this.oBirthdaymd.eDay.value+'-'+this.oBirthdaymd.eMonth.value+'/">'+this.oBirthdaymd.eDay.value.replace(/^0/g, '')+'&nbsp;'+YAHOO.lang.trim(aMonth[this.oBirthdaymd.eMonth.value.replace(/^0/g, '')])+'</a><sub class="cnt">'+sResponse.birthday_month_count+'</sub> ';
		if(sResponse.zodiac_title){
			this.oZodiac.innerHTML = '<a href="http://'+sorry.host+'/zodiac/'+sResponse.zodiac_latin+'/"><span class="zodiac"><ins class="horoscope horoscope'+sResponse.zodiac_id+'"><ins></ins></ins>'+sResponse.zodiac_title+'</span></a>';
		} else {
			this.oZodiac.innerHTML = '';
		}
		this.oBirthday.innerHTML = aBirth[this.oSex.eInput.options[this.oSex.eInput.selectedIndex].value];
		this.oSex.innerHTML = '<a href="http://'+sorry.host+'/sex/'+ this.oSex.eInput.options[this.oSex.eInput.selectedIndex].value +'/">' + this.oSex.eInput.options[this.oSex.eInput.selectedIndex].text+'</a><sub class="cnt">'+sResponse.sex_count+'</sub>';
	}
	, display_view: function(){
		YAHOO.util.Dom.setStyle(this.oButtonEdit,'display','inline');
		YAHOO.util.Dom.setStyle(this.oButtonSave,'display','none');
		YAHOO.util.Dom.setStyle(this.oSaving,'display','none');
		
		YAHOO.util.Dom.setStyle(this.oName,'display','inline');
		YAHOO.util.Dom.setStyle(this.oName.eElement,'display','none');
		
		YAHOO.util.Dom.setStyle(this.oAbout,'display','block');
		YAHOO.util.Dom.setStyle(this.oAbout.eElement,'display','none');
		
		if(!YAHOO.lang.trim(this.oAbout.eInput.value).length || this.oAbout.eInput.value == this.oAbout.eInput.title){
			YAHOO.util.Dom.setStyle(this.oAbout.parentNode,'display','none');
		}
		
		YAHOO.util.Dom.setStyle(this.oSex,'display','inline');
		if(this.oSex.eInput.options[this.oSex.eInput.selectedIndex].value < 1){
			YAHOO.util.Dom.setStyle(this.oSex.parentNode,'display','none');
		}
		YAHOO.util.Dom.setStyle(this.oSex.eElement,'display','none');
		
		YAHOO.util.Dom.setStyle(this.oBirthdaymd,'display','inline');
		YAHOO.util.Dom.setStyle(this.oBirthdaymd.eElement,'display','none');
		
		if(this.oBirthdaymd.eDay.value < 1 || this.oBirthdaymd.eMonth.value < 1){
			YAHOO.util.Dom.setStyle(this.oBirthdaymd,'display','none');
			YAHOO.util.Dom.setStyle(this.oBirthdaymd.access,'display','none');
		}
		
		YAHOO.util.Dom.setStyle(this.oBirthdayy,'display','inline');
		YAHOO.util.Dom.setStyle(this.oBirthdayy.eElement,'display','none');
		
		if(this.oBirthdaymd.eDay.value < 1){
			YAHOO.util.Dom.setStyle(this.oBirthdayy,'display','none');
			YAHOO.util.Dom.setStyle(this.oBirthdayy.access,'display','none');
		}
		if(this.oBirthdaymd.eDay.value < 1 && (this.oBirthdaymd.eDay.value < 1 || this.oBirthdaymd.eMonth.value < 1)){
			YAHOO.util.Dom.setStyle(this.oBirthdaymd.parentNode,'display','none');
		}
	}
	, update_count_trust: function(){
		if(!this.oTrust)
			return;
		var cnt = this.oTrust.innerHTML;
		var cnt_text = this.oTrust.text.innerHTML;
		this.oTrust.innerHTML = cnt - 1;
		if(cnt-1 == 1)
			this.oTrust.text.innerHTML = '&nbsp;'+aHumanTrust[0];
		else
			this.oTrust.text.innerHTML = '&nbsp;'+aHumanTrust[1];
		if((cnt-1) < 1){
			$(this.oTrust.parentNode.parentNode).hide(250);
			return;
		}
		$(UserCard2.oUserCards_opened.parentNode.parentNode).hide(200);
	}
};

YAHOO.util.Event.on(window, 'load', function(){
	TagControl.init();
	//UploaderPics.init();
	//UploaderImages.init();
	ContactEdit.init();
	ProfileEdit.init();
});
