
function onTopPlease() {
// Ensures that the site is not framed
    if (top.location != self.location) {
         top.location.href = self.location.href;
    }
    else {
         return true;
    }
}

function writeWarning() {
	document.write("<p><font face='Arial, Helvetica, Garamond' size='1' color='#000000'>Health warning:<br>");
	document.write("Whilst Auravita Limited uses reasonable efforts to include accurate and up to ");
	document.write("date information on this site, it makes no warranties or representations  ");
	document.write("as to the accuracy of such information. The information provided  ");
	document.write("on this site and the pages contained herein is for guidance  ");
	document.write("only and it does not constitute medical advice. Before undertaking  ");
	document.write("any strenuous exercise or course of vitamins you should seek  ");
	document.write("medical advice from your physician. Auravita Limited assumes  ");
	document.write("neither liability nor responsibility for the content of this  ");
	document.write("site, which is followed at your own risk. Vitamins should be  ");
	document.write("taken in conjunction with, and not as a substitute for a healthy  ");
	document.write("and balanced diet.</font></p> ");
}			

function SubmitFormWithConfirm(sFormName) {
	var objForm = eval("document." + sFormName);
	if (confirm("Are you sure?")) {
		objForm.submit();
	}
}

function SubmitForm(sFormName) {
	var objForm = eval("document." + sFormName);
	objForm.submit();
}


function checkUncheck(sFormName, setting) {
	var theForm = eval("document." + sFormName);
	for (i = 0; i < theForm.length; i++) {
		theForm.elements[i].checked = setting;
	}
}

function toggleExpando(expandoName,caption) {

    var sContainer;
    var sStyleObj;
    var obj;
    var bNetscape;
    
    //var element = eval('document.all.' + caption)
    //var expando = eval('document.all.' + expandoName)
	
	var element;
	var expando;
	
	/*-----------------------------------------------------------------
	 Check for the browser type so we know how to call the DIV element
	 -----------------------------------------------------------------*/
	if(document.all)
    {
		//IE & Opera browser 
		element = eval('document.all.' + caption)
		expando = eval('document.all.' + expandoName)
	}
        
    if(!document.all && document.getElementById)
    {
		//NN6+ browser
		element = eval('document.getElementById(caption)')
		expando = eval('document.getElementById(expandoName)')
	}
    /*-----------------------------------------------------------------*/
	
	
	
    if ( element.style.visibility == 'visible' ) {
        element.style.visibility = 'hidden';
        element.style.display = 'none';
        expando.innerHTML = '<img src="images/plus.gif" height="11" width="11" alt="+" border="0">';        
    }
    else {
        element.style.visibility = 'visible';
        element.style.display = 'block';
        expando.innerHTML = '<img src="images/minus.gif" height="11" width="11" alt="-" border="0">';            
    }
}

function IsNumeric(strString) {
   //  check for valid numeric strings	
 
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
function IsDecimalNumeric(strString) {
   //  check for valid numeric strings, allow . too
 
   var strValidChars = "0123456789.";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
      
function fieldChanged(objField,sFormName,sSaveButtonName) {
	//  changes the background colour of a field to show it has been changed, and enables the save button on the form
	objField.style.backgroundColor = "aqua";
	var cmdSaveButton = eval("document." + sFormName + "." + sSaveButtonName);
	cmdSaveButton.disabled = false;
}

function resizeToParentWindow() {
	if (opener) {
		// resize a window so that it fits in its parent window nicely.
		if (window.screenY) {
		     var intTopPos = opener.screenY + 15;
		     var intLeftPos = opener.screenX + 15;
		     var intHeight = opener.innerWidth - 30;	     
		     var intWidth = opener.innerWidth * 0.75;
		}
		else if (window.screenLeft) {
		     var intTopPos = opener.screenTop + 15;
		     var intLeftPos = opener.screenLeft + 15;
		     var intHeight = opener.document.body.clientHeight - 30;
		     var intWidth = opener.document.body.clientWidth * 0.75;	// ensure it's not too small
		}
		if (intWidth > 820) intWidth = 820;	// ensure it's not too big
		window.moveTo(intLeftPos,intTopPos);
		window.resizeTo(intWidth,intHeight);
	}
}