
//jQuery.noConflict()

var jquerypopupmenu={
	arrowpath: 'arrow.gif', //full URL or path to arrow image
	popupmenuoffsets: [0, 0], //additional x and y offset from mouse cursor for popup menus
	animspeed: 200, //reveal animation speed (in milliseconds)
	showhidedelay: [150, 150], //delay before menu appears and disappears when mouse rolls over it, in milliseconds

	//***** NO NEED TO EDIT BEYOND HERE
	startzindex:1000,
	builtpopupmenuids: [], //ids of popup menus already built (to prevent repeated building of same popup menu)

	positionul:function($, $ul, e){
		var istoplevel=$ul.hasClass('jqpopupmenu') //Bool indicating whether $ul is top level popup menu DIV
		var docrightedge=$(document).scrollLeft()+$(window).width()-40 //40 is to account for shadows in FF
		var docbottomedge=$(document).scrollTop()+$(window).height()-40
		if (istoplevel){ //if main popup menu DIV
			var x=e.pageX+this.popupmenuoffsets[0] //x pos of main popup menu UL
			var y=e.pageY+this.popupmenuoffsets[1]
			x=(x+$ul.data('dimensions').w > docrightedge)? docrightedge-$ul.data('dimensions').w : x //if not enough horizontal room to the ridge of the cursor
			y=(y+$ul.data('dimensions').h > docbottomedge)? docbottomedge-$ul.data('dimensions').h : y
		}
		else{ //if sub level popup menu UL
			var $parentli=$ul.data('$parentliref')
			var parentlioffset=$parentli.offset()
			var x=$ul.data('dimensions').parentliw //x pos of sub UL
			var y=0

			x=(parentlioffset.left+x+$ul.data('dimensions').w > docrightedge)? x-$ul.data('dimensions').parentliw-$ul.data('dimensions').w : x //if not enough horizontal room to the ridge parent LI
			y=(parentlioffset.top+$ul.data('dimensions').h > docbottomedge)? y-$ul.data('dimensions').h+$ul.data('dimensions').parentlih : y
		}
		$ul.css({left:x, top:y})
	},
	
	showbox:function($, $popupmenu, e){
		clearTimeout($popupmenu.data('timers').hidetimer)
		$popupmenu.data('timers').showtimer=setTimeout(function(){$popupmenu.show(jquerypopupmenu.animspeed)}, this.showhidedelay[0])
	},

	hidebox:function($, $popupmenu){
		clearTimeout($popupmenu.data('timers').showtimer)
		$popupmenu.data('timers').hidetimer=setTimeout(function(){$popupmenu.hide(100)}, this.showhidedelay[1]) //hide popup menu plus all of its sub ULs
	},


	buildpopupmenu:function($, $menu, $target){
		$menu.css({display:'block', visibility:'hidden', zIndex:this.startzindex}).addClass('jqpopupmenu').appendTo(document.body)
		$menu.bind('mouseenter', function(){
			clearTimeout($menu.data('timers').hidetimer)
		})		
		$menu.bind('mouseleave', function(){ //hide menu when mouse moves out of it
			jquerypopupmenu.hidebox($, $menu)
		})
		$menu.data('dimensions', {w:$menu.outerWidth(), h:$menu.outerHeight()}) //remember main menu's dimensions
		$menu.data('timers', {})
		var $lis=$menu.find("ul").parent() //find all LIs within menu with a sub UL
		$lis.each(function(i){
			var $li=$(this).css({zIndex: 1000+i})
			var $subul=$li.find('ul:eq(0)').css({display:'block'}) //set sub UL to "block" so we can get dimensions
			$subul.data('dimensions', {w:$subul.outerWidth(), h:$subul.outerHeight(), parentliw:this.offsetWidth, parentlih:this.offsetHeight})
			$subul.data('$parentliref', $li) //cache parent LI of each sub UL
			$subul.data('timers', {})
			$li.data('$subulref', $subul) //cache sub UL of each parent LI
			$li.children("a:eq(0)").append( //add arrow images
				'<img src="'+jquerypopupmenu.arrowpath+'" class="rightarrowclass" style="border:0;" />'
			)
			$li.bind('mouseenter', function(e){ //show sub UL when mouse moves over parent LI
				var $targetul=$(this).css('zIndex', ++jquerypopupmenu.startzindex).addClass("selected").data('$subulref')
				if ($targetul.queue().length<=1){ //if 1 or less queued animations
					clearTimeout($targetul.data('timers').hidetimer)
					$targetul.data('timers').showtimer=setTimeout(function(){
						jquerypopupmenu.positionul($, $targetul, e)
						$targetul.show(jquerypopupmenu.animspeed)
					}, jquerypopupmenu.showhidedelay[0])
				}
			})
			$li.bind('mouseleave', function(e){ //hide sub UL when mouse moves out of parent LI
				var $targetul=$(this).data('$subulref')
				clearTimeout($targetul.data('timers').showtimer)
				$targetul.data('timers').hidetimer=setTimeout(function(){$targetul.hide(100).data('$parentliref').removeClass('selected')}, jquerypopupmenu.showhidedelay[1])
			})
		})
		$menu.find('ul').andSelf().css({display:'none', visibility:'visible'}) //collapse all ULs again
		$menu.data('$targetref', $target)
		this.builtpopupmenuids.push($menu.get(0).id) //remember id of popup menu that was just built
	},

	

	init:function($, $target, $popupmenu){
		if (this.builtpopupmenuids.length==0){ //only bind click event to document once
			$(document).bind("", function(e){
				if (e.button==0){ //hide all popup menus (and their sub ULs) when left mouse button is clicked
					$('.jqpopupmenu').find('ul').andSelf().hide()
				}
			})
		}
		if (jQuery.inArray($popupmenu.get(0).id, this.builtpopupmenuids)==-1) //if this popup menu hasn't been built yet
			this.buildpopupmenu($, $popupmenu, $target)
		if ($target.parents().filter('ul.jqpopupmenu').length>0) //if $target matches an element within the popup menu markup, don't bind onpopupmenu to that element
			return
		$target.bind("mouseenter", function(e){
			$popupmenu.css('zIndex', ++jquerypopupmenu.startzindex)
			jquerypopupmenu.positionul($, $popupmenu, e)
			jquerypopupmenu.showbox($, $popupmenu, e)
		})
		$target.bind("mouseleave", function(e){
			jquerypopupmenu.hidebox($, $popupmenu)
		})
	}
}

