<!--//---------------------------------+
//  Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use
//
// The code below has been altered from the original.
// visit Rohan's website to see the original code.
// --------------------------------->

$(document).ready(function()
{
	////set variables for counters
	var $tab1=0;
	var $tab2=0;
	var $tab3=0;
	var $tab4=0;
	var $tab5=0;
	var $tab6=0;


//////////////////////////TAB 1//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head1" is clicked 
	$("#secondpane div.graphic_head1").click(function()
    {
		$tab1=$tab1 + 1; //when tab is click increase it's counter by 1
		$tab2=0; //reset all the other tabs counters
		$tab3=0;
		$tab4=0;
		$tab5=0;
		$tab6=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab1==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab1=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head1 click funtion
	
	
//////////////////////////TAB 2//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head2" is clicked 
	$("#secondpane div.graphic_head2").click(function()
    {
		$tab2=$tab2 + 1; //when tab is click increase it's counter by 1
		$tab1=0; //reset all the other tabs counters
		$tab3=0;
		$tab4=0;
		$tab5=0;
		$tab6=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab2==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab2=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head2 click funtion	
	

//////////////////////////TAB 3//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head3" is clicked 
	$("#secondpane div.graphic_head3").click(function()
    {
		$tab3=$tab3 + 1; //when tab is click increase it's counter by 1
		$tab1=0; //reset all the other tabs counters
		$tab2=0;
		$tab4=0;
		$tab5=0;
		$tab6=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab3==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab3=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head3 click funtion



//////////////////////////TAB 4//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head2" is clicked 
	$("#secondpane div.graphic_head4").click(function()
    {
		$tab4=$tab4 + 1; //when tab is click increase it's counter by 1
		$tab1=0; //reset all the other tabs counters
		$tab2=0;
		$tab3=0;
		$tab5=0;
		$tab6=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow2.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab4==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab4=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head4 click funtion
	
	
//////////////////////////TAB 5//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head2" is clicked 
	$("#secondpane div.graphic_head5").click(function()
    {
		$tab5=$tab5 + 1; //when tab is click increase it's counter by 1
		$tab1=0; //reset all the other tabs counters
		$tab2=0;
		$tab3=0;
		$tab4=0;
		$tab6=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab5==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab5=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head5 click funtion
	
//////////////////////////TAB 6//////////////////////////////////////////
//slides the element with class "menu_body" when paragraph with class "menu_head2" is clicked 
	$("#secondpane div.graphic_head6").click(function()
    {
		$tab6=$tab6 + 1; //when tab is click increase it's counter by 1
		$tab1=0; //reset all the other tabs counters
		$tab2=0;
		$tab3=0;
		$tab5=0;
		$tab4=0;
		
		//change this image to open, and animate body open
		$(this).css({backgroundImage:"url(images/graphic-panel-arrow.png)"}).next("div.graphic_body").slideToggle(300).siblings("div.graphic_body").slideUp("slow");
		
		//change all other siblings back to closed image
       	$(this).siblings("div.graphic_tab").css({backgroundImage:"url(images/empty.gif)"});


		if($tab6==2){ //if the same tab is clicked twice - when the counter hits '2'
		$(this).css({backgroundImage:"url(images/empty.gif)"}); //switch back to original image
		$tab6=0; //reset counter for this tab
		}; //end if

	}); //end graphic_head6 click funtion

	
}); //end document.ready
