// JavaScript Document
document.write('<style type="text/css">body{display:none}</style>');

$(document).ready(function(){
	$('style[type=text/css]').remove();
	$('div.expander div:not("div.expander div div")').hide().end();
	$('div.expander h4').wrapInner('<a href="javascript:void(0)"></a>').end();
	$('div.expander h4.more a').append('<span>More Information</span>');
	$('div.hgs div.expander h4.more a').children('span').html('More');
	$('div.expander h4 a').click(function() {
		var $expander = $(this).parent().next('div');
		if ($expander.is(":hidden")) {
			$expander.slideDown();
			if ($(this).parent().hasClass('more')) {
				$(this).children('span').html('Hide');
			}
		} else {
			$expander.slideUp();
			if ($(this).parent().hasClass('more')) {
				$(this).children('span').html('More');
			}
		}
	});
	
	$('div#hgs-terms.expander h4 a').parent().next('div').slideDown();
	$('div#hgs-terms.expander h4 a').children('span').html('Hide');
	
	$("input[type=submit]").hover( function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
	});
	
	$("a[rel=external]").attr('target','_blank');
	
	$('h5.compact').next().hide();
	$('h5.compact').addClass('link').append('<span>[+]</span>').click( function() {
		if ($(this).next().is(":hidden")) {
			$(this).children('span').html('[-]');
		} else {
			$(this).children('span').html('[+]');
		}
		$(this).next().slideToggle();
	});

	$('a.gsslink').click( function() {
		$('div#hgs-terms').children('div:first').slideUp();
		$('div#hgs-support').focus();
		$('div#hgs-support').children('div:first').slideDown();
	});
	
	$('div.popular-faqs div div').hide();

	$('div.popular-faqs div h3:first-child').css('cursor', 'pointer').prepend('<span class="more">Show</span>').click( function() {
		if ($(this).next().is(':hidden')) {
			$(this).next().slideDown();
			$(this).parent().addClass('click');
		} else {
			$(this).parent().removeClass('click');
			$(this).next().slideUp();
		}
	});
	
	$('div.popular-faqs div').hover( function() {
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});
	
	$('a.login').click( function() {
		$('input.caption:first').focus();
		$('input.caption:first').after('<div class="loginhere">Login Here</div>');
		$('div.loginhere').delay(800).fadeOut('normal', function() {
			$(this).remove();
		});
	});

});