

window.addEvent('domready', function(){
	
	new Element('input',{'type':'hidden','name':'ajax'}).injectInside($('registerform'));
	
	$('registerform').addEvent('submit',function(e){
	
	new Event(e).stop();
	
	var query = Object.toQueryString({
		user_login:$('user_login').getProperty('value'),
		ajax:$('user_login').getProperty('true'),
		user_email:$('user_email').getProperty('value'),
		antispam:$('antispam').getProperty('value'),
		last_name:$('last_name').getProperty('value'),
		first_name:$('first_name').getProperty('value'),
		nickname:$('nickname').getProperty('value'),
		ville:$('ville').getProperty('value'),
		birth:$('birth').getProperty('value')
		 }); 
	
	new Ajax($('registerform').getProperty('action'), {
		data: query,
		method: 'post',
		evalScripts:'evalScripts',
		update: $('clrz_ajax_response'),
		onComplete: function() {
			
			clrz_ajax_response.slideIn();
					(function(){clrz_ajax_response.slideOut()}).delay(3000);
					new Asset.image('/wp-content/themes/clrz_lense_moo/img_title1.php?show_antispam&'+Math.random(), {id: 'ats', title: 'ats', 
										onload: function(){
																	$('antispam_png').setHTML('');this.injectInside($('antispam_png'));
																	} 	/*onComplete: function(){alert('ok');this.injectInside($('antispam_png')); }*/
															});
			/*log.removeClass('ajax-loading');*/
		}
	}).request();
	/*
	this.send({
		update: $('clrz_ajax_response'),
		onComplete: function() {
			
			clrz_ajax_response.slideIn();
					(function(){clrz_ajax_response.slideOut()}).delay(3000);
					new Asset.image('/wp-content/themes/clrz_lense_moo/img_title1.php?show_antispam&'+Math.random(), {id: 'ats', title: 'ats', 
										onload: function(){
																	$('antispam_png').setHTML('');this.injectInside($('antispam_png'));
																	} ,
										onComplete: function(){alert('ok');this.injectInside($('antispam_png')); }
															});
			log.removeClass('ajax-loading');
		}
	
	});*/
	
	
	});
	
		/**** init login box */
	var clrz_ajax_response = new Fx.Slide('clrz_ajax_response').hide();
	var clrz_login = new Fx.Slide('clrz_login').hide();
	$('clrz_login').setStyle('height',300);


	/*var loginform = new Fx.Slide('this_is_login');*/
	var lostpasswordform = new Fx.Styles('lostpasswordform', {duration:600, wait:false}).set({'height':0,'opacity':0});
	var theloginform = new Fx.Styles('loginform', {duration:600, wait:false}).set({'height':0});
	var loginform = new Fx.Styles('this_is_login', {duration:600, wait:false}).set({'height':0});
	var registerformz = new Fx.Styles('this_is_register', {duration:600, wait:false}).set({'height':0});

	
	function lense_subscribe(lense,typez)
			{	
										

					var args = Object.toQueryString({subscribe: lense,typez:typez});
					new Ajax( '/lense-party/', { update:'clrz_ajax_response', method: 'post',postBody: args,evalScripts:'evalScripts',onComplete:function(){
						
						if(contest>0)
						{
						clrz_login.toggle();
						var thecontestform = new Fx.Styles('contest_form', {duration:600, wait:false}).set({'height':0});
						loginform.start({'opacity': 0,'height':0}).chain(function(){thecontestform.start({'opacity': 1,'height':200})});	
						$('contest_upload').setHTML($('contest_form').innerHTML);	
						}
						if(current_response)
						{$('clrz_ajax_response').setHTML(current_response);
						current_response="";
						
						}
	
					}}).request();
			}	
	
	/*$$('.loginBtn').each(function(el,i){ new Tips(el) });	*/
	

	
	/*var registerformz = new Fx.Slide('this_is_register');*/

	if($$('.titleh1 h1 a'))
	{
	$$('.titleh1 h1 a').addEvent('mouseenter', function(e){
	
		var mouvez = 440-this.getSize().size.x;
		if(mouvez<0)
		new Fx.Styles(this, {duration:400, wait:false}).start({'margin-left':mouvez});
		
		});
	$$('.titleh1 h1 a').addEvent('mouseleave', function(e){
		
		var mouvez = 440-this.getSize().size.x;
		if(mouvez<0)
		new Fx.Styles(this, {duration:400, wait:false}).start({'margin-left':0});
		
		});
	}	
		
	if($('link_retrieve'))
		$('link_retrieve').addEvent('click', function(e){
						e = new Event(e);

						theloginform.start({'opacity': 0,'height':0}).chain(function(){lostpasswordform.start({'opacity': 1,'height':200})});
							e.stop();
													
												});

	
	registerformz.set({'opacity':0,'height':0});
	
	if(message==1)
	{
		
					load_message();
					clrz_login.show();	
					loginform.start({'opacity':0}).chain(function(){registerformz.set({'height':250});registerformz.start({'opacity':1})});
					
						
					
					clrz_ajax_response.slideIn();
					(function(){clrz_ajax_response.slideOut()}).delay(3000);
		
	}
	if(message==2)
	{
		
		lense_subscribe(current_contest,'contest');	
		
		clrz_ajax_response.slideIn();
					(function(){clrz_ajax_response.slideOut()}).delay(3000);
				
	}
	
	
	/* buddies */
	$$('#buddy li').each(function(el,i){new Tips(el)});
	
	
	/* bud me */
	var jx_response = new Fx.Styles('jx_response', {duration:300, wait:false}).set({'opacity':0});
	if($$('.budder'))
	$$('.budder').addEvent('click', function(event){
	event = new Event(event);
	var budid = this.getProperty('rel');
	var args = Object.toQueryString({add_to_my_lense: budid}); 
	new Ajax( '/members/', { update:'jx_response', method: 'get',data: args,evalScripts:'evalScripts',onComplete: function(){
													
	jx_response.start({'opacity':1,'width':[120,139],'height':[0,50],'top': [event.page.y-100,event.page.y - 70],'left': [event.page.x - 50,event.page.x - 50]}).chain(function(){jx_response.start.delay(1000, this,{'opacity':0})});
	
	if($('buddy_'+budid))
	$('buddy_'+budid).toggleClass('lovebud');
			
													
													}}).request();            
	event.stop();
	});
								function add_to_my_lense(buddy)
											 {
												
							
												
												
											}
	
	/*login Identifiant*/
	if($('searchprofile'))
	$('searchprofile').addEvent('focus', function(e){
													e = new Event(e);
													if(this.value=="Pseudo, Niveau, Ville, Matos...")
													this.value="";
													
											});
	if($('searchprofile'))											
	$('searchprofile').addEvent('blur', function(e){
													e = new Event(e);
													if(this.value=="")
													this.value="Pseudo, Niveau, Ville, Matos...";
													
												});
	
	
	$$('p #user_login').addEvent('focus', function(e){
													e = new Event(e);
													if(this.value=="Identifiant")
													this.value="";
													
												});
	$$('p #user_login').addEvent('blur', function(e){
													e = new Event(e);
													if(this.value=="")
													this.value="Identifiant";
													
												});
	$$('p #user_pass').addEvent('focus', function(e){
													e = new Event(e);
													if(this.value=="password")
													this.value="";
													
												});
	$$('p #user_pass').addEvent('blur', function(e){
													e = new Event(e);
													if(this.value=="")
													this.value="password";
													
												});
												
	/* Menu */
		
		var menutop =  $$('.navbarleft ul li a');
		var colorMenutop = ['ff0198','00ccff','ffff00','8BDE15','ff8100','FF0051','d230ef','00FFF3'];	
			menutop.each(function(element, i){		
				var fx = new Fx.Styles(element, {duration:300, wait:false});
				
				if(element.getParent().hasClass('page_item current_page_item'))
					fx.set({'color': colorMenutop[i]});
				else
				{
						element.addEvent('mouseenter', function(){
							fx.start({'color': ['ffffff',colorMenutop[i]]});
						});
			 
						element.addEvent('mouseleave', function(){
							fx.start({'color': 'ffffff'});
						});
				}
		
			 });
			 
		if($('becomealenser'))
			$('becomealenser').addEvent('click', function(e){
				clrz_login.toggle()
			new Asset.images("/functions/img_title1.php?show_antispam");
	
				});							
	/* gotoregister */
	
		$('gotoregister').addEvent('click', function(e){
		e = new Event(e);
		loginform.start({'opacity':0}).chain(function(){registerformz.start({'opacity':1,'height':250})});
		
		e.stop();
		});
	/* toglog_btn */
		$('toglog_btn').addEvent('click', function(e){
		e = new Event(e);
		
		if(this.getProperty('rel')==1)
		document.location.href='/members/profile/';
		else
		{
	
		registerformz.start({'opacity':0,'height':0}).chain(function(){loginform.start({'opacity':1})});
		
		clrz_login.toggle();
		e.stop();
		}
		});
		
		
		$$('.lense_subs').each(function(el,i){ new Tips(el) });
		
										/*	var tips3 =  new Tips($$('#blogoliste li a'), {
									initialize:function(){
										this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
									},
									onShow: function(toolTip) {
										this.fx.start(1);
									},
									onHide: function(toolTip) {
										this.fx.start(0);
									}
								});*/
								
	/*#################### comment fill*/

	if($('commentform'))
	$('commentform').addEvent('submit', function(e) {
		
		if($('author').value=="")
			{
				$("jx_response").setHTML("<div class='tool-title'>/!\ Fill in your name</div><div class='tool-text'>...</div>");
				jx_response.start({'opacity':1,'width':[120,139],'height':[0,50],'top': [$('submit').getTop()-100,$('submit').getTop() - 70],'left': [$('submit').getLeft() - 50,$('submit').getLeft() - 50]}).chain(function(){jx_response.start.delay(2000, this,{'opacity':0})});
				new Event(e).stop();
		
	   	}
	  else if($('email').value=="")
				{
				$("jx_response").setHTML("<div class='tool-title'>/!\ Fill in your email</div><div class='tool-text'>...</div>");
				jx_response.start({'opacity':1,'width':[120,139],'height':[0,50],'top': [$('submit').getTop()-100,$('submit').getTop() - 70],'left': [$('submit').getLeft() - 50,$('submit').getLeft() - 50]}).chain(function(){jx_response.start.delay(2000, this,{'opacity':0})});
				 new Event(e).stop();
	   }
	   else if($('comment').value=="")
	   {
				$("jx_response").setHTML("<div class='tool-title'>@?#~!!$</div><div class='tool-text'>...</div>");
				jx_response.start({'opacity':1,'width':[120,139],'height':[0,50],'top': [$('submit').getTop()-100,$('submit').getTop() - 70],'left': [$('submit').getLeft() - 50,$('submit').getLeft() - 50]}).chain(function(){jx_response.start.delay(2000, this,{'opacity':0})});
				 new Event(e).stop();
	   }
	   else
	   {
			return;
		}
	});
		
		
		
		
		if($$('.lense_subs'))
		{
			$$('.lense_subs').addEvent('click', function(e){
			e = new Event(e);
			
			lense_subscribe(this.id,this.getProperty('rel'));
			
			new Fx.Scroll(window).toElement('clrz_ajax_response').chain(
			function(){
				
				clrz_ajax_response.slideIn();
				(function(){clrz_ajax_response.slideOut()}).delay(2000);
				
				});
			e.stop();
			});
		}
		
		if($$('.lense_unsubs'))
		{
			$$('.lense_unsubs').addEvent('click', function(e){
			e = new Event(e);
			
			lense_unsubscribe(this.id,this.getProperty('rel'));
			new Fx.Scroll(window).toElement('clrz_ajax_response').chain(
			function(){
				
				clrz_ajax_response.slideIn();
				(function(){clrz_ajax_response.slideOut()}).delay(2000);
				
				});
			
			e.stop();
			});
		}
		
		
		
		
		if($('show_all'))
		{
			$('show_all').addEvent('click', function(e){
			e = new Event(e);
			show_all();
			e.stop();
			});
		}
		
		
		/*blogo*/
			var booklinks = [];
			$$('#blogoliste li a').each(function(el,i){booklinks[i]=el.getProperty('href');});
			var blogol =  $$('#blogoliste li');
			/*if($$('#blogoliste div'))*/
			blogol.each(function(element, i){		
				var fx = new Fx.Styles(element, {duration:200, wait:false});
				
						element.addEvent('mouseenter', function(){
							fx.start({'margin-left': -170});
						});
			 
			 			element.addEvent('click', function(){
							document.location.href=booklinks[i];
						});

						element.addEvent('mouseleave', function(){
							fx.start({'margin-left': 0});
						});
		
			 });
		
			 
			 
		/* home previous fx*/
		var myhrefz = $$('#clrz_outside ul li p a');
			var hrefz = [];
			/*if($$('#clrz_outside ul li p a'))*/
			myhrefz.each(function(el, i){		
				hrefz[i] = el.getProperty('href');
			 });		
		var outsidelist = $$('#clrz_outside ul li div p');
		
		outsidelist.each(function(zelement, i) {
 
				var fx = new Fx.Styles(zelement, {duration:200, wait:false}).set({'height':100});
			
				zelement.addEvent('mouseenter', function(){
					fx.start({
						'margin-top': -50,
						'background-color': '#f1f1f1'
					})
				});
			 
				zelement.addEvent('mouseleave', function(){
					fx.start({
						'margin-top': 0,
						'background-color': '#ffffff'

					});
				});
				zelement.addEvent('click', function(e){
					e = new Event(e);
					window.location.href=hrefz[i];
					e.stop();

				});
			 
			});
		
		
		
		
		
		
		/* lensers fx*/
		if($$('.panel'))
		{
			var pluz = $$('.panel');
			var mypluz = [];
			pluz.each(function(el, i){		
				mypluz[i] = new Fx.Styles(el, {'duration': 200, 'wait': false});
				mypluz[i].set({'margin-left': 665,'width':0});
			 });
		}
		
		$$('#members ul li').each(function(el, i)
		{
		var myEffects = new Fx.Styles(this, {duration: 200,transition: Fx.Transitions.Back.easeInOut});
				
				el.addEvent('mouseenter', function(e){
				e = new Event(e);
				/*myEffects.start({'background-color': 'EAEAEA','color': '00CCFF'});*/
				if(mypluz[i])
				mypluz[i].start({'opacity':[0,1],'margin-left':[300,50],'width':[0,270]});
				e.stop();
				});
				
				el.addEvent('mouseleave', function(e){
				e = new Event(e);
				/*myEffects.start({'background-color': 'ffffff','color': '666666'});*/
				if(mypluz[i])
				mypluz[i].start({'opacity':0});
				e.stop();
				});
		
		});
		
		/* isareply */
		var reply_parent = new Fx.Styles('reply_parent', {duration: 400,transition: Fx.Transitions.Back.easeInOut});
		
		$$('.isareply').each(function(el,i){ new Tips(el) });

		/*var replyTips = new Tips($$('.isareply'));*/
		
		if($$('.isareply'))
		$$('.isareply').each(function(el,i){
		
		el.addEvent('click',function(e){
			
			
			
			
			
			
			var parentid = el.getProperty('rel');
			
			$('reply_parent').setHTML("<div id='closeparent'></div>"+$('comment-'+parentid).innerHTML);
			
		
			
				
			var current_com = el.getParent().getParent().getParent().getParent();
			
			new Fx.Styles(current_com, {duration: 200,transition: Fx.Transitions.Back.easeInOut}).start({'margin-top':[$('reply_parent').getStyle('height').toInt()]}).chain(function(){
				
			var pos = (el.getTop()-$('reply_parent').getStyle('height').toInt());
			reply_parent.set({'left':current_com.getLeft()});
			reply_parent.start({'margin-top':[0,0],'top':[pos-100,pos-20],'opacity':[0,1],'margin-left':[0,0]});	
			
		
			$$('#reply_parent #clrz_comment .com_option .replyz').each(function(eli,i){
				
				
				eli.addEvent('click',function(e){
				
				
						var pos = (el.getTop()-$('reply_parent').getStyle('height').toInt());

						reply_parent.start({'margin-top':[0,-100],'opacity':0}).chain(function(){
				
						new Fx.Styles(el.getParent().getParent().getParent().getParent(), {duration: 200,transition: Fx.Transitions.Back.easeInOut}).start({'margin-top':0}).chain(function(){
							
						show_reply(eli.id);	
						$('reply_parent').empty();
						});
				
							});
				});
				
				
				
				});
			
			
			
			/**********************/
			$('closeparent').addEvent('click',function(e){
		

			var parentid = el.getProperty('rel');
			
			
			var pos = (el.getTop()-$('reply_parent').getStyle('height').toInt());

			reply_parent.start({'margin-top':[0,-200],'opacity':0}).chain(function(){
				
				new Fx.Styles(el.getParent().getParent().getParent().getParent(), {duration: 200,transition: Fx.Transitions.Back.easeInOut}).start({'margin-top':0}).chain(function(){
					
					$('reply_parent').empty();
					});
				
				});
			});	
			
			
			
			
			/*******************/
			
			
			
			
				});
			
			});

						
		});
		/* show reply */
		
		var comz = $$('#commentz li');
		var mycommentz = [];
		var mycommentzH = [];
		var mycommentzmarge=[];
		comz.each(function(el, i){
					mycommentz[i] = new Fx.Styles(el,{'duration':800,'wait':false,transition:Fx.Transitions.Quad.easeInOut}); 
					mycommentzH[i] = el.getStyle('height').toInt();
					mycommentzmarge[i] = new Fx.Style(el, 'margin-left');
					});

		if($$('.replyz'))
		{
			$$('.replyz').addEvent('click', function(e){
			e = new Event(e);
			show_reply(this.id);
			e.stop();
			});
		}
		
				function show_all ()
				{
						
					var sideblocks = $$('#commentz li');
					sideblocks.each(function(el, i) 
					{
						/*mycommentz[i].slideIn();*/
							 mycommentzmarge[i].set(0);
							 mycommentz[i].start({'margin-top':0,'opacity':1});	

					});
						
					
					
				}		
		
		function show_reply(comid)
		{
			
			
		
			new Fx.Scroll(window,{duration:1000,transition:Fx.Transitions.Quad.easeInOut}).toElement('commentblock')
			.chain(function(){
					var sideblocks = $$('#commentz li');
					var timer = 20;
					sideblocks.each(function(el, i)
					{
						
						
						if(el.getProperty('rel') == comid || el.getProperty('id') == "comment-"+comid){
							timer += 300;
						function showz()
								{
							/* mycommentz[i].slideIn();*/
							
							/*mycommentz[i].start({'opacity':1}).chain(function()
							{
							 mycommentz[i].start({'height':mycommentzH[i],'margin-left':0})//.chain(function(){mycommentz[i].start({'background-color':['666666','006699']})})
					 		});*/
					 		
							 mycommentz[i].start({'opacity':1,'margin-top':0,'margin-left':0})/*.chain(function(){mycommentz[i].start({'background-color':['666666','006699']})})*/
							 	}
						 		showz.delay(timer,showz);	
						}
						else
						{
							
								 
									mycommentz[i].start({'margin-top':(mycommentzH[i]*(-1)),'opacity':0}).chain(function(){mycommentzmarge[i].set(-490);});
								
								
							 /*showz.delay(timer,showz);*/
							 	
						}
						
						
					});
						
					});/*end chain	*/

			}
			
		if($$('.apn_set'))	
		$$('.apn_set').addEvent('click', function(e){
							e = new Event(e);
							document.location.href='/galeries/?photoset='+this.getProperty('link');
							e.stop();
							
							
						});
		
	/*photosets*/
	var desc1 = [];
	if($$('#photosets li div.desc'))
	$$('#photosets li div.desc').each(function(el, i){
									desc1[i] = new Fx.Styles(el, {duration:200, wait:false}).set({'height':0,'opacity':0});
		});	
	if($$('#photosets li'))
	$$('#photosets li').each(function(el, i){
		el.addEvent('mouseenter', function(e){
						e = new Event(e);
						
						desc1[i].start({'height':50,'margin-top':201,'opacity':0.8});
						
						});
el.addEvent('mouseleave', function(e){
						e = new Event(e);
						
						desc1[i].start({'height':0,'margin-top':255,'opacity':0});
						
						});					});
					
	if($('flickM'))
		{					
		var Flikulit = [];
		var Flikimg = [];
		var Fliktitre = [];
		var Flikbigimg = [];
		var timerz=1000;
		var fxM = new Fx.Styles('flickM', {duration:200, wait:false});
		var fxM2 = new Fx.Styles('flickM2', {duration:350, wait:false});
		var fxflickr = new Fx.Styles('flickr', {duration:200, wait:false});
		var theul = new Fx.Styles('theul', {duration:350, wait:false});
		fxM.set({'height':0,'top':-190});
		fxM2.set({'margin-left':450});
		
		
		
		$('flickM').addEvent('mouseenter', function(e){
						e = new Event(e);
						
						fxM.start({	'height:':170,'top': -190});
						
						});
			
			}	
				
			var miniflick = [];	
		$$('#flickr ul li a img').each(function(el, i)
					{miniflick[i] = el.getProperty('src');});
		
		new Asset.images(miniflick, {onProgress: function(i) {
						$('counter').setHTML(i+" / "+miniflick.length);
							$('flickr').setStyle('visibility', 'hidden');	}, 
							onComplete: function()
							{
								$('counter').setStyle('visibility', 'hidden');
							$('flickr').setStyle('visibility', 'visible');	
								
								
						var lastTimeout;
		if($$('#flickr ul li'))	
		$$('#flickr ul li').each(function(el, i)
					{
							Flikulit[i] = new Fx.Styles(el, {duration:300, wait:false});
							Flikimg[i] = el.getProperty('rel');
							Fliktitre[i] = el.getProperty('title');
							Flikbigimg[i] = el.getProperty('link');
							Flikulit[i].set({'opacity':0,'margin-right':-50,'padding':10,'border-color':'8bde15'});
							Flikulit[i].start.delay(timerz,Flikulit[i],{'opacity':1,'margin-right':0,'padding':3,'border-color':'cccccc'});
							
							timerz +=160;
						el.addEvent('mouseenter', function(e){
						e = new Event(e);
							Flikulit[i].set({'opacity':1,'margin-right':0});
							fxM.start({'opacity':1,	'height':[28],'width':32,'left': [el.getLeft()+7],'top': [el.getTop()-50]});
							$('flickM').setHTML("<img src='/wp-content/themes/clrz_lense_moo/images/loader.gif'>");
							Flikulit[i].set({'opacity':1,'margin-right':0,'padding':3,'border-color':'cccccc'});
							Flikulit[i].start({'background-color':'8bde15'});
							
						clearTimeout(lastTimeout); 

						lastTimeout = setTimeout(function(){
							new Asset.images(Flikimg[i], {
								/*onProgress: function() {},*/ 
								onComplete: function() {
									$('flickM').setHTML("<img src='"+Flikimg[i]+"' align='center' id='m_image' width='240'>");
						
									fxM.start({'height':[150,160],'left': [el.getLeft()-85],'width':240,'top': [el.getTop()-180,el.getTop()-175]});
								 						}}
								 			);
							
							
						}, 600);   
						
							

						
						});
						el.addEvent('mouseleave', function(e){
							e = new Event(e);
							clearTimeout(lastTimeout); 
							fxM.start({'height':170,'top':-190});
							Flikulit[i].start({'background-color':'fffff'});
							
						});
						
						el.addEvent('click', function(e){
							e = new Event(e);
							e.stop();
							
							
							Flikulit[i].start({'background-color':'006699'});
								fxM.start({	'height':28,'width':32,'left': [el.getLeft()+7],'top': [el.getTop()-50]});
							$('flickM').setHTML("<img src='/wp-content/themes/clrz_lense_moo/images/loader.gif'>");
							new Asset.images(Flikbigimg[i], {onProgress: function() {
								}, 
							onComplete: function()
							{	
								fxM.start({'opacity':0});
								theul.start({'margin-left':-470});
								$('flickM2').setHTML("<img id='theimg' src='"+Flikbigimg[i]+"'>");
								$('theimg').style.width="430px";
								/*theul.start({'margin-left':-470}).chain(function(){fxM2.start({'margin-left':[450,0]})});*/
								fxM2.start({'margin-left':[450,0],'height':$('theimg').getStyle('height').toInt(),'opacity':[1,1]});
								
							}
						});
							
							
							
						});
						
					
							
		});
		
		$('flickM2').addEvent('click', function(e){
			clearTimeout(lastTimeout); 
							e = new Event(e);
							e.stop();
							/*fxM2.start({'margin-left':450}).chain(function(){theul.start({'margin-left':0})});*/
							fxM2.start({'margin-left':450,'height':$('theul').getStyle('height').toInt(),'opacity':0});
							theul.start({'margin-left':0});
							
							/*fxM2.start({'margin-left':450});
							theul.start({'margin-left':0});*/
							
							
							
						});
	}});/* asset all image		*/
	
			
			
			
	/* lense accordion*/
	
			var accordion = new Accordion('h3.atStart', 'div.atStart', {
			opacity: true,show:true,
			onActive: function(toggler, element){
				/*new Fx.Style(element, 'opacity',{duration:300}).start(0,1);	*/		
				/*new Fx.Style(toggler, 'opacity').start(1,0.5);*/
							
},
		 
			onBackground: function(toggler, element){
				/*new Fx.Style(element, 'opacity',{duration:300}).start(1,0);*/		
				/*new Fx.Style(toggler, 'opacity').start(0.5,1);*/			
			}
		}, $('clrz_lense_party'));
		 
		if($('searchprofile'))
		 $('searchprofile').addEvent('keydown', function(event){
		var event = new Event(event);
		search_out();
		if(event.key == 'enter')
		{
		
		
		var zearch = this.getProperty('value');
		
		document.location.href="/members/?search="+zearch;
		}
	});
	

			}); 

