// JavaScript Document
function on_display(id){
	on_off();
	document.getElementById("tb0").style.display="";
	document.getElementById(id).style.display="";
}
function on_off(){
	document.getElementById("tb0").style.display="none";
	document.getElementById("tr1").style.display="none";
	document.getElementById("tr2").style.display="none";
	
}
function on_hidden(){
	setTimeout('on_off()',1500);
}
$(document).ready(function() {
						   $("ul#topnav li").find("span").parent().css({ 'background' : 'url(templates/default/template_images/topnav_fet.png) right top no-repeat'});
							$('#current').css({ 'background' : 'url(templates/default/template_images/topnav_active.png) center top repeat-x','color':'#666666'});
							$("ul#topnav li").hover(function() { //Hover over event on list item
							//$('#current').css({ 'background' : 'url(template_images/topnav_fet.png) right top no-repeat','color':'#666666'});
							//$("ul#topnav li").find("span").hide();
							$(this).css({ 'background' : 'url(templates/default/template_images/topnav_active.png) center top repeat-x'}); //Add background color + image on hovered list item
							//$(this).find("span").show();//Show the subnav
					} ,
					function() { //on hover out...
							//$(this).css({ 'background' : 'none'}); //Ditch the background
							$(this).css({ 'background' : 'url(templates/default/template_images/topnav_fet.png) right top no-repeat'});
							$(this).find("span").hide(); //Hide the subnav
							//$("ul#topnav li#current").find("span").show();
							$("ul#topnav li#current").css({ 'background' : 'url(templates/default/template_images/topnav_active.png) center top repeat-x'});    });
								});




/*

//slide CAtegories
$(document).ready(function() {	

	//Background color, mouseover and mouseout
	var colorOver = '#31b8da';
	var colorOut = '#1f1f1f';

	//Padding, mouseover
	var padLeft = '20px';
	var padRight = '20px';
	
	//Default Padding
	var defpadLeft = $('#menu li a').css('paddingLeft');
	var defpadRight = $('#menu li a').css('paddingRight');
		
	//Animate the LI on mouse over, mouse out
	$('#menu li').click(function () {	
		//Make LI clickable
		window.location = $(this).find('a').attr('href');
		
	}).mouseover(function (){
		
		//mouse over LI and look for A element for transition
		$(this).find('a')
		.animate( { paddingLeft: padLeft, paddingRight: padRight}, { queue:false, duration:100 } )
		.animate( { backgroundColor: colorOver }, { queue:false, duration:200 });

	}).mouseout(function () {
	
		//mouse oout LI and look for A element and discard the mouse over transition
		$(this).find('a')
		.animate( { paddingLeft: defpadLeft, paddingRight: defpadRight}, { queue:false, duration:100 } )
		.animate( { backgroundColor: colorOut }, { queue:false, duration:200 });
	});	
	
	//Scroll the menu on mouse move above the #sidebar layer
	$('#sidebar').mousemove(function(e) {

		//Sidebar Offset, Top value
		var s_top = parseInt($('#sidebar').offset().top);		
		
		//Sidebar Offset, Bottom value
		var s_bottom = parseInt($('#sidebar').height() + s_top);
	
		//Roughly calculate the height of the menu by multiply height of a single LI with the total of LIs
		var mheight = parseInt($('#menu li').height() * $('#menu li').length);
	
		//I used this coordinate and offset values for debuggin
		$('#debugging_mouse_axis').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
		$('#debugging_status').html(Math.round(((s_top - e.pageY)/100) * mheight / 2));
			
		//Calculate the top value
		//This equation is not the perfect, but it 's very close	
		var top_value = Math.round(( (s_top - e.pageY) /100) * mheight / 2);
		
		//Animate the #menu by chaging the top value
		$('#menu').animate({top: top_value}, { queue:false, duration:500});
	});

	
});




$(function () {
  
  var msie6 = $.browser == 'msie' && $.browser.version < 7;
  
  if (!msie6) {
    var top = $('#comment').offset().top - parseFloat($('#comment').css('margin-top').replace(/auto/, 0));
    $(window).scroll(function (event) {
      // what the y position of the scroll is
      var y = $(this).scrollTop();
      
      // whether that's below the form
      if (y >= top) {
        // if so, ad the fixed class
        $('#comment').addClass('fixed');
      } else {
        // otherwise remove it
        $('#comment').removeClass('fixed');
      }
    });
  }  
});*/