/**
 * @author mainout
 */
$(document).ready(function(){
$(".glow").css('opacity','100')
/*	

	//$(".glow").css('opacity','0');
	$(".glow").animate({ opacity: "0.5" }, 200,function(){		
			
	});
	
	$(".glow").animate({ opacity: "1.0" }, 400,function(){
			$(".glow").removeClass("glow");			
	});


	//menu principal
	$("ul#topnav li").hover(function() { //Hover over event on list item
			//$(this).find("span").slideDown('fast');
			$(this).find("span").show();

	} , function() { //on hover out...
			$(this).find("span").slideUp('normal');//hide();
			//$($("ul#topnav li :not($(this)find('span')")).fadeOut("slow");


	});

	$("#content").hover(function(){
		$("ul#topnav li").find("span").hide();
	});

	//fixed menu al hacer scroll
	$(window).scroll(function(e){
	  $el = $('.divnav');
	  if ($(this).scrollTop() > 120 && $el.css('position') != 'fixed'){
	    $el.css({'position': 'fixed', 'top': '0px'});
	  }
	   if ($(this).scrollTop() < 100 && $el.css('position') == 'fixed'){
	    $el.css({'position': 'relative'});
	  }
	});
*/
	//search input
	$("input#main_search").css('color','#ccc')
	$("input#main_search").focus(function () {
  		$(this).val('');
       	$(this).css('color','#000');
    });
	$("input#main_search").blur(function () {
  		$(this).val('...');
       	$(this).css('color','#ccc');
    });

	
	//galería view artwork
	  $(".artThumbList a").css("opacity",0.6);
	 $(".artThumbList a").hover(function(event){
	 		  $(this).animate({ opacity: "1.0" }, "fast");
			  //$(this).css("opacity",1.0);
	 },function(){  
	 		  $(this).animate({ opacity: "0.6" }, "fast");
    });
 	
 	
    $(".artThumbList a").click(function(event){
		event.preventDefault();

       	var imgHref = $(this).attr('href');  //get the src of the thumbnail
        //		 $('a#artBigImagelink').href(imgHref);  //give zoom link new image attribute
		$('#artBigImagelink').attr('href',imgHref);     
		
	 	$(this).animate({ opacity: "1.0" }, "fast");
			  
		var options = {
            zoomType: 'innerzoom', //standard/reverse/innerzoom
			zoomWidth:150,
			zoomHeight: 150,
		    xOffset:-250,
		    yOffset: 0,
			title: false,
		    position: "right", 
		    showPreload:true,
			preloadText:'Loading zoom',
			preloadPosition:'center'
		};
		$('.zoom').jqzoom(options);


        $(".artThumbList a").removeClass("selected");  //remove .selected class from all other links
        $(this).addClass("selected");  //add .selected class to current link
        $("#artBigImage").stop();
        $("#artBigImage").stop().fadeTo(400, 0, function() {  //fade image out
            $('#artBigImage').attr('src',imgHref);  //give new image a src attribute
        }).fadeTo("fast", 1);  //fade the image in

        },function(){    //for onmouseout not used here
    });
	
	/* zoom*/
	var options = {
		zoomWidth:150,
		zoomHeight: 150,
	    xOffset:0,
	    yOffset: 110,
		title: false,
	    position: "right", 
	    showPreload:true,
		preloadText:'Loading zoom',
		preloadPosition:'center'
	};
	$('.zoom').jqzoom(options);


	$('a.tooltip').tooltip({ //NO SOLO CALENDAR
	    track: true,
	    delay: 0,
	    showURL: false,
	    showBody: " *** ",
	    fade: 300
	});

	/* page_tree,
	 * ocultar todos los hijos
	 * en funcion de cual está seleccionado =  desplegar todos los que tengan .pidpX
	 * el despliege se hace desde los metodos del controlador
	 */
	$('.page_tree li ul li').hide();


	$("a[rel^='prettyPhoto']").prettyPhoto({
			theme:'facebook',
			opacity:0.80,
			showTitle: false
			});

});


//wFORMS.showAlertOnError = false; /* or true */
