// <![CDATA[
	$(document).ready(
		function() {
			// opacity
			function opacity(element, value) {
				var value_noie = value / 100;
				$(element).css('filter', 'alpha(opacity=' + value + ')');	// IE
				$(element).css('-moz-opacity', value_noie);					// FF < 2
				$(element).css('-khtml-opacity', value_noie);				// KHTML
				$(element).css('opacity',value_noie);						// everyone else
			}
			// center horizontally
			function centerHoriz(lo_que) {
				var x = parseFloat($(window).width()) / 2 - parseFloat($(lo_que).width()) / 2;
				var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
				x = x + 'px';
				y = y + 'px';
				$(lo_que).css({'left': x, 'top': y});
			}
			// center vertically
			function centerVert(lo_que) {
				var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
				$(lo_que).css({'top': y});
			}
			// no dotted outline for IE in As
			if ($.browser.msie) {
				$('a').focus(
					function() {
						$(this).blur()
					}
				);
			}
			// image load
			function loadImg(sID, sURL) {
				$(sID).unbind("load");
				$(sID).bind("load", function() { $(this).fadeIn(); } )
				$(sID).stop(true, true).fadeOut("normal", function () { $(sID).attr('src', sURL); } );
			}
			// END DEFAULT //
            
			/* styled selects */
			/* doesn't work in IE 6 */
			if (!($.browser.msie && $.browser.version == "6.0")) {
				/*$('.selectStyle').css('filter', 'alpha(opacity=0)');
				$('.selectStyle').css('opacity', '0');*/
				$('.selectStyle').change(function() {
					var the_option = $(this).children(":selected").text();
					$(this).parent().children('.spanStyle').text(the_option);
				});
				$('.spanStyle').each(
					function() {$(this).text($(this).parent().children('.selectStyle').children(':selected').text())}
				);
			}
			// lightbox
            function showLB() {
                $('#fonLB').css('width', $(window).width() + 'px');
                $('#fonLB').css('height', $(document).height() + 'px');
                
                opacity('#fonLB', 70);
                centerHoriz('.lb');
                
                $('#fonLB').fadeIn('normal', function() {$('.lb').fadeIn('normal');} );
            }
            function closeLB() {
                $('.lb').fadeOut('normal', function() {$('#fonLB').fadeOut('normal');} );
            }
            $('#aLogin').click(
                function() {	
                    showLB('.lbLogin');
                    return false;
                }
            );
            $('#fonLB, .lbLogin .btnClose img').click(
                function() {	
                    closeLB();
                    return false;
                }
            );
            /* stars rating system */
			$('.prodsValor li').click(
				function() {
					var padre = $(this).parent();
					padre.removeClass();
					padre.addClass('prodsValor s1 spriteImgEstrellas');
					padre.addClass($(this).attr('class'));
				}
			);
			/* */
		}
	);

// ]]>