jQuery.fn.addpopupmenu=function(popupmenuid){
	var $=jQuery
	return this.each(function(){ //return jQuery obj
		var $target=$(this)
			jquerypopupmenu.init($, $target, $('#'+popupmenuid))
	})
};

//By default, add popup menu to anchor links with attribute "data-popupmenu"
jQuery(document).ready(function($){
	var $anchors=$('*[data-popupmenu]')
	$anchors.each(function(){
		$(this).addpopupmenu(this.getAttribute('data-popupmenu'))
	})
})

//end pop up menu

//start copyright

var year=new Date().getYear();
  if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))
     year="19" + year;
  if (navigator.appName == "Netscape")
     year=1900 + year;
//



function ThisYear()
{  


document.write 

(year);

}


 //end copyright


//
//Pop-up Window Control
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
////end pop up window

//start auto email function



function ShareThisPage() {

  window.location = "mailto:?subject=" + document.title + "&body="+window.location.href;

}


//end auto email function



//Mike's Browser sniffer
function sniffOutBrowsers()
{
	verString = navigator.appVersion;
	var os = navigator.userAgent.toLowerCase();
	var versionCheck = 9.8;
	//appVer = verString.indexOf("2", 0);
	appVer = parseFloat(verString.substring(-1, 5));
	
	if(navigator.appName == "Opera" )
	{
		//Check for Mac users using Opera
		if(os.indexOf("mac") != -1)
		{
			if(appVer < versionCheck)
			{
				alert("The required version of Opera to properly view this site is "+versionCheck+". Your version is "+appVer+".  You will be redirected to Opera's download page.");				
				window.open("http://www.opera.com/browser/", "_self");
			}
		}
		
		//Check all other Non-IE, Non-Opera users
		else if(!os.indexOf("mac") != -1 && appVer < versionCheck)
		{
			alert("The required version of Opera to properly view this site is "+versionCheck+". Your version is "+appVer+".  You will be redirected to Opera's download page.");		
			window.open("http://www.opera.com/browser/", "_self");					
		}
		else
		{
			return false;
		}		
	}
	//Detect older versions of IE
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		if(document.all)
		{
			if(verString.indexOf("MSIE 4.") != -1 || verString.indexOf("MSIE 5.") != -1 || verString.indexOf("MSIE 6.") != -1)
			{
				alert("Your current browser is not sufficient to view this page.  You will be redirected to Microsoft's IE download page to download the latest version of Internet Explorer.");
				window.open("http://www.microsoft.com/windows/Internet-explorer/default.aspx", "_self");
			}
			else
			{				
				return false;
			}
		}
		return false;		
	}
	else
	{
		return false;
	}
}