var lastTimeout;
			function search_out()
			{ 
				
					clearTimeout(lastTimeout); 
					
					lastTimeout = setTimeout('name_searching()', 600);  
			}	
			
			 function name_searching()
			 {
				 
						var myname = $('searchprofile').value;
							
					var args = Object.toQueryString({name_search: myname});
					
						new Ajax( '/members/', { update:'sp_result', method: 'post',postBody: args}).request();
			}
				
				 
			
				
				
			
								
			
			function lense_unsubscribe(lense,typez)
			{
					var args = Object.toQueryString({unsubscribe: '1',subscribe: lense,typez:typez});
					new Ajax( '/lense-party/', { update:'clrz_ajax_response', method: 'post',postBody: args, onComplete: function(){
						
						if($('clrz_response').value=="0")
						
						$('mylense_'+lense).setHTML("");
						
						}}).request();
					
					
			}	
				
									
			function replyto(comid){
					var replyInfo = new Fx.Styles('reply_info',{'duration':800,'wait':false,transition:Fx.Transitions.Quad.easeInOut});
					var zeHeight = ($('comment-'+comid).getStyle('height').toInt());
					
					
					if($('replybutton_'+comid).value=="cancel")
					{
					$$('.cancel_reply').set({'class':'reply_btn'});
					
					$('comment_parent').value="";	
							
					replyInfo.start({'opacity':0,'height':0}).chain(
					function(){
						$('reply_info').setHTML("");
						$('replybutton_'+comid).value="reply";
						
						new Fx.Scroll(window,{duration:1500,transition:Fx.Transitions.Quad.easeInOut}).toElement('comment-'+comid)});
					
					}else{
						
					$('replybutton_'+comid).className="cancel_reply";
					$('replybutton_'+comid).value="cancel";
					$('comment_parent').value=comid;
					
					replyInfo.set({'opacity':0,'height':0});
					$('reply_info').setHTML($('comment-'+comid).innerHTML);
					
					new Fx.Scroll(window,{duration:1500,transition:Fx.Transitions.Quad.easeInOut,onComplete:function(){replyInfo.start({'opacity':1,'height':zeHeight});} }).toElement('respond');
				

							
					
					}
				}
				
					
			
	function ela_init(){
	/*			var list = $$('#af-ela-menu li');
				
				list.each(function(element) {
 
	var fx = new Fx.Styles(element, {duration:200, wait:false});
 
	element.addEvent('mouseenter', function(){
		fx.start({
			'font-size': 22,
			'background-color': '#d230ef',
			color: '#ff8'
		});
	});
 
	element.addEvent('mouseleave', function(){
		fx.start({
			'font-size': 12,
			'background-color': '#cccccc',
			'color': '#888'
		});
	});
 
});*/

}





				
									
