// JavaScript Document

$(document).ready(function(){

	   		// Used for menu dropdowns

			$("ul.topnav li a").click(function() { //When trigger is clicked...



				  //Following events are applied to the subnav itself (moving subnav up and down)

				  $(this).parent().find("ul.subnav").slideDown('slow').show(); //Drop down the subnav on click

		  		  $(this).parent().find("ul.subnav2").slideDown('slow').show(); //Drop down the subnav on click

				  $(this).parent().find("ul.subnav3").slideDown('slow').show(); //Drop down the subnav on click

				  $(this).parent().find("ul.subnav4").slideDown('slow').show(); //Drop down the subnav on click

		  

				  $(this).parent().hover(function() {

				  }, function(){

					  $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up

					  $(this).parent().find("ul.subnav2").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up

					  $(this).parent().find("ul.subnav3").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up

					  $(this).parent().find("ul.subnav4").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up

				  });

		

				//Following events are applied to the trigger (Hover events for the trigger)

				}).hover(function() {

					//$(this).addClass("subhover"); //On hover over, add class "subhover"

					$(this).parent().find("ul.subnav li a").addClass("subhover");

					$(this).parent().find("ul.subnav2 li a").addClass("subhover");

					$(this).parent().find("ul.subnav3 li a").addClass("subhover");

					$(this).parent().find("ul.subnav4 li a").addClass("subhover");

				}, function(){	//On Hover Out

					$(this).removeClass("subhover"); //On hover out, remove class "subhover"

			});

		 

			// Used for revolving images on home page

			$('ul#photos').innerfade({

				speed: 1000,

				timeout: 5000,

				type: 'sequence',

				containerheight: '442px'

			});



			// Get rid of outline on links

			﻿if (document.documentElement.attachEvent)

			document.documentElement.attachEvent('onmousedown',function(){

				 event.srcElement.hideFocus=true

			});

			

		

			

});



// Simple JQuery  Accordion menu.



//jQuery.fn.initMenu = function() {  

//    return this.each(function(){

//        var theMenu = $(this).get(0);

//        $('.acitem', this).hide();

//        $('li.expand > .acitem', this).show();

//        $('li.expand > .acitem', this).prev().addClass('active');

//        $('li a', this).click(

//            function(e) {

//                e.stopImmediatePropagation();

//                var theElement = $(this).next();

//                var parent = this.parentNode.parentNode;

//                if($(parent).hasClass('noaccordion')) {

//                    if(theElement[0] === undefined) {

//                        window.location.href = this.href;

//                    }

//                    $(theElement).slideToggle('normal', function() {

//                        if ($(this).is(':visible')) {

//                            $(this).prev().addClass('active');

//                        }

//                        else {

//                            $(this).prev().removeClass('active');

//                        }    

//                    });

//                    return false;

//                }

//                else {

//                    if(theElement.hasClass('acitem') && theElement.is(':visible')) {

//                        if($(parent).hasClass('collapsible')) {

//                            $('.acitem:visible', parent).first().slideUp('normal', 

//                            function() {

//                                $(this).prev().removeClass('active');

//                            }

//                        );

//                        return false;  

//                    }

//                    return false;

//                }

//                if(theElement.hasClass('acitem') && !theElement.is(':visible')) {         

//                    $('.acitem:visible', parent).first().slideUp('normal', function() {

//                        $(this).prev().removeClass('active');

//                    });

//                    theElement.slideDown('normal', function() {

//                        $(this).prev().addClass('active');

//                    });

//                    return false;

//                }

//            }

//        }

//    );

//});

//};

//

//$(document).ready(function() {$('.menu').initMenu();});		



function MM_goToURL() { //v3.0

  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;

  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");

}



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}
