// JavaScript Document (duh!)



	function hideSubNav() {
		$('#nav_hider').stop().hide();
        if (navigator.appName != 'Microsoft Internet Explorer')
		{
			//$('#our_services_arrow').rotate({animateTo:0});
			$('#sub_nav').stop().animate({opacity: '0', top: '218', height: '0px'}, 750, function() {$(this).hide();});
		}
		else
		{
			$('#sub_nav').stop().hide(0, function() {$(this).animate({top: '192', height: '33px'}, 0);});
		}
		rotateNavArrowBack();
		
	}

	function hideLabel() {
		$('#label_home').fadeOut(750, function() {$(this).hide();});
		$('#label_hider').hide();
	}
	function showLabel(labelName) {
		$(labelName).fadeIn(750);
		$('#label_hider').show();
	}	


	$(document).ready(function() {
		$(this).scrollTop(0);
		$('#sheet').fadeOut(1500);
		if (navigator.appName != 'Microsoft Internet Explorer')
		{
			//$('#our_services_arrow').rotate({animateTo:0});
			$('#sub_nav').stop().animate({opacity: '0', top: '218', height: '0px'}, 0, function() {$(this).hide();});
		}
		else
		{
			$('#sub_nav').stop().hide(0, function() {$(this).animate({top: '192', height: '33px'}, 0);});
		}
		$('#nav_hider').hide();
		$('#label_hider').hide();			
		$('#pulse').animate({opacity: '0'}, 0, function() {$(this).hide();});		
		$('#label_home').fadeOut(0, function() {$(this).hide();});		
	});
	
	function show_Sub_Nav() {
//		$('#sub_nav').stop().show(0, function() {$(this).animate({opacity: '1', top: '192', height: '33px'}, 750);});
		if (navigator.appName != 'Microsoft Internet Explorer')
		{
		//$('#our_services_arrow').rotate({animateTo:90});
		$('#sub_nav').stop().show(0, function() {$(this).animate({opacity: '1', top: '192', height: '33px'}, 750);});
		}
		else
		{
			$('#sub_nav').stop().show(0, function() {$(this).animate({top: '192', height: '33px'}, 0);});
		}
		$('#nav_hider').stop().show();
	}
	
	function showPulse() {
		$('#pulse').stop().show(0, function() {$(this).animate({opacity: '1',left:30}, 250);});
		$('#label_hider').show();
	}	

	function rotateClockwise(imageName, duration) {
		var angle = 0; setInterval(function() { angle+=1; $(imageName).rotate(angle); }, duration); 
	}
	
	function rotateAntiClockwise(imageName, duration) {
		var angle = 0; setInterval(function() { angle-=1; $(imageName).rotate(angle); }, duration); 
	}
	
	function doit() {
	 	rotateAntiClockwise('#img6', 1);
	 	rotateClockwise('#img5', 80);
		rotateClockwise('#img4', 1);
		rotateClockwise('#img3', 40);
		rotateClockwise('#img2', 40);		
		$('#rotate_starter').hide();
	 }
 
 $(function() {
	 $('#tab_contact a').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250, 
		top: -25, 
		left: -65
		});
	 $('#plugat_bg a').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250, 
		top: -25, 
		left: -65
		});
});
 
if (document.images) //preload rollover images
	{
	  var pic_fi     = new Image(1,1);
	  var pic_home   = new Image(1,1);
	  var pic_plugat = new Image(1,1);
	  pic_fi.src="images/arrow-down_rollover.png"; 
	  pic_home.src="images/arrow_brown.png";
	  pic_plugat.src="images/plugat_rollover.png";
	} 
	
<!-- for gallery -->	
	
	var numberOfImages = 23;
	var currentImage = 1;
	var leftwards = 0;
	
	function slideRight()
	{
		if (currentImage < numberOfImages)
		{
			leftwards = leftwards - 1000;
			$('#slider-table').animate({left:leftwards},1000);
			currentImage++;
		}
	}
	
	function slideLeft()
	{
		if (currentImage > 1)
		{
			leftwards = leftwards + 1000;
			$('#slider-table').animate({left:leftwards},1000);
			currentImage--;
		}
	}
	
<!-- end of gallery stuff -->
var clicked = new Array();

function rotate(idNum) { 
		if (!clicked[idNum])		
		{
            $('#arrow'+idNum).rotate({animateTo:90});
			clicked[idNum] = true;
		}
		else if (clicked[idNum])		
		{
            $('#arrow'+idNum).rotate({animateTo:0});
			clicked[idNum] = false;
		}
}

function rotateNavArrow() {
	$('#arrow900').rotate({animateTo:90});
}

function rotateNavArrowBack() {
	$('#arrow900').rotate({animateTo:0});
}


function accordion(accId)
{
	$('#'+accId).slideToggle('slow');
}
		

function rotate90() { 
        if (navigator.appName != 'Microsoft Internet Explorer')
		{
			//$('#our_services_arrow').rotate({animateTo:90});
		}
}

