<!--
/***********************************************************************
/* (c) 2003-2006, Eniva USA, LLC and Mark Capistrant
/**********************************************************************/

/***********************************************************************
/* Define global variables here.
/**********************************************************************/

<!-- none -->

/***********************************************************************
/* Common function used to print every page.
/**********************************************************************/

/*----------------------------------------------------------------------
/* Returns the default language for users browser. e.g. "en" = English
/*--------------------------------------------------------------------*/
function BrowserLanguage() {
	var language = "";
	if (navigator.appName == 'Netscape') { language = navigator.language; }
	else { language = navigator.browserLanguage; }
	return(language.substring(0,2));
}

/*----------------------------------------------------------------------
/* Prints the currently displayed page.
/*--------------------------------------------------------------------*/
function ValidateQty(form) {
//	try	{
		// First check for a blank field.
		var str = form.qty.value;
		if(str.length == 0 || str <= 0){
		 	alert("Please enter a valid quantity for the product requested.");
			return false;
		} else {
		 	return true;
		}
//	}
//	catch(e){}
}

/*----------------------------------------------------------------------
/* Prints the currently displayed page.
/*--------------------------------------------------------------------*/
function PrintPage() {
	try	{
		// NOTE: In the future, we will want to do some more fancy
		//       print options, that is why this routine exists.
		window.self.print();
	}
	catch(e){}
}

/*----------------------------------------------------------------------
/* Jumps the browser to the requested location page. 
/* i.e. BrowserGo(-1); will jump back to the previous browser page.
/*--------------------------------------------------------------------*/
function BrowserGo(loc) {
	var num = Number(loc);
	try {
		if (num != NaN) history.go(num);
	}
	catch(e){}
}

/*----------------------------------------------------------------------
/* Common function used to print every page.
/*--------------------------------------------------------------------*/
function PrintPage() {
	try	{
		// NOTE: In the future, we will want to do some more fancy
		//       print options, that is why this routine exists.
		window.self.print();
	}
	catch(e){}
}

/*----------------------------------------------------------------------
/* Bookmark the current page.
/*--------------------------------------------------------------------*/
function BookmarkPage(pageURL){
	try {
		if ((navigator.appVersion.indexOf("MSIE") > 0) && 
			(parseInt(navigator.appVersion) >= 4)) {
			window.external.AddFavorite(location.href, unescape(pageURL));
		}
	}
	catch(e){}
}

/*----------------------------------------------------------------------
/* Jumps to the current location on the page using static anchor links.
/*
/* Input: TOP, BOTTOM, <anchorname>
/*--------------------------------------------------------------------*/
function JumpPage(loc){
	try {
		if (loc!="" && loc!=null) {
			switch(loc) {
				case TOP:		window.loc.href = "#Bottom"; break;
				case BOTTOM:	window.loc.href = "#Top"; break;
				default: 		window.loc.href = loc;
			}
		}
	}
	catch(e){}
}

/*----------------------------------------------------------------------
/* Send a link to the current page to another email address.
/*--------------------------------------------------------------------*/
function SendToAFriend() {
	alert("Send-To-A-Friend is not available yet.");
}

/*----------------------------------------------------------------------
/* Display a message that this feature is not available.
/*--------------------------------------------------------------------*/
function MsgNotAvailable() {
	alert("This feature is not currently available.");
}

/*----------------------------------------------------------------------
/* Display a message that this feature is not available.
/*--------------------------------------------------------------------*/
function MsgProdNotAvailable() {
	alert("This product is not currently available.");
}

/*----------------------------------------------------------------------
/* Creates an email that will not be trapped by spammers. Note that the
/* ext parameter must include the dot(.) to be successful.
/* e.g. NoSpamEmail('support','enivausa','.com');	// No subject line.
/* e.g. NoSpamEmail('support','enivausa','.com','test email');
/*--------------------------------------------------------------------*/
function NoSpamEmail(name,domain,ext,subjectline) {
	if(name != "" && domain != "" && ext != "") {
		try {
			if (subjectline == null) { subjectline = ""; }
  			document.write("<a href=mailto:"+name+"@"+domain+ext+"?subject="+subjectline+">");
		} 
		catch(e){}
	}
}

