// JavaScript Document

$(document).ready(function() {
	$('#topNav li').find('div.rollOver').css({ visibility: "hidden" })
	
	//Top Navigation
	$('#topNav li').hover(function() { 
		$(this).find('div.rollOver').css({ visibility: "visible" });
		$(this).find('div.rollOut').css({ visibility: "hidden" });
	}, function() {
		$(this).find('div.rollOut').css({ visibility: "visible" });
		$(this).find('div.rollOver').css({ visibility: "hidden" });
	});
	
	
	//Side Navigation					  
	$('#navMenu li').hover(function() {
		var theImg = $(this).children('img');
		
		
		if (theImg.attr('alt') == "Home") {
			theImg.attr('src','images/nav/47x16_mi_home_ON.gif');
		}else if (theImg.attr('alt') == "About") {
			theImg.attr('src','images/nav/60x16_mi_about_ON.gif');
		}else if (theImg.attr('alt') == "Video") {
			theImg.attr('src','images/nav/36x16_mi_video_ON.gif');
		}else if (theImg.attr('alt') == "Industrial Minerals") {
			theImg.attr('src','images/nav/110x16_mi_indus_ON.gif');
		}else if (theImg.attr('alt') == "News & Resources") {
			theImg.attr('src','images/nav/114x16_mi_news_ON.gif');
		}else if (theImg.attr('alt') == "Contact Us") {
			theImg.attr('src','images/nav/71x16_mi_cont_ON.gif');
		}else {
			$(this).children('a:first').css({ color: '#666666' });
		}
		
		
	 }, function() {
		var theImg = $(this).children('img');
		
		
		if (theImg.attr('alt') == "Home") {
			theImg.attr('src','images/nav/47x16_mi_home.gif');
		}else if (theImg.attr('alt') == "About") {
			theImg.attr('src','images/nav/60x16_mi_about.gif');
		}else if (theImg.attr('alt') == "Video") {
			theImg.attr('src','images/nav/36x16_mi_video.gif');
		}else if (theImg.attr('alt') == "Industrial Minerals") {
			theImg.attr('src','images/nav/110x16_mi_indus.gif');
		}else if (theImg.attr('alt') == "News & Resources") {
			theImg.attr('src','images/nav/114x16_mi_news.gif');
		}else if (theImg.attr('alt') == "Contact Us") {
			theImg.attr('src','images/nav/71x16_mi_cont.gif');
		}else {
			$(this).children('a:first').css({ color: '#00549D' });	
		}
		 
	 });


	//Video Tab
	/*$('#videoTab').click(function() {
		var yPos = $(this).css('top');
								  
		if (yPos == "-31px") {
			$(this).animate({ top: "-300px" });
		}else if (yPos == "-300px") {
			$(this).animate({ top: "-31px" });
		}
	
	});*/
	
	/* Enable other */
      $('#ch_other').click(function() {
		  if ($('#ch_other').attr('checked') == true) {
			  $('#otherText').val('');
			  $('#otherText').removeAttr("disabled");
		  }else {
			   $('#otherText').attr("disabled", true);
			  $('#otherText').val('Other'); 
		 }
      });
	  
	  $('a.basic').click(function (e) {
		e.preventDefault();
		$('#basicModalContent').modal();
	});
	  
	$('#FullName').click(function() {	
		if ($(this).val() == "Name") {
			$(this).val('');
		}
	});
	$('#Email').click(function() {	 
		if ($(this).val() == "Email") {
			$(this).val('');
		}
	});
	$('#Company').click(function() {	 
		if ($(this).val() == "Company") {
			$(this).val('');
		}
	});
	$('#Comments').click(function() {	 
		if ($(this).val() == "Comments") {
			$(this).val('');
		}
	});
	
	$('#simplemodal-overlay').addClass('modalCloseImg');
	
	
});
