//Redirect to the hunting trophy homepage if client wants huntingtrophy.com
if (document.location.href.indexOf("huntingtrophy.com")!= -1){
 document.location = "http://www.coppersmith.com/CSSite/cspublic.nsf/hunting?OpenPage";
}

//Pick the correct stylesheet depending upon the browser detected
if (navigator.appName == "Netscape" && navigator.appVersion < "5") {
document.write('<link rel="stylesheet" type="text/css" href="/scripts/coppersmith/ns.css">')
//for Netscape on any platform under version 5
}
else if (navigator.appName == "Netscape" && navigator.appVersion > "4") {
document.write('<link rel="stylesheet" type="text/css" href="/scripts/coppersmith/ns7.css">')
//for Netscape 6 or above - ALSO FIREFOX
}
else {
document.write('<link rel="stylesheet" type="text/css" href="/scripts/coppersmith/ie.css">')
//for IE or other browser on any platform - also Netscape 6 or above since it is similar to IE
}

function writeTime(){
//This function writes the current date on the homepage
var now = new Date(); //Set the Date variable
var dayOfWeek = now.getDay(); //get the number of the day of the week
var MonthNow = now.getMonth(); //get the Month Number
var DayNow = now.getDate(); //get the Date Number
var yearNow = now.getFullYear(); //get the Year (this works for IE and Netscape)
//Time Variables
var datHour = now.getHours();
var datShowHour = now.getHours();
var datMinute = now.getMinutes();
var datSecond = now.getSeconds();

if (datHour == 0) {
	datShowHour = 12
}
else {
	datHour = datHour
}

if (datMinute < 10) {
	datMinute = "0" + datMinute
}
else {
	datMinute = datMinute
}

if (datSecond < 10) {
	datSecond = "0" + datSecond
}
else {
	datSecond = datSecond
}

if (datHour > 11 && datHour < 24) {
	datAmPm = "p.m"
}
else {
	datAmPm = "a.m."
}
//These arrays set up the Day of the week and the Month **The arrays start at 0**
var DayName = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var MonthName = new Array("January","February","March","April","May","June","July","August","September","October","November","December")

document.write("<br>");
document.write (DayName[dayOfWeek] + ", " + MonthName[MonthNow] + " " + DayNow + ", " + yearNow + "<br />");
}

function isOpera(){
// Unfortunately, the navigation menu is not supported in Opera - this will let Opera users know
if (navigator.userAgent.indexOf("Opera")!= -1) {
document.write('<div style="background-color: #800303; color: #ffffff" align="center">You need to get <a class="operaLink" href="http://www.microsoft.com/windows/ie/downloads/ie6/default.asp" target="_blank">Microsoft Internet Explorer</a> or <a class="operaLink" href="http://channels.netscape.com/ns/browsers/default.jsp" target="_blank">Netscape Navigator</a> to navigate this site properly!</div>')
}
else {
document.write ('<img src="/cssite/cspublic.nsf/transp.gif?openImageResource" alt="spacer" width="1" height="23" /><br />')
}
}

function cycleModules() {
	//This function cycles the image modules near the top right of the homepage based on the "seconds"
	//Also cycles the "Special Markets we serve images" - some of the <table> elements are included in this function
	var now = new Date();
	var datSecond = now.getSeconds();
	if (datSecond < 13) {
		var intImage = 1
		var intSpecialImage = 1
	}
	else if (datSecond > 12 && datSecond < 25) {
		var intImage = 2
		var intSpecialImage = 2
	}
	else if (datSecond > 24 && datSecond < 37) {
		var intImage = 3
		var intSpecialImage = 3
	}
	else if (datSecond > 36 && datSecond < 49) {
		var intImage = 4
		var intSpecialImage = 2
	}
	else {
		var intImage = 5
		var intSpecialImage = 1
	}
	document.write ('<img src="/cssite/cspublic.nsf/module-' + intImage + 'a.jpg?OpenImageResource" width="210" height="131" alt="Coppersmith for all your import and export needs"><br>');
	document.write ('<img src="/cssite/cspublic.nsf/transp.gif?OpenImageResource" width="1" height="13"><br>');

	document.write ('<img src="/cssite/cspublic.nsf/special' + intSpecialImage + 'a.gif?OpenImageResource" width="210" height="158" alt="Domestic & International Transportation"><br>');
	document.write ('<img src="/cssite/cspublic.nsf/special' + intSpecialImage + 'b.gif?OpenImageResource" width="210" height="102" alt="Domestic & International Transportation"><br>');
	document.write ('</td>');
	document.write ('<td valign="top">');
	document.write ('<img src="/cssite/cspublic.nsf/transp.gif?OpenImageResource" width="6" height="1" alt="spacer"><br>');
	document.write ('</td>');
	document.write ('<td valign="top">');
	document.write ('<img src="/cssite/cspublic.nsf/module-' + intImage + 'b.jpg?OpenImageResource" width="217" height="131" alt="Coppersmith for all your import and export needs"><br>');
}