/*----------------------------------------------------------------------
/* Defines the Eniva USA copyright text to a page location. (Theme)
/* This is code that needs to be inserted via the <script> tag.
/*--------------------------------------------------------------------*/
function makeCopyright() {
	document.write("&copy;2006 Creating Health From Home. All Rights Reserved.<br>");
	document.write("Creating Health From Home is operated by authorized independent members of the Eniva Corporation.<br>");
	document.write("Duplication of any portion in this website is illegal without ");
	document.write("<span onClick='alert(\"How to contact us...\\r\\rCreating Health From Home\\r14400 West Burnsville Parkway\\rBurnsville, MN  55306\\r\\r-----support@chfh.com-----\")'>");
	document.write("<a href='Javascript:void(0);'>written permission</a>.</span>");
}

/*----------------------------------------------------------------------
/* Defines the ANA-DSHEA product statement to a page location. 
/* This is code that needs to be inserted via the <script> tag.
/*--------------------------------------------------------------------*/
function makeDSHEA() {
	document.write("<span class='ssmItems'>");
	document.write("<b>*</b> This statement has not been evaluated by the Food and Drug Administration. ");
	document.write("These products are not intended to diagnose, treat, cure, or prevent any disease; research is ongoing.</span>");
}

/*----------------------------------------------------------------------
/* Defines the ANA-DSHEA product statement to a general products page. 
/* This is code that needs to be inserted via the <script> tag.
/*--------------------------------------------------------------------*/
function makeDSHEA2() {
	document.write("<span class='ssmItems'>");
	document.write("These statements have not been evaluated by the Food and Drug Administration. ");
	document.write("This information is not intended to diagnose, treat, cure, or prevent any disease; research is ongoing.</span>");
}

/*----------------------------------------------------------------------
/* Defines the standard pricing policy. Used on every purchase page.
/* This is code that needs to be inserted via the <script> tag.
/*--------------------------------------------------------------------*/
function makePricingPolicy() {
/*	*** VALIDATE THIS FOR CORECTNESS
	document.write("<span class='Pricing1'>");
	document.write("PLEASE NOTE THAT THE PRICES DISPLAYED REFLECT FACTORY DIRECT PRICING. WHOLESALE PRICING IS AVAILABLE ON EVERY ITEM ");
	document.write("AFTER YOU HAVE PURCHASED $500.00 OR MORE WITHIN 12 MONTHS. ONCE ATTAINED, WHOLESALE PRICING DISCOUNT WILL NEVER EXPIRE. ");
	document.write("WHOLESALE PRICING DISCOUNTS WILL BE ADJUSTED AUTOMATICALLY ON YOUR INVOICE ");
	document.write("AND CREDIT CARD STATEMENT. CALL ENIVA USA TOLL FREE AT 866-ENIVA-US FOR DETAILS.<br><br>");
	document.write("AS ALWAYS, WE RESPECT YOUR PRIVACY AND WILL NOT DIVULGE YOUR PRIVATE INFORMATION TO <u>ANY</u> EXTERNAL COMPANIES.");
*/	
}
                              
/*----------------------------------------------------------------------
/* Displays the current date. Format = (i.e. Monday, January 1, 2004)
/*--------------------------------------------------------------------*/
function makeDate() {
    var now = new Date();
    var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    function fourdigits(number)	{
      	return (number < 1000) ? number + 1900 : number;}
    today =  days[now.getDay()]+", "+months[now.getMonth()]+" "+date+", "+(fourdigits(now.getYear()));
    document.write(today);
}

