/*******************************************************
CHANGE ACTIVE ID - PRIMARY NAVIGATION
********************************************************/
function showActive1(){
$(document).ready(function() { 
	$('#nav1').addClass("active").show(); //Activate first tab	
	}); 
}
function showActive2(){
$(document).ready(function() { 
	$('#nav2').addClass("active2").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive3(){
$(document).ready(function() { 
	$('#nav3').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive4(){
$(document).ready(function() { 
	$('#nav4').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive5(){
$(document).ready(function() { 
	$('#nav5').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}

function showActive_Sub1(){
$(document).ready(function() { 
	$('#nav_Sub1').addClass("active").show(); //Activate first tab	
	}); 
}
function showActive_Sub2(){
$(document).ready(function() { 
	$('#nav_Sub2').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive_Sub3(){
$(document).ready(function() { 
	$('#nav_Sub3').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive_Sub4(){
$(document).ready(function() { 
	$('#nav_Sub4').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}
function showActive_Sub5(){
$(document).ready(function() { 
	$('#nav_Sub5').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}


function showActive_QNav_1(){
$(document).ready(function() { 
	$('#nav_QNav_1').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}

function showActive_report_1(){
$(document).ready(function() { 
	$('#nav_report_1').addClass("active").fadeIn("medium"); //Activate first tab		
	});  
}
function showActive_report_2(){
$(document).ready(function() { 
	$('#nav_report_2').addClass("active").fadeIn("medium"); //Activate first tab		
	}); 
}
function showActive_report_3(){
$(document).ready(function() { 
	$('#nav_report_3').addClass("active").fadeIn("medium"); //Activate first tab	
	}); 
}



/*******************************************************
POP UP WINDOW
********************************************************/
function popCenter(pageURL, title,w,h) {
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
} 


/*******************************************************
General Button Animation Script
********************************************************/
function initMenu() {
  $('.thumbnails .inside').hover(function(){  
 $(".descr", this).stop().animate({top:'45px'},{queue:false,duration:300});  
  }, function() {  
 $(".descr", this).stop().animate({top:'75px'},{queue:false,duration:300});  
  });   
}
$(document).ready(function() { initMenu() ;});




/*******************************************************
TOGGLE 
********************************************************/
function togglestyle(el){
	
	// for now the are mutually exclusive
	$('.selectON').each( function(){
		$(this).removeClass('selectON')
	})
	
	$(el).addClass("selectON");
}



$(".toggle_Filters").click(function() {
  $("#toggle_Filters").fadeToggle("fast");
});


$('.toggle_content_1').live('click',function(){
$("#toggle_content_1").fadeToggle("fast");
$("#button_1_A").hide();
$("#button_1_B").show();
});

$('.button_1_B').live('click',function(){
$("#button_1_A").show();
$("#button_1_B").hide();
});

$('.toggle_content_2').live('click',function(){
$("#toggle_content_2").fadeToggle("fast");
$("#button_2_A").hide();
$("#button_2_B").show();
});

$('.button_2_B').live('click',function(){
$("#button_2_A").show();
$("#button_2_B").hide();
});

$('.toggle_content_3').live('click',function(){
$("#toggle_content_3").fadeToggle("fast");
$("#button_3_A").hide();
$("#button_3_B").show();
});

$('.button_3_B').live('click',function(){
$("#button_3_A").show();
$("#button_3_B").hide();
});



/*******************************************************
LOADING GRAPHIC TIME OUT
********************************************************/
$(document).ready(function () {
  setTimeout(function () {
      $('#loadingGraphic').fadeOut("medium");
      $('#thankYou').fadeIn("medium");	  
  }, 2000);
});


/*******************************************************
FORM VALIDATION - SURVEYS
********************************************************/
$.metadata.setType("attr", "validate");
 
var locations = new Array('multiple_1', 'multiple_2', 'multiple_3', 'multiple_4', 'multiple_5', 'multiple_6', 'multiple_7', 'multiple_8', 'multiple_9', 'multiple_10', 'multiple_11', 'multiple_12');
var anyId = 'multiple_None';

function toggleBoxes( el ) {
	var i;
	if ( el.id == anyId ) {
		for( i = 0; i < locations.length; i++ ){
			var cb = document.getElementById(locations[i]);
			cb.checked = false;
		}
	} else {
		var cb = document.getElementById(anyId);
		cb.checked = false; 
	}
}    
/*******************************************************
FORM NAVIGATION - HIDE + SHOW DIVS
********************************************************/
function showonlyonePrimary(thechosenone) {
      var Primary_Section = document.getElementsByTagName("div");
            for(var x=0; x<Primary_Section.length; x++) {
                  name = Primary_Section[x].getAttribute("name");
                  if (name == 'Primary_Section') {
                        if (Primary_Section[x].id == thechosenone) {
                        Primary_Section[x].style.display = 'block';
                  }
                  else {
                        Primary_Section[x].style.display = 'none';
                  }
            }
      }
}

function showonlyone(thechosenone) {
      var Section = document.getElementsByTagName("div");
            for(var x=0; x<Section.length; x++) {
                  name = Section[x].getAttribute("name");
                  if (name == 'Section') {
                        if (Section[x].id == thechosenone) {
                        Section[x].style.display = 'block';
                  }
                  else {
                        Section[x].style.display = 'none';
                  }
            }
      }
}

/*******************************************************
RANDOMIZE LIST ITEMS
********************************************************/

$(document).ready(function(){
      $('ul.Random').each(function(){
            // get current ul
            var $ul = $(this);
            // get array of list items in current ul
            var $liArr = $ul.children('li');
            // sort array of list items in current ul randomly
            $liArr.sort(function(a,b){
                  // Get a random number between 0 and 10
                  var temp = parseInt( Math.random()*10 );
                  // Get 1 or 0, whether temp is odd or even
                  var isOddOrEven = temp%2;
                  // Get +1 or -1, whether temp greater or smaller than 5
                  var isPosOrNeg = temp>5 ? 1 : -1;
                  // Return -1, 0, or +1
                  return( isOddOrEven*isPosOrNeg );
            })
            // append list items to ul
            .appendTo($ul);            
      });
});

/*******************************************************
FORM LOGIC - HIDE AND SHOW BASED ON SELECTIONS
********************************************************/

$(document).ready(function() {
	if (window.location.hash === '#multiple' ) { $('#Question_Name_1').css('display','block'); }
	if (window.location.hash === '#rating' ) { $('#Question_Name_2').css('display','block'); }
	if (window.location.hash === '#textbox' ) { $('#Question_Name_3').css('display','block'); }
	if (window.location.hash === '#number' ) { $('#Question_Name_4').css('display','block'); }
	if (window.location.hash === '#datetime' ) { $('#Question_Name_5').css('display','block'); }
	if (window.location.hash === '#commentbox' ) { $('#Question_Name_6').css('display','block'); }
});

function Logic1(){

  switch (document.getElementById("Selection_Logic1").options[document.getElementById("Selection_Logic1").selectedIndex].value){
  case 'Default':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="none";
	break;	  
  case 'Multiple':
 	document.getElementById('Question_Name_1').style.display="block"; window.location.hash = '#multiple';	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="none";
	break;	
  case 'Rating':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="block"; window.location.hash = '#rating';	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="none";
	break;	
  case 'Text':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="block"; window.location.hash = '#textbox';
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="none";
	break;	
  case 'Comment':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="block"; window.location.hash = '#commentbox';
	break;	
  case 'Number':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="block"; window.location.hash = '#number'
	document.getElementById('Question_Name_5').style.display="none";
	document.getElementById('Question_Name_6').style.display="none";
	break;	
  case 'Date':
 	document.getElementById('Question_Name_1').style.display="none";	 
	document.getElementById('Question_Name_2').style.display="none";	
	document.getElementById('Question_Name_3').style.display="none";
	document.getElementById('Question_Name_4').style.display="none";
	document.getElementById('Question_Name_5').style.display="block"; window.location.hash = '#datetime'
	document.getElementById('Question_Name_6').style.display="none";
 	break;	

  }
}

function LogicFilters(){
  switch (document.getElementById("Selection_Logic_Filters").options[document.getElementById("Selection_Logic_Filters").selectedIndex].value){	
  	case 'Default':
	document.getElementById('customFilters').style.display="none";	
	break;	  
	case 'Standard_1':
	document.getElementById('customFilters').style.display="none";	
	break;	
	case 'Standard_2':
	document.getElementById('customFilters').style.display="none";	
	break;	
	case 'Standard_3':
	document.getElementById('customFilters').style.display="none";	
	break;	
	case 'Standard_4':
	document.getElementById('customFilters').style.display="none";	
	break;	
	case 'Standard_5':
	document.getElementById('customFilters').style.display="none";	
	break;	  	
	case 'customFilter':
	document.getElementById('customFilters').style.display="block";	 
	break;	
  }
}


$(function() {
        $('#showFilters').change(function(){
            $('.filterOptions').fadeOut("medium");
            $('#' + $(this).val()).fadeIn("medium");
        });
    });

/*******************************************************
CHECK BOX - ONLY SELECT ONE
********************************************************/
$('.q_a').live('click',function(){
    if (this.checked)
    {
      $('.q_b').attr('checked', false);
	  $('.q_c').attr('checked', false);	
    }
});
$('.q_b').live('click',function(){
    if (this.checked)
    {
      $('.q_a').attr('checked', false);
	  $('.q_c').attr('checked', false);	
    }
});
$('.q_c').live('click',function(){
    if (this.checked)
    {
      $('.q_a').attr('checked', false);
	  $('.q_b').attr('checked', false);	
    }
});
$('.q_d').live('click',function(){
    if (this.checked)
    {
      $('.q_e').attr('checked', false);
	  $('.q_f').attr('checked', false);	
    }
});
$('.q_e').live('click',function(){
    if (this.checked)
    {
      $('.q_d').attr('checked', false);
	  $('.q_f').attr('checked', false);	
    }
});
$('.q_f').live('click',function(){
    if (this.checked)
    {
      $('.q_d').attr('checked', false);
	  $('.q_e').attr('checked', false);	
    }
});
$('.q_g').live('click',function(){
    if (this.checked)
    {
      $('.q_h').attr('checked', false);
	  $('.q_i').attr('checked', false);	
    }
});
$('.q_h').live('click',function(){
    if (this.checked)
    {
      $('.q_g').attr('checked', false);
	  $('.q_i').attr('checked', false);	
    }
});
$('.q_i').live('click',function(){
    if (this.checked)
    {
      $('.q_h').attr('checked', false);
	  $('.q_g').attr('checked', false);	
    }
});
$('.q_j').live('click',function(){
    if (this.checked)
    {
      $('.q_k').attr('checked', false);
	  $('.q_l').attr('checked', false);	
    }
});
$('.q_k').live('click',function(){
    if (this.checked)
    {
      $('.q_j').attr('checked', false);
	  $('.q_l').attr('checked', false);	
    }
});
$('.q_l').live('click',function(){
    if (this.checked)
    {
      $('.q_k').attr('checked', false);
	  $('.q_j').attr('checked', false);	
    }
});

/*******************************************************
OTHER INPUT, SKIP BUTTONS 
********************************************************/
$('.Other').live('click',function(){
    if (this.checked)
    {
      $('#Other_Input').fadeIn('medium');
	  $('#Other_Input2').fadeOut('medium');	
    }
    else
    {		
        if ( !$('.checkbox:checked').length )
        {
            $('#Other_Input').fadeOut('medium');
			clearField();	
        }
    }
});

$('.Other2').live('click',function(){
    if (this.checked)
    {
      $('#Other_Input').fadeOut('medium');
	  $('#Other_Input2').fadeIn('medium');	
    }
    else
    {
        if ( !$('.checkbox:checked').length )
        {
            $('#Other_Input2').fadeOut('medium');
			clearField();	
        }
    }
});
$('.skipLogic').live('click',function(){
    if (this.checked)
    {
      $('#skipLogic').fadeIn('medium');
    }
    else
    {
        if ( !$('.checkbox:checked').length )
        {
            $('#skipLogic').fadeOut('medium');
			clearField();	
        }
    }
});




$('.showQ_1').live('click',function(){
    $('#showQ_1').fadeIn('medium');		     
});
$('.hideQ_1').live('click',function(){
    $('#showQ_1').fadeOut ('medium');		     
});
$('.showQ_2').live('click',function(){
    $('#showQ_2').fadeIn('medium');		     
});
$('.hideQ_2').live('click',function(){
    $('#showQ_2').fadeOut ('medium');		     
});
$('.showQ_3').live('click',function(){
    $('#showQ_3').fadeIn('medium');		     
});
$('.hideQ_3').live('click',function(){
    $('#showQ_3').fadeOut ('medium');		     
});
$('.showQ_4').live('click',function(){
    $('#showQ_4').fadeIn('medium');		     
});
$('.hideQ_4').live('click',function(){
    $('#showQ_4').fadeOut ('medium');		     
});





function clearField(){
	var cf = document.getElementById("Other");
	cf.value = ""; 
	var cf2 = document.getElementById("Other2");
	cf2.value = ""; 	
;}

$('.NonOther').live('click',function(){
	var submitButton = $('#the-question-form input[type=submit]');
	$(submitButton).removeAttr('disabled');
	$('#Other_Input').fadeOut('medium');
	$('#Other_Input2').fadeOut('medium');
	clearField();	
});

$('.NonSkip').live('click',function(){
    $('#nextStandard').fadeIn("medium");
    $('#nextSkip').fadeOut("medium");	
    $('#nextSkip2').fadeOut("medium");					
});

$('.skip').live('click',function(){
	$('#nextStandard').fadeOut("medium");
    $('#nextSkip').fadeIn("medium");
	$('#nextSkip2').fadeOut("medium");				     
});
$('.skip2').live('click',function(){
     $('#nextStandard').fadeOut("medium");
     $('#nextSkip').fadeOut("medium");	
     $('#nextSkip2').fadeIn("medium");			     
});

$('.showReport_1').live('click',function(){
   	$('#report_1').fadeIn('medium');	
	<!--$('#report_1').css('display','inline');-->
    $('#report_2').fadeOut("medium");	
    $('#report_3').fadeOut("medium");
	$('#report_4').fadeOut("medium");
	showActive_report_1();						
});
$('.showReport_2').live('click',function(){
   	$('#report_2').fadeIn('medium');	
    $('#report_1').fadeOut("medium");	
    $('#report_3').fadeOut("medium");
	$('#report_4').fadeOut("medium");
	showActive_report_2();							
});
$('.showReport_3').live('click',function(){
   	$('#report_3').fadeIn('medium');	
    $('#report_1').fadeOut("medium");	
    $('#report_2').fadeOut("medium");	
    $('#report_4').fadeOut("medium");	
	showActive_report_3();					
});
$('.showReport_4').live('click',function(){
   	$('#report_4').fadeIn('medium');	
    $('#report_1').fadeOut("medium");	
    $('#report_2').fadeOut("medium");	
    $('#report_3').fadeOut("medium");						
});

$('.showDemo_1_A').live('click',function(){
   	$('#demo_1_A').fadeIn('medium');
    $('#demo_1_B').fadeOut(.0001);				
});
$('.showDemo_1_B').live('click',function(){
   	$('#demo_1_A').fadeOut(.0001);	
    $('#demo_1_B').fadeIn('medium');			
});
$('.showDemo_2_A').live('click',function(){
   	$('#demo_2_A').fadeIn('medium');
    $('#demo_2_B').fadeOut(.0001);				
});
$('.showDemo_2_B').live('click',function(){
   	$('#demo_2_A').fadeOut(.0001);	
    $('#demo_2_B').fadeIn('medium');			
});
$('.showDemo_3_A').live('click',function(){
   	$('#demo_3_A').fadeIn('medium');
    $('#demo_3_B').fadeOut(.0001);				
});
$('.showDemo_3_B').live('click',function(){
   	$('#demo_3_A').fadeOut(.0001);	
    $('#demo_3_B').fadeIn('medium');			
});
$('.showDemo_4_A').live('click',function(){
   	$('#demo_4_A').fadeIn('medium');
    $('#demo_4_B').fadeOut(.0001);				
});
$('.showDemo_4_B').live('click',function(){
   	$('#demo_4_A').fadeOut(.0001);	
    $('#demo_4_B').fadeIn('medium');			
});


$('.showQuestion_1').live('click',function(){
   	$('#question_1').fadeIn('medium');						
});


function show_1(){
$(document).ready(function() { 
	$('#show_1').fadeIn('medium');
	$('#show_2').fadeOut("medium");
	$('#show_3').fadeOut("medium");
	$('#show_4').fadeOut("medium");
	}); 
}
function show_2(){
$(document).ready(function() { 
	$('#show_1').fadeOut("medium");
	$('#show_2').fadeIn('medium');
	$('#show_3').fadeOut("medium");
	$('#show_4').fadeOut("medium");
	}); 
}
function show_3(){
$(document).ready(function() { 
	$('#show_1').fadeOut("medium");
	$('#show_2').fadeOut("medium");
	$('#show_3').fadeIn('medium');
	$('#show_4').fadeOut("medium");
	}); 
}
function show_4(){
$(document).ready(function() { 
	$('#show_1').fadeOut("medium");
	$('#show_2').fadeOut("medium");
	$('#show_3').fadeOut("medium");
	$('#show_4').fadeIn('medium');
	}); 
}

/*******************************************************
RADIO SELECTION SUB LISTS
********************************************************/
$(function(){     
  $('.radio_Custom_2').click(function(){
    if ($(this).attr("id") == "option_1")
    {
      $('#1_content').fadeIn("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	 	  	 	  		  
    } 
    else if ($(this).attr("id") == "option_2")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeIn("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 
    else if ($(this).attr("id") == "option_3")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeIn("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 
    else if ($(this).attr("id") == "option_4")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeIn("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 			
    else if ($(this).attr("id") == "option_5")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeIn("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 
    else if ($(this).attr("id") == "option_6")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeIn("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 
    else if ($(this).attr("id") == "option_7")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeIn("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");	  
    } 	
    else if ($(this).attr("id") == "option_8")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeIn("fast");	
      $('#9_content').fadeOut("fast");	  
    } 
    else if ($(this).attr("id") == "option_9")
    {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeIn("fast");	  
    } 	
	// else if ($(this).attr("id") == "option_2_1")
	//     {
	//       $('#2_1_content').fadeOut("fast");  
	//     } 
	// else if ($(this).attr("id") == "option_2_2")
	//     {
	//       $('#2_1_content').fadeOut("fast");  
	//     } 
	// // else if ($(this).attr("id") == "option_2_3")
	// //     {
	// //       $('#2_1_content').fadeIn("fast");  
	// //     } 			
	else {
      $('#1_content').fadeOut("fast");
      $('#2_content').fadeOut("fast");	
      $('#3_content').fadeOut("fast");	 
      $('#4_content').fadeOut("fast");
      $('#5_content').fadeOut("fast");	
      $('#6_content').fadeOut("fast");
      $('#7_content').fadeOut("fast");
      $('#8_content').fadeOut("fast");	
      $('#9_content').fadeOut("fast");
	   
    }
    });
});

/*******************************************************
ADD AND REMOVE DIVS
********************************************************/
function addDiv() {
	var ele = document.getElementById("Section_2_A");
		ele.style.display = "block";
} 
function deleteDiv() {
	var ele = document.getElementById("Section_2_A");
		ele.style.display = "none";
} 


/*******************************************************
COMPACT FORM - DEFAULT TEXT VALUES - SCRIPT
********************************************************/
var active_color = '#2d2d2d'; // Colour of user provided text
var inactive_color = '#a0a0a0'; // Colour of default text

jQuery(document).ready(function() {
  jQuery("input.default-value").css("color", inactive_color);
  var default_values = new Array();
  jQuery("input.default-value").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    jQuery(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});

jQuery(document).ready(function() {
  jQuery("input.default-value-2").css("color", inactive_color);
  var default_values = new Array();
  jQuery("input.default-value-2").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    jQuery(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});


jQuery(document).ready(function() {
  jQuery("textarea.default-value-3").css("color", inactive_color);
  var default_values = new Array();
  jQuery("textarea.default-value-3").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    jQuery(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});


/*******************************************************
ADD and REMOVE INPUT BOXES
********************************************************/
$(function() {
	var i01 = $('input').size() + 1;
	var i02 = $('input').size() + 1;
	var i03 = $('.answersMC').size() + 1;
	$('a.add').click(function() {
		$('<input type="text" class="searchGraphic" value="30 Rock" readonly="readonly"/>').animate({ opacity: "show" }, "slow").appendTo('#inputs');
		i01++;
	});
	$('a.add2').click(function() {
		$('<input type="text" class="searchGraphic" value="Two and A Half Men" readonly="readonly"/>').animate({ opacity: "show" }, "slow").appendTo('#inputs');
		i02++;
	});	
	
	$('a.remove').click(function() {
	if(i01 > 2) {
		$('input:last').animate({opacity:"hide"}, "slow").remove();
		i01--;	
	}
	});
	$('a.remove2').click(function() {
	if(i02 > 3) {
		$('input:last').animate({opacity:"hide"}, "slow").remove();
		i02--;	
	}
	});		
});

 
 
/*******************************************************
SEARCH BOX - SUBMIT ON ENTER 
********************************************************/
    function submitenter(myfield,e)
    {
        var keycode;
        if (window.event) keycode = window.event.keyCode;
        else if (e) keycode = e.which;
        else return true;

        if (keycode == 13) 
        {
            location.href = 'find_1.html';
            return false;
        }
        else
            return true;
    }







/*******************************************************
SUCCESS MESSAGES
********************************************************/
var myMessages = ['info','warning','error','success']; // define the messages types		 
function hideAllMessages() { $('.success').css('top', -$('.success').outerHeight()); }
function showMessage(type)
{
	$('.success-trigger').live("click", function(){				  
		  $('.success').animate({top: "0"}, 300);
		  hideAllMessages();
	});
}
$(document).ready(function(){

	// Initially, hide them all
	hideAllMessages();

	$('.success-trigger').live("click", function(){				  
		  $('.success').animate({top: "0"}, 300);
		  hideAllMessages();
	});

	// When message is clicked, hide it
	$('.message').click(function(){
	$(this).animate({top: -$(this).outerHeight()}, 500);
	});

	// Auto hide message after set time
	setTimeout(function(){
		$('.message').animate({top: -$('.message').outerHeight()}, 500);
		},3000);
});  


// $('.inactive').click(function(){
// 	$('input[name=survey_name]').addClass('.error')
// })