// NEW function
function cycleModules2() {
	//This function cycles the image modules near the top right of the homepage based on the "seconds"
	//Also cycles the "Special Markets we serve images" - some of the <table> elements are included in this function
	var now = new Date();
	var datSecond = now.getSeconds();
	if (datSecond < 13) {
		var intImage = 1
		var intSpecialImage = 1
	}
	else if (datSecond > 12 && datSecond < 25) {
		var intImage = 2
		var intSpecialImage = 2
	}
	else if (datSecond > 24 && datSecond < 37) {
		var intImage = 3
		var intSpecialImage = 3
	}
	else if (datSecond > 36 && datSecond < 49) {
		var intImage = 4
		var intSpecialImage = 2
	}
	else {
		var intImage = 5
		var intSpecialImage = 1
	}
	document.write ('<img src="/cssite/cspublic.nsf/emp' + intImage + '.jpg?OpenImageResource" width="434" height="144" alt="Coppersmith for all your import and export needs"><br>');
}
// end test
function back2Top() {
document.write('<a href="#top" class="backToTop"><img src="/cssite/cspublic.nsf/arrow.gif?OpenImageResource" border="0" hspace="4" vspace="0">Back to Top</a><br><img src="/cssite/cspublic.nsf/transp.gif?OpenImageResource" width="1" height="8"><br>');
}

function writeNew(startIE,stopIE,startNS,stopNS,strColor,strText) {
	//	Writes a NEW! message for new items
	//	This is the function call - writeNew("2 15 2002","5 10 2002","2 15 102","5 10 102","#ff0000","New Expanded Location!");
	//	-------------------------------------------------
	//	startIE & stopIE is the start and end date of
	//	the New function in IE and the same goes for 
	//	startNS & stopNS, except it is for Netscape
	//	strText is the text you would like displayed
	// 	strColor is the color you for the text
	//	-------------------------------------------------
	var now = new Date()
	var dateNow = now.getMonth() +1 + " " + now.getDate() + " " + now.getYear() 
	
	if ((dateNow >= startIE) && (dateNow < stopIE) || (dateNow >= startNS) && (dateNow < stopNS)) {
		document.write ('<span style="color: ' + strColor + '"><b>' + strText + '</b></span>')
	}
}

//This script animates the Top Left Banner
var adImages = new Array("/cssite/cspublic.nsf/banner1.gif?OpenImageResource",
"/cssite/cspublic.nsf/banner2.gif?OpenImageResource",
"/cssite/cspublic.nsf/banner3.gif?OpenImageResource",
"/cssite/cspublic.nsf/banner4.gif?OpenImageResource",
"/cssite/cspublic.nsf/banner5.gif?OpenImageResource")
var thisAd = 0
function animate() {
if (document.images){
	if (document.heads.complete) {
	thisAd++
	if (thisAd == 5) {
		thisAd = 0
		}
		document.heads.src=adImages[thisAd]
		}
		setTimeout ("animate()", 2550)
	}
}

