// JavaScript Document
/*  hide Scroll is to hide scroll bar in case the content is small*/
function hideScroll()
{
	document.getElementById('dragBar').style.display= "none";
	document.getElementById('track').style.display= "none";
}

/***	initializes scroll		**/
function init_dw_Scroll() {
    var wndo = new dw_scrollObj('wn', 'lyr1');
    wndo.setUpScrollbar("dragBar", "track", "v", 1, 1);
    wndo.setUpScrollControls('scrollbar');
}
/*******	Slide Show funcions Start	*************/
function slideSwitch() {
    var $active = $('#slideshow a.active');
                //alert($active.attr('title'));
    if ( $active.length == 0 ) $active = $('#slideshow a:last');
                
                
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow a:first');
                                
                var i= $next.html();
                
                
                $active.addClass('last-active');
                /*$next.addClass('active');
                $active.removeClass('active last-active');*/
                
                
   $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 2000, function() {
            $active.removeClass('active last-active');
        });
                
}
/*		Start loading page 	*/
function start ()
{	init_dw_Scroll ();}
/*******	Slide Show funcions End	*************/
/*	Begin Drop down functions	*/
$(document).ready(
		function() {
					slideSwitch();
			     var $links= $('#slideshow a');
                if ( $links.length > 1 ){
    setInterval( "slideSwitch()", 4000 );
                }//animate if more than 1
			
			$('#nav ul').hide();
			$('#nav > li >ul >li:odd').each(function(){
												$(this).find('a:first').addClass('odd');
												   });
			$('#nav li').hover(
							  function() {
								   $(this).find('ul:first').slideDown('fast');
								   $(this).find('ul:first > li').each(function(){$(this).addClass('hover');});
								   $(this).find('a:first').addClass('hover');
							  },
							function() {
								   $(this).find('ul:first').slideUp('fast');
								   $(this).find('a:first').removeClass('hover');
							  }
							).click(function() {
								   $(this).find('ul:first').toggle('fast');
								   $(this).find('a:first').toggleClass('hover');
								 // return false;
							  });
			}
		);
/*	End Drop down functions	*/