<!--start warning message script-->

//IMPORTANT -- Make sure to put the correct time and date within these following lines:

var warning = '<table width="100%" height="50" summary="error table" cellpadding="0" cellspacing="0" align="center"><tr><td colspan="0" align="center" class="error" valign="bottom" height="75"><p>Our site will be down for maintenance Thursday January 7th from 4:30 P.M. (MST) until 5:00 P.M. (MST).</p><p>Nuestro sitio estar&aacute; en mantenimiento el Jueves, 7 de enero  desde las 4:30 de la tarde hasta las 5:00 de la tarde<br/> (hora est&aacute;ndar de la monta&ntilde;a)</p></td></tr></table>'


function warningMessage()
{
 
//IMPORTANT -- here is where you select the month and days from the arrays for the warning message to be up and taken down automatically
 
	if (month_names [1]) {
	
	   if (day_number >= 7 && day_number <= 7)		

	   {
		
		   document.write(warning)
	
	   } 
	  
	}
		

}




<!--end warning message script-->
function showContent(startTime, startDate, startMonth, element, messageStr, txt)
{
	var month = 1;
	var day = 13;
	var hour = 16;	
	
	messageStr ="Our site will be down for maintenance Saturday February 13th from 3:00 P.M. (MST) until 4:00 P.M. (MST). - Nuestro sitio estar\u00E1 en mantenimiento el s\u00E1bado, 13 de febrero, desde las 3 de la tarde hasta las 4 de la tarde (hora est\u00E1ndar de la monta\u00F1a).";	
		
	startHour = new Date();
	startDate = new Date();
	startMonth = new Date();
	startMin = new Date();
	
	//Change the name of the element variable to the name of the element id you wish to target. 
	element = document.getElementById('warning');
	element.style.fontFamily = "Arial";
	element.style.fontSize = "12px";
	element.style.fontWeight = "bold";
	element.style.color = "FF0000";
	element.style.marginLeft = "auto";
	element.style.marginRight = "auto";
	element.style.width = "664px";
	
	txt  = document.createTextNode(messageStr);
	
	//If the month day and time match, show the new content
	if(startMonth.getUTCMonth() >= month && startDate.getUTCDate() >= day)
	{
		if(startDate.getUTCDate() >= day && startHour.getUTCHours()-(startHour.getTimezoneOffset()/60) >= hour)
		{
			//alert("The date and hours match. Show content");
			//element.innerHTML = '';
			element.appendChild(txt);
			element.removeChild(txt);
		}		
		//If the date matches but the hour is too soon, show the old content
		else if(startMonth.getUTCMonth() <= month)
		{
			if(startDate.getUTCDate() == day && startHour.getUTCHours()-(startHour.getTimezoneOffset()/60) < hour)
			{
				//alert("The day is right but the hour is too soon");
				//element.innerHTML = 'Warning Message';				
				element.appendChild(txt);				
			}			
		}
		//If the day has passed, always show the new content.
		if(startDate.getUTCDate() > day)
		{
			
			//alert("The indicated date has passed.  Show new content by default");
			//element.innerHTML = '';			
			//messageStr = "";	
			element.appendChild(txt);
			element.removeChild(txt);
		}		
	}
	//if none of the above conditions are true, always show the old content
	else
	{		
		//alert("Show old content by default");
		//element.innerHTML = 'Warning Message';		
		element.appendChild(txt);
		
	}
}


