// JavaScript Document

window.addEvent('domready',function(){
	
		if($('galeria')){
			SexyLightbox = new SexyLightBox({
				color:'white', emergefrom:'bottom',
				dir: '/_libreria/scripts/sexybox/sexyimages'
			});
		}
							
		if($('search')){
			$('btnSearch').addEvent('click',function(){
				a=$('search');
				if(a.value==""){
					a.focus();
				}else{
					document.location.href='/search/'+a.value+'/';	
				}
			});
		}
		
		$$('.click').addEvent('click',function(){
				rel_=  this.get('rel')							 
				loc=rel_.split('::');
				window.location=loc[0];
				
		});
		
		$$('.click').addEvent('mouseover',function(){
				rel_=  this.get('rel')							 
				loc=rel_.split('::');
				a=$('tituloSeccion');
				if(a){
					//a.set('html',loc[1]);
				}
				
		});
		
		$$('.click').addEvent('mouseout',function(){
				a=$('tituloSeccion');
				if(a){
					//a.set('html','');
				}
				
		});
		
	var viejo="";
	var viejo2="";
	var viejo3="";
	if($('Registro')){
	$('First_Choice').addEvent('change',function(){
			a=this.get('value');
			b=$('Second_Choice');
			c=$('Third_Choice');
			if(viejo!=""){
				b.options[viejo].disabled=false;
				c.options[viejo].disabled=false;
			}
			//alert(viejo);
			indice=this.selectedIndex;
			viejo=indice;
			b.options[indice].disabled=true;
			c.options[indice].disabled=true;
										});
	
	$('Second_Choice').addEvent('change',function(){
			b=$('First_Choice');
			c=$('Third_Choice');
			if(viejo2!=""){
				b.options[viejo2].disabled=false;
				c.options[viejo2].disabled=false;
			}
			//alert(viejo);
			indice=this.selectedIndex;
			viejo2=indice;
			b.options[indice].disabled=true;
			c.options[indice].disabled=true;
										});
	$('Third_Choice').addEvent('change',function(){
			a=this.get('value');
			b=$('First_Choice');
			c=$('Second_Choice');
			if(viejo3!=""){
				b.options[viejo3].disabled=false;
				c.options[viejo3].disabled=false;
			}
			//alert(viejo);
			indice=this.selectedIndex;
			viejo3=indice;
			b.options[indice].disabled=true;
			c.options[indice].disabled=true;
										});
	    new FormCheck('Registro', {
		display : {
			showErrors : 0,	
			closeTipsButton:  0,
			flashTips : 1
		}
					  });
	}
	if($('Contacto')){
 new FormCheck('Contacto', {
		display : {
			showErrors : 0,	
			closeTipsButton:  0,
			flashTips : 1
		}
					  });
	}
		
	if($('ccode')){
	

		 
	}
});
