// JavaScript Document
<!--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);
	//showContent();  //uncomment this if you need to create time sensitive content for the home page
}


// end copyright-->

<!--Pop-up Window Control-->
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
<!--Swap Images Function-->
<!--start jumpMenu-->
<!--
function jump(menu){
  var loc = menu[menu.selectedIndex].value.split("|");
  if(loc.length == 2)
    window.open(loc[1], loc[0]);
}
//-->
<!--end jumpMenu-->


<!--start IE 6 re-route-->
function browserDetection (){

 if((document.all))  

      {  

        if((navigator.appVersion.indexOf("MSIE 6." || "MSIE 5." || "MSIE 4.")!=-1))  

         {  

    		window.location = "http://image.foreverliving.com/wwwOLD/"

          }  

      }   
}
<!--end IE 6 re-route


<!--start IE6 Upgrade message-->

//IMPORTANT -- When putting up a warning message, comment this function out by James' request.

var upgradeMessage = '<span class="error">To access our newer and faster foreverliving.com, please <a class="errorLink" href="http://www.microsoft.com/windows/internet-explorer/default.aspx"  target="_blank">upgrade your browser HERE</a>.<br/><br/>Para tener acceso a nuestro m&aacute;s nuevo www.foreverliving.com, <a class="errorLink" href="http://www.microsoft.com/windows/internet-explorer/default.aspx"  target="_blank">por favor actualice su navegador AQU&Iacute;.</a></span>'
 
function upgradeYourBrowser(){


 document.write(upgradeMessage)

 
}

<!--end IE6 Upgrade Message-->

<!--start warning message script-->

// This array holds the day number

//IMPORTANT -- take out the following comment mark to activate the warning message:


/*var day_num = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'];


// This array holds the month names
var month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'Novemeber', 'December'];

//  the current date
date_now = new Date()

//  day name
day_value = date_now.getDay()

//  day number
day_number = date_now.getUTCDate()


//  month name
month_value = date_now.getUTCMonth()

// the day of the month
date_now.getUTCDate()

// the year
date_now.getFullYear()

//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);
		
	}
}

function openSales09(newwindow)
{
	newwindow = window.open("salesPop.html", "salesPop", "width=600, height=465, scrollbars=no, toolbar=no");
	if(window.focus)
	{		
		newwindow.focus();
	}
	else
	{
		return false;
	}	
}


