jQuery( document ).ready(function()
{
	$('input[name="authType"]').change(function(){
		$('div.authTypeFields').hide();
		$('div.auth_' + $(this).val()).show();
	});
	// force checkbox change event - some browsers (like IE) wait for "blur" to trigger "change"
	// for other this will trigger "false positives" - change events when nothing has changed
	jQuery( 'input[name="authType"]' ).focus(function()
	{
		var self = jQuery( this );
		self.change();
	});
	
	/* Aleksandrs, 041109: Noteikumu bloks uztaisits lidzigaks Google noteikumu blokiem
	$('#agreeToTerms').attr('disabled', true);
	var termsLinkBox = jQuery('.termsLinkBox');
    var termsUrl = jQuery('.termsLinkBox a').attr('href');

    var termsLink  = jQuery('.agreeToTermsBox a');
    termsLink.attr('href', termsUrl);

    termsLinkBox.remove();
	
	//window.location.hash = '';
	
	var termsScrollLocation = -1;
	
	var allowChangeHash = (!$.browser.msie || ($.browser.msie && parseInt($.browser.version) > 6));
	
    termsLink.toggle(
    function(event)
    {
        event.preventDefault();

		// prevent flickering on FF (as far as i know) if the page is scrolled to the bottom
		if( window.scrollMaxY == window.scrollY || window.scrollMaxY + 1 == window.scrollY )
		{
			window.scrollBy(0,-1);
		}

		var previousWindowScroll = window.scrollY || document.documentElement.scrollTop;
		
		jQuery('.termsBox').slideDown( 'normal', function()
		{
			if (allowChangeHash)
			{
				window.location.hash = 'terms';
			}
			
			if( termsScrollLocation === -1 )
			{
				termsScrollLocation = window.scrollY || document.documentElement.scrollTop;
			}
			// if no scrolling occured
			var currentWindowScroll = window.scrollY || document.documentElement.scrollTop;
			if( currentWindowScroll == previousWindowScroll && currentWindowScroll != termsScrollLocation )
			{
				// webkit needs a nudge - otherwise no scrolling occurs
				if( termsScrollLocation !== -1 )
				{
					window.scroll( 0, termsScrollLocation );
				}
				else
				{
					if (allowChangeHash)
					{
						window.location.hash = ''; 
						window.location.hash = 'terms';
					}
				}
			}
		});
		
		if ($('#agreeToTerms').attr('disabled'))
		{
			$('#agreeToTerms').removeAttr('disabled');
		}
    },
    function(event)
    {
        event.preventDefault();

		if( window.scrollMaxY == window.scrollY || window.scrollMaxY + 1 == window.scrollY )
		{
			window.scrollBy(0, 0 - (window.scrollMaxY + 1));
		}
		
		jQuery('.termsBox').slideUp( 'normal', function()
		{
			if (allowChangeHash)
			{
				window.location.hash = 'agreeToTerms';
			}
		});
		
		$('#agreeToTerms').attr('disabled', true);
    }
    );*/
});