/*----------------------------------------------------------------------
/* Displays a digital clock.
/*    LCD Clock script- by javascriptkit.com
/*    Visit JavaScript Kit (http://javascriptkit.com) for script
/*    Credit must stay intact for use.
/*--------------------------------------------------------------------*/
/*
function makeClock() {
	var alternate = 0;

	//var standardbrowser = !document.all && !document.getElementById;
	//if (standardbrowser)
	document.write('<form name="tick"><input type="text" name="tock" size="11"></form>');

	//window.onload = showClock();
	function show() {
		//if (!standardbrowser)
			//var clockobj = document.getElementById ? document.getElementById("digitalclock") : document.all.digitalclock
		//clockobj = document.getElementById ? document.getElementById("digitalclock") : document.all.digitalclock;

		var Digital = new Date();
		var hours = Digital.getHours();
		var minutes = Digital.getMinutes();
		var dn = "AM";
		if (hours==12) dn="PM" {
			if (hours>12){
				dn="PM"
				hours=hours-12
			}
		}
		if (hours==0) hours = 12;
		if (hours.toString().length==1)	hours="0" + hours;
		if (minutes<=9)	minutes="0" + minutes;
		if (standardbrowser){
			if (alternate==0)
				document.tick.tock.value = hours + " : " + minutes+" " + dn;
			else
				document.tick.tock.value = hours + "   " + minutes+" " + dn;
		}
		else{
			if (alternate==0)
				clockobj.innerHTML=hours+"<font color='lime'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>";
			else
				clockobj.innerHTML=hours+"<font color='black'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>";
		}
		alternate = (alternate==0) ? 1 : 0;
		setTimeout("show()",1000);
	}
window.onload = show;	
}
*/

/*----------------------------------------------------------------------
/* Allows for easy rollover images.
/* Requires a rollover image in the /graphics directory with the
/* extension of "_over.gif" (i.e. home_over.gif)
/*--------------------------------------------------------------------*/
function rollover(imgName) {
	eval("document.images."+imgName+".src='/graphics/"+imgName+"_over.gif'");
}
function rollout(imgName) {
	eval("document.images."+imgName+".src='/graphics/"+imgName+"_up.gif'");
}

/*----------------------------------------------------------------------
/* Adds the Google Site Flavored Search index.
/*--------------------------------------------------------------------*/
function makeSearchBar() {
	document.write("<!-- Site-Flavored Google Search --><form method=GET action='http://www.google.com/search'>");
	document.write("<table bgcolor=#FFFFFF><tr><td><a href='http://www.google.com/services/siteflavored.html'>");
	document.write("<img src='http://labs.google.com/images/gp/google_kaltix_site_flavored_searchbox.gif' border=0 alt=Google align=absmiddle></a> <input type=text name=q size=31 maxlength=255 value=''>");
	document.write("<input type=hidden name=site_flavored value=on>");
	document.write("<input type=hidden name=client value=site_flavored>");
	document.write("<input type=hidden name=hl value=en>");
	document.write("<input type=hidden name=interests value=66|67|71|75|68|72|76|70|73>");
	document.write("<span id=site_flavored_name></span><script language=javascript>");
	document.write("homeHTML = '<input type=hidden name=site_flavored_name value=' + document.location +'>';");
	document.write("document.getElementById('site_flavored_name').innerHTML = homeHTML;</script>");
	document.write("<input type=submit name=sa value='Custom Search'><font face=arial,sans-serif size=-1><br></font><br>");
	document.write("</td></tr></table></form>");
	document.write("<!-- Site-Flavored Google Search -->");
}

/*----------------------------------------------------------------------
/* Various Macromedia javascript calls. (c)Macromedia
/*--------------------------------------------------------------------*/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/*----------------------------------------------------------------------
/* Sets the focus to the first text entry element on the first page form.
/*--------------------------------------------------------------------*/
function formFocus(){
	if(document.forms.length>0){var field=document.forms[0];for(i=0;i<field.length;i++){
	if((field.elements[i].type=="text")||(field.elements[i].type=="textarea")||(field.elements[i].type.toString().charAt(0)=="s")){
	document.forms[0].elements[i].focus();break;}}}
}

-->
