/*code for banner*/
var $j = jQuery.noConflict();

	function slideSwitch() {
		var $jactive = $j('#slideshow IMG.active');
	
		if ( $jactive.length == 0 ) $jactive = $j('#slideshow IMG:last');
	
		// use this to pull the images in the order they appear in the markup
		var $jnext =  $jactive.next().length ? $jactive.next()
			: $j('#slideshow IMG:first');
	
		$jactive.addClass('last-active');
	
		$jnext.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 500, function() {
				$jactive.removeClass('active last-active');
			});
	}

	$j(function() {
		setInterval( "slideSwitch()", 4000 );
		
		
	});


/*MENU.JS*/
$j(document).ready(function() { 
$j("ul#dropmenu ul").css({display: "none"}); // Opera Fix 
$j("ul#dropmenu li").hover(function(){ 
       $j(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
        },function(){ 
        $j(this).find('ul:first').css({visibility: "hidden"}); 
        });

$j("ul#popmenu ul").css({display: "none"}); // Opera Fix 
$j("ul#popmenu li").hover(function(){ 
       $j(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
        },function(){ 
        $j(this).find('ul:first').css({visibility: "hidden"});
        });

});


/*equalheight.hack*/
$j(document).ready(function() {
				var contentH = $j("#content").height(); 
				var sideH = $j("#sidebar").height();
				
	if(contentH > sideH) {
			$j("#sidebar").height(contentH);
		}
		else { 
			if(sideH > 400){	
					$j("#content").height(sideH);
				}else {
					$j("#content").height(600);
				}
			
		}

});



/*scroll totop page*/

$j(document).ready(function(){

	// hide #back-top first
	$j("#back-top").hide();
	
	// fade in #back-top
	$j(function () {
		$j(window).scroll(function () {
			if ($j(this).scrollTop() > 100) {
				$j('#back-top').fadeIn();
			} else {
				$j('#back-top').fadeOut();
			}
		});

		// scroll body to 0px on click
		$j('#back-top a').click(function () {
			$j('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

});