function cyclePageImages() {
	//This function cycles the image modules on the top left of the other pages based on the "seconds"
	var now = new Date();
	var datSecond = now.getSeconds();
	if (datSecond < 8) {
		var intImage = 1
	}
	else if (datSecond > 7 && datSecond < 15) {
		var intImage = 2
	}
	else if (datSecond > 14 && datSecond < 22) {
		var intImage = 3
	}
	else if (datSecond > 21 && datSecond < 29) {
		var intImage = 4
	}
	else if (datSecond > 28 && datSecond < 36) {
		var intImage = 5
	}
	else if (datSecond > 35 && datSecond < 43) {
		var intImage = 6
	}
	else if (datSecond > 42 && datSecond < 50) {
		var intImage = 7
	}
	else {
		var intImage = 8
	}
	document.write ('<img src="/cssite/cspublic.nsf/left-' + intImage + '.jpg?OpenImageResource" width="164" height="88" alt="Coppersmith for all your import and export needs"><br>');
}

function writeHomeImgMap() {
document.write('<a name="top"></a>')
document.write('<map name="link">')
document.write('<area shape="rect" coords="0,0,59,68" href="/CSSite/csShipmentTracking.nsf/$SearchResult?Searchview&Query=*" alt="Shipment Tracking">')
document.write('<area shape="rect" coords="88,0,135,68" href="/CSSite/cspublic.nsf/hunting?OpenPage" alt="Hunting Trophies">')
document.write('<area shape="rect" coords="161,0,215,68" href="/CSSite/cspublic.nsf/contact?OpenPage" alt="Office Locations">')
document.write('</map>')
//Image map is hard coded in the "booking page & a few others" on the secure site because it wouldn't work otherwise"
}

function writeImgMap() {
document.write('<a name="top"></a>')
document.write('<map name="quicklink">')
document.write('<area shape="rect" coords="8,11,59,79" href="/CSSite/csShipmentTracking.nsf/$SearchResult?Searchview&Query=*" alt="Shipment Tracking">')
document.write('<area shape="rect" coords="89,11,133,79" href="/CSSite/cspublic.nsf/hunting?OpenPage" alt="Hunting Trophies">')
document.write('<area shape="rect" coords="164,11,210,79" href="/CSSite/cspublic.nsf/contact?OpenPage" alt="Office Locations">')
document.write('</map>')
}

