	
	$(function()
	{	
		
$('table.tablesorter th').mouseover(function(){  $(this).css('cursor','pointer')});
$('table.tablesorter td').find('b').mouseover(function(){  $(this).css('cursor','pointer')});
	   
	   $('.footer-icon a').mouseover(function(event){
   	    $('div.footer-tooltip').remove();
   	    var title = $(this).attr('rel');
        $('<div class="footer-tooltip">'+title+'</div>').appendTo('.main-container');
        $('div.footer-tooltip').css({bottom: 27, left: event.pageX-20});
        }).mouseout(function(){
   	          $('div.footer-tooltip').remove();
     }); 
   
 
       $('.footer-flag a').mouseover(function(event){
   	    $('div.footer-tooltip-flag').remove();
   	    var title = $(this).attr('rel');
        $('<div class="footer-tooltip-flag">'+title+'</div>').appendTo('.main-container');
        $('div.footer-tooltip-flag').css({bottom: 27, left: event.pageX-20});
        }).mouseout(function(){
   	          $('div.footer-tooltip-flag').remove();
     });   

		 var searchBoxes = $(".field"); 
		 var searchBox = $("#search"); 
		 searchBoxDefault = "search...";
		
		 searchBoxes.focus(function(e){
			 $(this).addClass("active");  });   
		 searchBoxes.blur(function(e){
			 $(this).removeClass("active"); }); 
			
		 searchBox.focus(function(){
			 if($(this).attr("value") == searchBoxDefault) $(this).attr("value", "");  });   
		 searchBox.blur(function(){
			 if($(this).attr("value") == "") $(this).attr("value", searchBoxDefault);   });  
		
	
		 $(".main-subcontent h1").each(function(){
	      var status = 'open';
	      $('<img src="/images/layout/naik.png" style="margin-right:20px"/>').prependTo(this);
			  $(this).click(function(){
				
				if (status=='open') { status = 'closed'; 
					$('img',this).attr({'src':'/images/layout/turun.png'});	
					
					 }
				else if (status=='closed') {  status = 'open'; 
					 $('img',this).attr({'src':'/images/layout/naik.png'});	
					 }
         
			  $(this).parent().find('div.content-sub').slideToggle("normal");
        }).mouseover(function(){  $(this).css('cursor','pointer')});
		 });

		 $(".sitemap h1").each(function(){
	      var status = 'open';
	      $('<img src="/images/layout/down.gif" style="margin-left:20px"/>').appendTo(this);
		  $('div.content-sub').hide();
			  $(this).click(function(){
				
				if (status=='open') { status = 'closed'; 
					$('img',this).attr({'src':'/images/layout/up.gif'});	
					
					 }
				else if (status=='closed') {  status = 'open'; 
					 $('img',this).attr({'src':'/images/layout/down.gif'});	
					 }
         
			  $(this).parent().find('div.content-sub').slideToggle("normal");
        }).mouseover(function(){  $(this).css('cursor','pointer')});
		 });

		 $(".sitemap h2").each(function(){
	      var status = 'open';
	      $('<img src="/images/layout/down.gif" style="margin-left:20px"/>').appendTo(this);
		  $('div.content-sub2').hide();
			  $(this).click(function(){
				
				if (status=='open') { status = 'closed'; 
					$('img',this).attr({'src':'/images/layout/up.gif'});	
					
					 }
				else if (status=='closed') {  status = 'open'; 
					 $('img',this).attr({'src':'/images/layout/down.gif'});	
					 }
         
			  $(this).parent().find('div.content-sub2').slideToggle("normal");
        }).mouseover(function(){  $(this).css('cursor','pointer')});
		 });

		 $(".sitemap h3").each(function(){
	      var status = 'open';
	      $('<img src="/images/layout/down.gif" style="margin-left:20px"/>').appendTo(this);
		  $('div.content-sub3').hide();
			  $(this).click(function(){
				
				if (status=='open') { status = 'closed'; 
					$('img',this).attr({'src':'/images/layout/up.gif'});	
					
					 }
				else if (status=='closed') {  status = 'open'; 
					 $('img',this).attr({'src':'/images/layout/down.gif'});	
					 }
         
			  $(this).parent().find('div.content-sub3').slideToggle("normal");
        }).mouseover(function(){  $(this).css('cursor','pointer')});
		 });
  		
	});
	
	ddaccordion.init({
						headerclass: "submenuheader",
						contentclass: "submenu",
						revealtype: "click",
						mouseoverdelay: 200,
						collapseprev: true,
						defaultexpanded: [],
						onemustopen: false,
						animatedefault: false,
						persiststate: true,
						toggleclass: ["", ""],
						togglehtml: ["suffix", "<img src='/images/layout/turun.png' class='statusicon' />", "<img src='/images/layout/naik.png' class='statusicon' />"],
						animatespeed: "fast",
						oninit:function(headers, expandedindices){},
						onopenclose:function(header, index, state, isuseractivated){}
					})

		
					