$(function() {
   
    // FAQ sorting filter
    $('#faq_nav a').click(function() {
        var $this = $(this),
             type = $this.attr('id');
			 
	$('#faq_list div p.a').css('display', 'none');
	$('#faq_list div a').removeClass('collapse').addClass('expand');
        
        $('#faq_nav ul').attr('id', type);
                        
        $('#faq_list').children('div').hide()
                                      .filter('.' + type).show();
		
		return false;
    });
    
    // FAQ expanding and collapsing events
    $('#faq_list div a.title').click(function() {
        var $this = $(this);
        
        if($this.hasClass('expand')) {
            $this.next().show()
                 .end().attr('class', 'collapse');
        } else {$this.next().hide()
                     .end().attr('class', 'expand');
        }
		return false;
    });
    
    // the same event when below happens
    $('#faq_list div .q').click(function() {
        $(this).next().click();    
		return false;
    });
    
});


function resizeMenu(a) {
			$('embed#mainmenu').attr('height', a);
			if($('#subBanners')) {
				$('#subBanners').css('margin-top', a-185-70);
			}
			if($('#banners')) {
				$('#banners').css('margin-top', a-185-230);
			}
}



function startLostSaga() 
{
	/**
	*	Description of startLauncher function
	*
	*	serviceID	 : Identity number of each game.
	*	redirectURL	 : After checking log-in, Will go to this url.
	*	pluginInstallURL : If It dosen't have Lanuncher, Will go to this url.
	*
	*/
	this.startLauncher
	(
		9, 
		window.location.href, 
		"http://lostsaga.ogplanet.com/DOWNLOADS/CLIENT.html#ogplauncher"
	);
	
	if(this.g_isLauncher==0)
        {
               this.GoPluginInstallPage();
        }

}