// NEW NAVIGATION MENU FOR COPPERSMITH.COM
function writeNewNavMenu() {
document.write ('<div align="center" id="ddtopmenubar" class="matttabs">');
	document.write ('<ul>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/home?OpenPage" rel="ddsubmenu1">Coppersmith Inc.</a></li>');
		document.write ('<li><a href="#" rel="ddsubmenu2">Import Dept</a></li>');
		document.write ('<li><a href="#" rel="ddsubmenu3">Export Dept</a></li>');
		document.write ('<li><a href="#" rel="ddsubmenu4">Customer Area</a></li>');
		document.write ('<li><a href="#" rel="ddsubmenu5">Hunting Trophies</a></li>');
		document.write ('<li><a href="/cssite/cspublic.nsf/resources?openpage">Resources&nbsp;</a></li>');
		document.write ('<li><a href="/cssite/cspublic.nsf/search?openpage">&nbsp;&nbsp;Search &nbsp;&nbsp;&nbsp;</a></li>');
	document.write ('</ul>');
document.write ('</div>');

document.write ('<script type="text/javascript">');
document.write ('ddlevelsmenu.setup("ddtopmenubar", "topbar") //ddlevelsmenu.setup("mainmenuid", "topbar")');
document.write ('</script>');

document.write ('<!--Top Drop Down Menu 1 HTML-->');

document.write ('<ul id="ddsubmenu1" class="ddsubmenustyle">');
	document.write ('<li><a href="/CSSite/cspublic.nsf/home?OpenPage">Coppersmith Home</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/forms?OpenPage">Customer Forms</a></li>');
	document.write ('<li><a href="mailto:contactus1@coppersmith.com">Email Us</a></li>');
	document.write ('<li><a href="http://www.coppersmith.com/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/Lacey-Act-Revised-09-02-09.pdf">Lacey Act Revised</a>');
	document.write ('<li><a href="#">Newsletters</a>');

document.write ('<ul>');
		document.write ('<li><a href="http://archive.constantcontact.com/fs019/1102283092714/archive/1103158952268.html" target="_blank">March 2010</a></li>');
		document.write ('<li><a href="#">Newsletter Archive</a>');
		document.write ('<ul>');
		document.write ('<li><a href="http://archive.constantcontact.com/fs019/1102283092714/archive/1102628375546.html" target="_blank">July 2009</a></li>');
		document.write ('<li><a href="http://archive.constantcontact.com/fs019/1102283092714/archive/1102403379090.html" target="_blank">January 2009</a></li>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/Nov08.pdf">November 2008</a></li>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/Jan08.pdf">January 2008</a></li>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/Aug07.pdf">August 2007</a></li>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/Nov06.pdf">November 2006</a></li>');
		document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/April06NL.pdf">April 2006</a></li>');
	  	document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/newsletter.pdf">Sept 2005</a></li>');
document.write ('</ul>');
document.write ('</li>');

document.write ('</ul>');

document.write ('</li>');
document.write ('<li><a href="/CSSite/cspublic.nsf/contact?OpenPage">Office Locations</a></li>');
document.write ('<li><a href="/CSSite/cspublic.nsf/66a207c3cd223f4688256cc9006ef5a3/$FILE/CopperB.ppt" target="_blank">Online Brochure</a></li>');
document.write ('<li><a href="/CSSite/cspublic.nsf/survey?OpenPage">Survey</a></li>');
document.write ('</ul>');

document.write ('<ul id="ddsubmenu2" class="ddsubmenustyle">');
	document.write ('<li><a href="/CSSite/cspublic.nsf/import?OpenPage">Import Services</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/warehousing?OpenPage">Warehouse & Distribution</a></li>');
document.write ('</ul>');

document.write ('<!--Top Drop Down Menu 3 HTML-->');

document.write ('<ul id="ddsubmenu3" class="ddsubmenustyle">');
	document.write ('<li><a href="/CSSite/cspublic.nsf/cotton?OpenPage">Cotton</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/export?OpenPage">Export Services</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/gencargo?OpenPage">General Cargo</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/produce?OpenPage">Produce</a></li>');
document.write ('</ul>');

document.write ('<!--Top Drop Down Menu 4 HTML-->');

document.write ('<ul id="ddsubmenu4" class="ddsubmenustyle">');
	document.write ('<li><a href="http://12.22.208.195/CS/Index.aspx">CS Tracking System</a></li>');
	document.write ('<li><a href="/CSSite/cssecure.nsf/booking?OpenPage">Booking Information</a></li>');
	document.write ('<li><a href="/CSSite/cssecure.nsf/custsurvey?OpenPage">Customer Survey</a></li>');
	document.write ('<li><a href="/CSSite/csShipmentTracking.nsf/$SearchResult?Searchview&Query=*">Shipment Tracking</a></li>');
document.write ('</ul>');

document.write ('<!--Top Drop Down Menu 5 HTML-->');

document.write ('<ul id="ddsubmenu5" class="ddsubmenustyle">');
	document.write ('<li><a href="http://www.fws.gov/forms/display.cfm?number1=200" target="_blank">Fish &amp; Wildlife Forms</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/hunting?OpenPage">Hunting Trophy Home</a></li>');
	document.write ('<li><a href="/CSSite/cspublic.nsf/huntingFaq?OpenPage">Hunting Trophy FAQs</a></li>');
document.write ('</ul>');

document.write ('</td>');
	document.write ('</tr>');

document.write ('<script language="javaScript" type="text/javaScript">');
document.write ('<!--');
document.write ('isOpera()');
document.write ('//-->');
document.write ('</script>');

// WRITE WHITE DIV TO HID EXCESS MENU IN FIREFOX
document.write ('<div style="position: absolute; background-color: white; z-index: 6000; width:120px; height: 200px; left:767px; top:0px;">&nbsp;</div>');
//end script
}
