// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var arr_tab=new Array("welcome", "what", "where", "when", "who", "why", "how");

function swap_tab(target){
	for(i=0; i<arr_tab.length; i++){
		if (arr_tab[i]==target){
			$(arr_tab[i]).show();
		} else {
			$(arr_tab[i]).hide();
		}
	}
}

var survey_tabs=7;

function swap_survey_tab(target){
  for(i=0; i<survey_tabs; i++){
    var content_tab_id = "survey_content_" + i;
    if(i==target){
      $(content_tab_id).show();
    }else{
      $(content_tab_id).hide();
    }
  }
  return false;
}


window.onload = function (){
  if ($('questions_box')) {
    swap_tab("welcome");
  };
  if ($('survey')) {
    swap_survey_tab(0);
  };
};

