//$(function(){
var all	=	false;
$(document).ready(function(){

	$(".ques").click(function(){
		var indx = $(".ques").index(this);
		if ( $(this).parent().hasClass("active"))
		{
			$(".ques").parent().removeClass("active");
			$(".ans").slideUp('',function(){ 
				//window.scrollTo(0,0);
				//$( window.opera ? 'html' : 'html, body' ).animate({ scrollTop: 0 }, 'slow');
			});
		}
		else
		{
			$(".ques").parent().removeClass("active");
			$(".ans").slideUp();
			$(".ques").eq(indx).parent().addClass("active");
			//	$(".ans").eq(indx).slideDown();
						
			$(".ans").eq(indx).slideDown('',function(){ 
				var offset = $(".ans").eq(indx).parent().offset()
				//window.scrollTo(offset.left,offset.top)
				//$( window.opera ? 'html' : 'html, body' ).animate({ scrollTop: offset.top }, 'slow');
			})
			
		}
	});
	
	//$(".ques:first").trigger('click');
	
});
function doAll()
{
	if(all == false)
	{
		all = true;
		$(".sh_all").html("Hide All");
		show_all();
	}
	else
	{
		all = false;
		$(".sh_all").text("Show All");
		hide_all();
	}	
}
function show_all()
{
	$(".ques").parent().addClass("active");
	$(".ans").slideDown();	
}
function hide_all()
{
	$(".ques").parent().removeClass("active");
	$(".ans").slideUp();
}
