// JavaScript Document
$(document).ready(function(){  

/*	var d = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var m = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec");
	var now = new Date();
	
	dateP = document.getElementById('date');
	dateP.innerHTML = ""+ d[now.getDay()] + ", " + now.getDate() + " " + m[now.getMonth()] + " " + now.getFullYear() + "&nbsp;";*/
	
	// Simple tabContent for product details  
	
  showhide = function(containerId) {
		alert(1)
  	
		$(containerId).css('min-height','600px');
    
		var index = -1;
    var current = -1;
    var effectDuration = 600;

		var container = $(containerId);

		var show = function(ind){
						$('h3:eq('+ind+')', container).addClass('show');
						$('h3:eq('+ind+')', container).removeClass('hide');
		}

		var hide = function(ind){
						$('h3:eq('+ind+')', container).addClass('hide');
						$('h3:eq('+ind+')', container).removeClass('show');
		}
		
    $('h3',container).each(function() 
		{      
      index++;  
		
      $(this)
        .attr('tabIndex', index)
				.css({cursor:'pointer'})
        .click(function(event) 
				{
					event.preventDefault();

          newIndex = $(this).attr('tabIndex');
          
					if(current == -1 ) 
					{ // no need to hide current
						$('div.answer:eq('+newIndex+')', container).animate({ height: 'show', opacity: 'show'}, effectDuration, show(newIndex));	
					}
					else if(newIndex == current)
					{
						$('div.answer:eq('+newIndex+')', container).animate({ height: 'hide', opacity: 'hide'}, effectDuration, hide(newIndex));	
					}
					else
					{
						hide(current);
						$('div.answer:eq('+current+')', container).animate({height: 'hide',opacity: 'hide'}, effectDuration, 
							function(){
								$('div.answer:eq('+newIndex+')', container).animate({ height: 'show', opacity: 'show'}, effectDuration);	
								show(newIndex);
							}
						);
					}
          current = newIndex;
        })
				
    });

    $('div.answer', container).hide();
		/*$('div.answer:first', container).show();*/
		$('h3', container).addClass("hide");
/*		$('h3:first', container).addClass("show");*/

  };

	if(jQuery.browser.msie && (jQuery.browser.version.substr(0,3)=="6.0"))
	{
		$("#mainmenu li").bind("mouseenter", function(e){
				$("ul",this).css({display:'block'});
		});
		$("#mainmenu li").bind("mouseleave", function(e){
				$("ul",this).css({display:'none'}) 
		});
	}
	else
	{
		if(location.href.indexOf('news.html') != -1)
		{
			new showhide('#rhs');
		}
		if(location.href.indexOf('aboutus.html') != -1)
		{
			new showhide('#rhs');
		}
	}
	if($('.box25').length > 0 )
	{
		$('.box25').click(function () { 
			location = $(this).attr("rel");
		});
	}
 if(location.href.indexOf('home2.html') != -1)
	{
   $("BODY").addClass('body2');
	}
});