//Initialize the tab verification function
//initTabVerify();
//function initTabVerify()
//{
//	if(window)
//	{
//		if(window.attachEvent)
//		{
//			window.attachEvent('onload', verifyTabs);
//		}
//		else if(window.addEventListener)
//		{
//			window.addEventListener('load', verifyTabs, true);
//		}
//	}
//}

/*function verifyTabs(t)
{
	t = document.getElementById('tabs');
	if(t)
	{
		alert(t.childNodes.length);
		//alert(t.childNodes[0].childNodes[0].nodeName);//IE Likes this
		//alert(t.getElementsByTagName('ul').childNodes[0]);
		//alert(t.childNodes[0].nodeName);
		for(var i = 0; i < t.childNodes.length ; i++)
		{
			if(t.childNodes[i].nodeType != 3)
			{
				alert("T's Child elements: "+t.childNodes[i].nodeName+" :Node Type: "+t.childNodes[i].nodeType);
				if(t.childNodes[i])
				{
					alert("Parent Name: "+t.childNodes[i].nodeName+"  Child Type: "+t.childNodes[i].childNodes[i].nextSibling);
				}
				else
				{
					alert("This node has content");
					alert("Node Type inside of this element: "+t.childNodes[i].firstChild.nodeType);
				}
			}			
		}
	}	
}
*/

//Verifies if the tabs in the product detail page are correctly formatted or if they have text or if they are commented out.  If any of the previous is true, the LI/'s is/are deleted from the DOM and the corresponding div element/'s tied to the tab is/are deleted as well.
//function verifyTabs(t)
//{
//	t = document.getElementById('tabUL');
//	if(t)
//	{
//		//Loop through the tab UL element
//		for(var i = 0; i < t.childNodes.length ; i++)
//		{
//			if(t.childNodes[i].nodeType != 3)
//			{
//				//alert("T's Child elements: "+t.childNodes[i].nodeName+" :Node Type: "+t.childNodes[i].nodeType);
//				alert("Anchor tag child type: "+t.childNodes[i].childNodes[0].childNodes[0].nodeType)
//				if(t.childNodes[i])
//				{					
//					//check to see what type of element resides within the LI.  If any of these conditions are true, the li and div elements that match the conditions will be removed
//					if(t.childNodes[i].childNodes[0] == null || t.childNodes[i].childNodes[0].innerHTML == "" || t.childNodes[i].childNodes[0].childNodes[0].nodeType == 3  || t.childNodes[i].childNodes[0].nodeName != 'A' || t.childNodes[i].childNodes[0].nodeValue == 8)
//					{
//						//If the A tag is missing or is incorrectly formatted, delete the LI and the corresponding div;
//						var tDiv = document.getElementById('tabs');						
//						t.removeChild(t.childNodes[i]);
//						
//						//browser sniff for IE
//						if(navigator.appVersion.indexOf("MSIE")!=-1)
//						{														
//							tDiv.removeChild(tDiv.childNodes[i+1]);
//							verifyTabs();
//						}
//						else
//						{														
//							tDiv.removeChild(tDiv.childNodes[i+2]);							
//						}										
//					}					
//				}
//				else 
//				{					
//					return false;
//				}
//			}			
//		}
//	}
//	else
//	{
//		return false;
//	}
//}









