// JavaScript Document
$(document).ready(function(){
						   
						
						   

//-----------------IE issuewith home menu Fix ------------
		$("#menu li.level1:first ul").hide();
//---------------/End IE Issue--------------------------
//-------------Testimonials--------------------------
		$("p.Testimonials").hide();
		//alert($("p.Testimonials").size());
		
		//Create Random Number between mina nd max and display that testimonial
		$.docready = {} //Declare namespace
		$.docready.RandomNumberAmount = $("p.Testimonials").size(); //Counts total P's with class of Testimonials
		//alert($.docready.RandomNumberAmount);
		$.docready.RandomNumberID = Math.ceil(Math.random()*$.docready.RandomNumberAmount); //Random number and uses counter to get a random num at max of total P's
		//alert($.docready.RandomNumberID);
		$.docready.ParaPlusID = 'p#Test'+ $.docready.RandomNumberID; //Create the name of teh ID to turn on
			//alert($.docready.ParaPlusID);
		//End Create Random Number
		
		$($.docready.ParaPlusID).show('slow');
//------------/Testimonials--------------------------

//-------------Partners--------------------------
		$("a.PartnersIcon").hide();
		//alert($("p.Testimonials").size());
		
		//Create Random Number between mina nd max and display that testimonial
		$.partners = {} //Declare namespace
		$.partners.PartnerRandomNumberAmount = $("a.PartnersIcon").size(); //Counts total P's with class of Testimonials
		//alert($.partners.PartnerRandomNumberAmount);
		$.partners.PartnerRandomNumberID = Math.ceil(Math.random()*$.partners.PartnerRandomNumberAmount); //Random number and uses counter to get a random num at max of total P's
		//$.partners.PartnerRandomNumberID = 12; //Random number and uses counter to get a random num at max of total P's
		//alert($.partners.PartnerRandomNumberID);
		$.partners.PartnerParaPlusID = 'a#Partner'+ $.partners.PartnerRandomNumberID; //Create the name of teh ID to turn on
			//alert($.docready.ParaPlusID);
		//End Create Random Number
		
		$($.partners.PartnerParaPlusID).show();
//------------/Testimonials--------------------------

//------------Drag/Drop--------------------------

	$("#draggable").draggable();
    $("#droppable").droppable({
      drop: function() { alert('dropped'); }
    });
    
    $.dragNdrop = {} //Declare namespace
		$.dragNdrop.dragNumber = 0; //Counts total P's with class of dragNdrops
				
				$(".dragbox01").hide();
				$(".dragbox02").hide();
				$(".dragbox03").hide();
				$(".dragbox04").hide();
				$(".dragbox05").hide();
				$(".dragbox06").hide();
				$(".dragbox07").hide();
				$(".dragbox08").hide();
				$(".dragbox09").hide();
				$(".dragbox10").hide();
				$(".dragbox11").hide();
				
				$(".draggable01").mousedown(function () { 
					$.dragNdrop.dragNumber = 1; //Counts total P's with class of dragNdrops
					//alert($.dragNdrop.dragNumber);
			    });
				$(".draggable02").mousedown(function () { 
					$.dragNdrop.dragNumber = 2; //Counts total P's with class of dragNdrops
									//	alert($.dragNdrop.dragNumber);

			    });
			    $(".draggable03").mousedown(function () { 
					$.dragNdrop.dragNumber = 3; //Counts total P's with class of dragNdrops
										//alert($.dragNdrop.dragNumber);

			    });
			    $(".draggable04").mousedown(function () { 
					$.dragNdrop.dragNumber = 4; //Counts total P's with class of dragNdrops
									//alert($.dragNdrop.dragNumber);

			    });
			    $(".draggable05").mousedown(function () { 
					$.dragNdrop.dragNumber = 5; //Counts total P's with class of dragNdrops
										//alert($.dragNdrop.dragNumber);

			    });
			    $(".draggable06").mousedown(function () { 
					$.dragNdrop.dragNumber = 6; //Counts total P's with class of dragNdrops
			    });
			    $(".draggable07").mousedown(function () { 
					$.dragNdrop.dragNumber = 7; //Counts total P's with class of dragNdrops
			    });
			    $(".draggable08").mousedown(function () { 
					$.dragNdrop.dragNumber = 8; //Counts total P's with class of dragNdrops
			    });
			    $(".draggable09").mousedown(function () { 
					$.dragNdrop.dragNumber = 9; //Counts total P's with class of dragNdrops
			    });
			    $(".draggable10").mousedown(function () { 
					$.dragNdrop.dragNumber = 10; //Counts total P's with class of dragNdrops
			    });
			    $(".draggable11").mousedown(function () { 
					$.dragNdrop.dragNumber = 11; //Counts total P's with class of dragNdrops
			    });			    
		
				$(".draggable01").draggable( { revert: true, containment: 'document' } );
				$(".draggable02").draggable( { revert: true, containment: 'document' } );
				$(".draggable03").draggable( { revert: true, containment: 'document' } );
				$(".draggable04").draggable( { revert: true, containment: 'document' } );
				$(".draggable05").draggable( { revert: true, containment: 'document' } );
				$(".draggable06").draggable( { revert: true, containment: 'document' } );
				$(".draggable07").draggable( { revert: true, containment: 'document' } );
				$(".draggable08").draggable( { revert: true, containment: 'document' } );
				$(".draggable09").draggable( { revert: true, containment: 'document' } );
				$(".draggable10").draggable( { revert: true, containment: 'document' } );
				$(".draggable11").draggable( { revert: true, containment: 'document' } );
			    
			    
			    $("#dragbox").droppable({
			      drop: function() { 
			      
			      switch ($.dragNdrop.dragNumber){
					case 1:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").fadeIn("slow");
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 2:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").fadeIn("slow");
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 3:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").fadeIn("slow");
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 4:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").fadeIn("slow");
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 5:
						//alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").fadeIn("slow");
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 6:
						//alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").fadeIn("slow");
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 7:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").fadeIn("slow");
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 8:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").fadeIn("slow");
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 9:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").fadeIn("slow");
						$(".dragbox10").hide();
						$(".dragbox11").hide();
					break;
					case 10:
					//	alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").fadeIn("slow");
						$(".dragbox11").hide();
					break;
					case 11:
						//alert($.dragNdrop.dragNumber);
						$(".dragbox01").hide();
						$(".dragbox02").hide();
						$(".dragbox03").hide();
						$(".dragbox04").hide();
						$(".dragbox05").hide();
						$(".dragbox06").hide();
						$(".dragbox07").hide();
						$(".dragbox08").hide();
						$(".dragbox09").hide();
						$(".dragbox10").hide();
						$(".dragbox11").fadeIn("slow");
					break;
					
					
					
					default : alert("!");
					}
			      
			      }
			    });

//------------Drag/Drop--------------------------


//------------how to become a foster parent--------------------------
		$("div#supportforexpenses").hide();
		$("div#supportservices").hide();
		$("div#howtobecome").hide();

	
			$('a#supportforexpenseslink').click(function() {
				 $('div#supportforexpenses').toggle(400);
				 return false;
			});
			$('a#supportserviceslink').click(function() {
				 $('div#supportservices').toggle(400);
				 return false;
			});		
			$('a#howtobecomelink').click(function() {
				 $('div#howtobecome').toggle(400);
				 return false;
			});		
			
		$("div#becomeafoster").hide();
		$("div#whoarethechildren").hide();
		$("div#whoiseligible").hide();		
		$("div#stepstobecoming").hide();
		$("div#adoptingafosterchild").hide();

			$('a#becomeafosterlink').click(function() {
				 $('div#becomeafoster').toggle(400);
				 return false;
			});
			$('a#whoarethechildrenlink').click(function() {
				 $('div#whoarethechildren').toggle(400);
				 return false;
			});		
			$('a#whoiseligiblelink').click(function() {
				 $('div#whoiseligible').toggle(400);
				 return false;
			});	
			$('a#stepstobecominglink').click(function() {
				 $('div#stepstobecoming').toggle(400);
				 return false;
			});
			$('a#adoptingafosterchildlink').click(function() {
				 $('div#adoptingafosterchild').toggle(400);
				 return false;
			});		
						

				

		

//------------how to become a foster parent END--------------------------


//_______STORY----------
		$("div#carrie").hide();
		$("div#darien").hide();
		$("div#john").hide();
		$("div#bart").hide();

	
			$('a#carrielink').click(function() {
				 $('div#carrie').toggle(400);
				 return false;
			});
			$('a#darienlink').click(function() {
				 $('div#darien').toggle(400);
				 return false;
			});		
			$('a#johnlink').click(function() {
				 $('div#john').toggle(400);
				 return false;
			});	
			$('a#bartlink').click(function() {
				 $('div#bart').toggle(400);
				 return false;
			});	

		var StoriezLocation = String(window.location);
		var WhichStoriez =StoriezLocation.slice(StoriezLocation.indexOf("#")+1);
		
		//alert (WhichStoriez);
				
		switch (WhichStoriez)
			{
			case 'Bart':
				$('div#bart').toggle(400);
				$('div#john').hide();
				$('div#darien').hide();
				$('div#carrie').hide();
			  break;
			case 'John':
			  $('div#bart').hide();
				$('div#john').toggle(400);
				$('div#darien').hide();
				$('div#carrie').hide();
			  break;
			case 'Darien':
			  $('div#bart').hide();
				$('div#john').hide();
				$('div#darien').toggle(400);
				$('div#carrie').hide();
			  break;
			case 'Carrie':
			  $('div#bart').hide();
				$('div#john').hide();
				$('div#darien').hide();
				$('div#carrie').toggle(400);
			  break;
			default:
			  //alert("OMG");
		}
			

//_______STORY----------END



//``````````````````````End of Doc Ready``````````````````````		
    });
    
    

