//Opens the Contact Us Screen
function contactUs() {
	document.getElementById("contact-us").style.visibility = "visible";
	document.getElementById("greyscreen").style.visibility = "visible";
	$('#contact-us').animate({
   	height: 250,
	top: 200
  	}, 500, function() {
    	// Animation complete.
  	});
}
//Moves the light grey follower
function follow(a){
	if(a != 2 && a != 3 && a != 5)
		$('.nav').css({overflow:"hidden"});
	if(a != 2 ){
		$('.operations').stop();
		$('.operations').height(21);
		$('.operations').css({backgroundColor:"transparent"});
		$('.operations').css({overflow:"hidden"});
	}
	if(a != 3){
		$('.history').css({overflow:"hidden"});
		$('.history').stop();
		$('.history').height(21);
		$('.history').css({backgroundColor:"transparent"});
	}
	if(a != 5){
		$('.photo-gallery').css({overflow:"hidden"});
		$('.photo-gallery').stop();
		$('.photo-gallery').height(21);
		$('.photo-gallery').css({backgroundColor:"transparent"});
	}
	$('.follower').stop();
	var pos = 146*a - 146;
	if(getIEVersion() == 9)
		pos = 146*a - 146;
	$('.follower').animate({
   	'margin-left': pos
  	}, 300, function() {
    	if(a == 2){
			$('.nav').css({overflow:"visible"});
			$('.operations').css({backgroundColor:"#BBB"});
			$('.operations').animate({
   			height: 80
  			}, 150, function() {
    			// Animation complete.
  			});
		}
		if(a == 3){
			$('.nav').css({overflow:"visible"});
			$('.history').css({backgroundColor:"#BBB"});
			$('.history').animate({
   			height: 80
  			}, 150, function() {
    			// Animation complete.
  			});
		}
		if(a == 5){
			$('.nav').css({overflow:"visible"});
			$('.photo-gallery').css({backgroundColor:"#BBB"});
			$('.photo-gallery').animate({
   			height: 55
  			}, 150, function() {
    			// Animation complete.
  			});
		}
  	});
}
//Immediatly sets the follower to position
function setfollower(a){
	var pos = 146*a - 146;
	$('.follower').css({'margin-left':pos});
}
//Leaves the drop down from the nav bar
function leave(){
	$('.nav').css({overflow:"hidden"});
	$('.operations').stop();
	$('.operations').height(21);
	$('.operations').css({backgroundColor:"transparent"});
	$('.operations').css({overflow:"hidden"});
	$('.history').stop();
	$('.history').height(21);
	$('.history').css({backgroundColor:"transparent"});
	$('.history').css({overflow:"hidden"});
	$('.photo-gallery').css({overflow:"hidden"});
	$('.photo-gallery').stop();
	$('.photo-gallery').height(21);
	$('.photo-gallery').css({backgroundColor:"transparent"});
}
//selector function for nav bar
function ops(a){
	switch(a){
		case 1:
			$("a#ops").attr("href", "Ops.php");
			break;
		case 2:
			$("a#ops").attr("href", "Safety.php");
			break;
		case 3:
			$("a#ops").attr("href", "Expansion.php");
			break;		
	}
}
//selector function for nav bar
function his(a){
	switch(a){
		case 1:
			$("a#his").attr("href", "News.php");
			break;
		case 2:
			$("a#his").attr("href", "History.php");
			break;
		case 3:
			$("a#his").attr("href", "Community.php");
			break;		
	}
}
function pho(a){
	switch(a){
		case 1:
			$("a#pho").attr("href", "Gallery.php");
			break;
		case 2:
			$("a#pho").attr("href", "Tour_gallery.php");
			break;	
	}
}
// closes the greyscreen
function exit() {
	document.getElementById("contact-us").style.visibility = "hidden";
	document.getElementById("greyscreen").style.visibility = "hidden";
	document.getElementById("contact-us").style.height = 0;
	document.getElementById("contact-us").style.top = "300px";
}
function getIEVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
