// <![CDATA[
	// opacity
	function opacity(element, value) {
		var value_noie = value / 100;
		$(element).css('filter', 'alpha(opacity=' + value + ')');
		$(element).css('-moz-opacity', value_noie);
		$(element).css('-khtml-opacity', value_noie);
		$(element).css('opacity',value_noie);
	}

	// 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});
	}

	// 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); } );
	}

	$(document).ready(
		function() {

			// no dotted outline for IE in As
			if ($.browser.msie) {
				$('a').focus(
					function() {
						$(this).blur()
					}
				);
			}
			
		// END DEFAULT //
		
	
				//menu superior
			$('.langPseudoSelect li').hover(
				function(e)
				{
					$(this).children('ul').slideDown("fast");
				},
				function(e)
				{
					$(this).children('ul').hide();
				}
			);
			
			
			$(".socialFoot li a").hover(function () {
				$(this).children("span").fadeIn()
			}, function () {
				$(this).children("span").fadeOut()
			});			//menu superior
			$('#mainNav li').hover(
				function(e)
				{
					$(this).children(".subMenu").show();
					//$(this).children(".subMenu").slideDown();
					$(this).addClass('active');
					//$(this).prev().children().addClass('nBg');

				},
				function(e)
				{
					$(this).children('.subMenu').hide();
					$(this).removeClass('active');
					//Cufon.replace('#mainNav li a, .helvetica', { fontFamily: 'Helvetica Neue LT Std', hover: true });
					$(this).prev().children().removeClass('nBg');

				}
			);
			
			
						// clear inputs
			var input_values = Array();
			$('input[type=text], input[type=password], textarea').each(
				function() {
					input_values[$('input[type=text], input[type=password], textarea').index(this)] = $(this).val();
				}
			);
			$('input[type=text], input[type=password, textarea]').focus(
				function() {
					if($(this).val() == input_values[$('input[type=text], input[type=password], textarea').index(this)]) {
						$(this).val('');
					}
				}
			);
			$('input[type=text], textarea').blur(
				function() {
					if($(this).val() == '') {
						$(this).val(input_values[$('input[type=text], textarea').index(this)]);
					}
				}
			);
			
			$(".bgTxt").click(function() {
				$(this).children().focus();
			});
			$(".bgTxt input, .bgTxt textarea").focus(function() {
				$(this).parent().addClass("focus");
			});
			$(".bgTxt input, .bgTxt textarea").blur(function() {
				$(this).parent().removeClass("focus");
			});
			
	
		/* 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())}
			);
		}


	// Load dialog on page load
	//$('#basic-modal-content').modal();

		 
    //select all the a tag with name equal to modal
    $('a[name=modal]').click(function(e) {
        //Cancel the link behavior
        e.preventDefault();
        //Get the A tag
		
		var id = $(this).attr('href');
		//ejecutar modal
		$(id).modal({onOpen: function (dialog) {
			
			dialog.overlay.fadeIn('slow', function () {
				dialog.data.hide();
				dialog.container.fadeIn('slow', function () {
					dialog.data.slideDown('slow');
				}); 
			});
		}});
		
	 

		
    });
     
/*    //if close button is clicked
    $('.window .close').click(function (e) {
        //Cancel the link behavior
        e.preventDefault();
        $('#mask, .window').hide();
    });    
     
    //if mask is clicked
    $('#mask').click(function () {
        $(this).hide();
        $('.window').hide();
    });         
	
*/







		
		}
	);
				

