/****************************
This file is to be used for code snippits that are in use accross two or more webpages on the minetechint.com website
It was authored & assembled by Michael Hannon 

This file contains the following code snippits:
- the copyright notice. (May 2010)
- the Kitco Gold Price sidebar content
- the navigation menus. Two snippits, one for files in the main folder, another for files in subfolders (May 2010)
- the sidebar site map. (July 2011)
- the fade-in slideshow. Copied from dynamicdrive.com (May 2010)
- 

*****************************/


/***************
 COPYRIGHT NOTICE 
 ***************/
 
$(document).ready(function() {
	$("#footer_text").html("&copy; Copyright 2008, 2009, 2010, 2011 - MineTech International Limited - <a href=\"mailto:info@minetechint.com\">info@minetechint.com</a> - (902) 492-4049")
});
 
 /*************
  KITCO CHART
	*************/
$(document).ready(function() {
	$("#kitco_gold_price").html(
		"<h2><span class=\"h2_text\">Kitco Gold Price</span></h2>" +
		"<a href=\"http://www.kitco.com/charts/livegoldnewyork.html\">" +
		"<img class=\"kitco_image\" SRC=\"http://www.kitconet.com/charts/metals/gold/t24_au_en_usoz_2.gif\" BORDER=\"0\" ALT=\"[Most Recent Quotes from www.kitco.com]\">" +
		"</a>"
	);
});


 /*************
	DROP-DOWN MENUS (horizontal navigation bar)
	*************/
						
/* Javascript for the drop-down menu
 retrieved from http://css-tricks.com/examples/SimplejQueryDropdowns/ on May 15, 2010 */

