// JavaScript Document
google.load("jquery", "1.3.2");
  google.load("jqueryui", "1.7.2");
  
  google.setOnLoadCallback(function() {
	var counti = 1;
	
	 $('div.menu-name-primary-links ul').find('ul.menu').hide();
				 $('div.menu-name-primary-links ul').find('li.active-trail').parent().show().parent().toggleClass('open');
				 $('div.menu-name-primary-links .expanded').find(":first").each(function() {
											$(this).attr("href","#");											 
																						 });
    $('div.menu-name-primary-links .expanded').find(":first").click(function() {
		if ($(this).parent().parent().parent().attr("class").indexOf("open") > 1 || $(this).parent().parent().attr("class").indexOf("open") > 1 ) {
			return true;
			
			$(this).attr("href","#");

		} else {
			
			//alert($(this).parent().parent().parent().attr("class"));
			$(this).parent().toggleClass('open').siblings().removeClass('open').end()
			.find('ul').slideToggle(400).end()
			.siblings('li').find('ul:visible').slideToggle(800);
			return false;
		}
	//}
	
	});

$('div.menu-name-primary-links .expanded a').find(":first").click(function() {
return false;
	
															 
	 });
	$(".loading").css({"display" : "none"});
	$(".menu-name-primary-links").css({"position" : "relative", "margin-left" : "0px"});
	
$(".home_colb_row2_a .views-field-title span").each(function() {

	$(this).addClass("home_li"+counti);
counti = counti+1;
											   });
	
$(".expanded a.sIFR-replaced").attr("href", "/");
 
  function theRotator() {
	//Set the opacity of all images to 0
	$('div#rotator ul li').css({opacity: 0.0});
	
	//Get the first image and display it (gets set to full opacity)
	$('div#rotator ul li:first').css({opacity: 1.0});
		
	//Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
	setInterval('rotate()',3000);
	
}


	  	theRotator();
    
//  $(".flashcontainer").flashembed("/themes/pinewood/flash/77-07-002 Pinewood Intro Movie VA.swf",wmode:'opaque');
  
    flashembed("flashcontainer",{src : "/themes/pinewood/flash/77-07-002 Pinewood Intro Movie VA.swf",wmode:'opaque' });

  });