$(function(){

    $("ul.dropdown li").hover(function(){
    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");

});


 /***********************
  NAVIGATION BAR CONTENT
	***********************/

$(document).ready(function() { /* this is necessary as the DOM elements (i.e. the containing div) have to be ready before the script executes */
	$("#menu-mainfolder").html( /*match the (1st?) element with the menu-mainfolder ID and insert the following HTML */
		"<div class=\"menu\">" +
			"<ul class=\"dropdown\">" +
			"<li><a href=\"index.html\">MineTech</a></li>" + 
			"<li><a href=\"services.html\">Services</a>" +
				"<ul class=\"sub_menu\">" +
					"<li><a href=\"services/technical_reports.html\">Technical Reports</a>" +
					"</li>" +
					"<li><a href=\"services/permitting_and_legal_support.html\">Permitting & Legal Support</a>" +
					"</li>" +
					"<li><a href=\"services/engineering_services.html\">Engineering Services</a>" +
					"</li>" +
					"<li><a href=\"services/operations_support.html\">Operations Support</a>" +
					"</li>" +
				"</ul>" +
			"</li>" +
			"<li><a href=\"staff.html\">Staff</a>" +
				"<ul class=\"sub_menu\">" +
					"<li><a href=\"staff/phannon.html\">Patrick Hannon</a></li>" +
					"<li><a href=\"staff/droy.html\">Doug Roy</a></li>" +
					"<li><a href=\"staff/iflint.html\">Dr. Ian Flint</a></li>" +
					"<li><a href=\"staff/ethornton.html\">Edward Thornton</a></li>" +
					"<li><a href=\"staff/dwest.html\">Deven West</a></li>" +	
					"<li><a href=\"staff/szou.html\">Dr. Steve Zou</a></li>" +
				"</ul>" +
			"</li>" + 
			"<li><a href=\"downloads.html\">Downloads</a></li>" +
			"<li><a href=\"contact.html\">Contact</a></li>" +
		"</ul>" +
		
		"<form action=\"search.html\" id=\"cse-search-box\" class=\"google_site_search_box\">" +
			"<div>" +
				"<input type=\"hidden\" name=\"cx\" value=\"001646915656253739020:fkdrgl_heaw\" />" +
				"<input type=\"hidden\" name=\"cof\" value=\"FORID:9\" />" +
				"<input type=\"hidden\" name=\"ie\" value=\"UTF-8\" />" +
				"<input type=\"text\" name=\"q\" size=\"31\" />" +
				"<input type=\"submit\" name=\"sa\" value=\"Search\" />" +
			"</div>" +
		"</form>" +
		"<script type=\"text/javascript\" src=\"http://www.google.com/cse/brand?form=cse-search-box&lang=en\"></script>" +
		
		"<div class=\"clearfix\"></div>" +
	"</div> <!-- end menu div -->"
	);

	$("#menu-subfolder").html(
		"<div class=\"menu\">" +
			"<ul class=\"dropdown\">" +
			"<li><a href=\"../index.html\">MineTech</a></li>" +
			"<li><a href=\"../services.html\">Services</a>" +
				"<ul class=\"sub_menu\">" +
					"<li><a href=\"../services/technical_reports.html\">Technical Reports</a>" +
					"</li>" +
					"<li><a href=\"../services/permitting_and_legal_support.html\">Permitting & Legal Support</a>" +
					"</li>" +
					"<li><a href=\"../services/engineering_services.html\">Engineering Services</a>" +
					"</li>" +
					"<li><a href=\"../services/operations_support.html\">Operations Support</a>" +
					"</li>" +
				"</ul>" +
			"</li>" +
			"<li><a href=\"../staff.html\">Staff</a>" +
				"<ul class=\"sub_menu\">" +
					"<li><a href=\"../staff/phannon.html\">Patrick Hannon</a></li>" +
					"<li><a href=\"../staff/droy.html\">Doug Roy</a></li>" +
					"<li><a href=\"../staff/iflint.html\">Dr. Ian Flint</a></li>" +
					"<li><a href=\"../staff/ethornton.html\">Edward Thornton</a></li>" +
					"<li><a href=\"../staff/dwest.html\">Deven West</a></li>" +	
					"<li><a href=\"../staff/szou.html\">Dr. Steve Zou</a></li>" +
				"</ul>" +
			"</li>" +
			"<li><a href=\"../downloads.html\">Downloads</a></li>" +
			"<li><a href=\"../contact.html\">Contact</a></li>" +
		"</ul>" +
		
		"<form action=\"../search.html\" id=\"cse-search-box\" class=\"google_site_search_box\">" +
			"<div>" +
				"<input type=\"hidden\" name=\"cx\" value=\"001646915656253739020:fkdrgl_heaw\" />" +
				"<input type=\"hidden\" name=\"cof\" value=\"FORID:9\" />" +
				"<input type=\"hidden\" name=\"ie\" value=\"UTF-8\" />" +
				"<input type=\"text\" name=\"q\" size=\"31\" />" +
				"<input type=\"submit\" name=\"sa\" value=\"Search\" />" +
			"</div>" +
		"</form>" +
		"<script type=\"text/javascript\" src=\"http://www.google.com/cse/brand?form=cse-search-box&lang=en\"></script>" +
		
		"<div class=\"clearfix\"></div>" +
	"</div> <!-- end menu div -->"
	);
});
  
 /*****************
  SITE MAP CONTENT
	*****************/

	/* this function provides the HTML for the site map in the sidebar. It's here so it can be edited in one place and used throughout the site.
	
	Note the trick using IDs to make sure the 'active' page is differentiated from the rest: each page is given an ID, and each link in the
	sidebar is given an ID. Then, the minetech_stylesheet.css file has one generic setting applied to all linlks, as well as a special style
	that is only applied iff the page ID _and_ the link ID match (eg the CSS says #index #indexLink, ..., #about #aboutLink { special CSS } ) */
	
	/* NB that there are three of these, one for pages on the main level, the other two for pages in subfolders. The web pages are hard-coded to use
	the appropriate menu; using JS for this didn't meet corporate productivity standards WRT programmer time */
	
$(document).ready(function() {
	$("#site-map_mainfolder").html( /* match the (1st?) element with the menu-mainfolder ID and insert the following HTML */
		"<div id=\"site-map-links\">" +
			"<font size=\"1\">" +
				"&nbsp&nbsp<a id=\"indexLink\" href=\"index.html\">Home</a><br />" +
				"&nbsp&nbsp<a id=\"servicesLink\" href=\"services.html\">Services</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"technical_reportsLink\" href=\"services/technical_reports.html\">Technical Reports</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"permitting_and_legal_supportLink\" href=\"services/permitting_and_legal_support.html\">Permitting & Legal Support</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"engineering_servicesLink\" href=\"services/engineering_services.html\">Engineering Services</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"operations_supportLink\" href=\"services/operations_support.html\">Operations Support</a><br />" +
				"&nbsp&nbsp<a id=\"staffLink\" href=\"staff.html\">Staff</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"phannonLink\" href=\"staff/phannon.html\">Patrick Hannon</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"droyLink\" href=\"staff/droy.html\">Doug Roy</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"iflintLink\" href=\"staff/iflint.html\">Ian Flint</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"ethorntonLink\" href=\"staff/ethornton.html\">Edward Thornton</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"dwestLink\" href=\"staff/dwest.html\">Deven West</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"szouLink\" href=\"staff/szou.html\">Steve Zou</a><br />" +
				"&nbsp&nbsp<a id=\"downloadsLink\" href=\"downloads.html\">Downloads</a><br />" +
				"&nbsp&nbsp<a id=\"contactLink\" href=\"contact.html\">Contact</a>" +
			"</font>" +
		"</div>"
	);

	$("#site-map_subfolder").html( /* match the (1st?) element with the menu-mainfolder ID and insert the following HTML */
		"<div id=\"site-map-links\">" +
			"<font size=\"1\">" +
				"&nbsp&nbsp<a id=\"indexLink\" href=\"../index.html\">Home</a><br />" +
				"&nbsp&nbsp<a id=\"servicesLink\" href=\"../services.html\">Services</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"technical_reportsLink\" href=\"../services/technical_reports.html\">Technical Reports</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"permitting_and_legal_supportLink\" href=\"../services/permitting_and_legal_support.html\">Permitting & Legal Support</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"engineering_servicesLink\" href=\"../services/engineering_services.html\">Engineering Services</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"operations_supportLink\" href=\"../services/operations_support.html\">Operations Support</a><br />" +
				"&nbsp&nbsp<a id=\"staffLink\" href=\"../staff.html\">Staff</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"phannonLink\" href=\"../staff/phannon.html\">Patrick Hannon</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"droyLink\" href=\"../staff/droy.html\">Doug Roy</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"iflintLink\" href=\"../staff/iflint.html\">Ian Flint</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"ethorntonLink\" href=\"../staff/ethornton.html\">Edward Thornton</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"dwestLink\" href=\"../staff/dwest.html\">Deven West</a><br />" +
				"&nbsp&nbsp&nbsp&nbsp&gt<a id=\"szouLink\" href=\"../staff/szou.html\">Steve Zou</a><br />" +
				"&nbsp&nbsp<a id=\"downloadsLink\" href=\"../downloads.html\">Downloads</a><br />" +
				"&nbsp&nbsp<a id=\"contactLink\" href=\"../contact.html\">Contact</a>" +
			"</font>" +
		"</div>"
	);
});
