
function addbookmark()
{
if (document.all)
{window.external.AddFavorite(document.location,document.title)}
}

var clockID=0
function UpdateClock()
{
if (clockID)
{clearTimeout(clockID);
clockID = 0;}

var H,M,S,Mth,Day,AMPM,Yr
var tDate = new Date();
Day=tDate.getDate()

Mth=tDate.getMonth()+1
if (Mth==1){Mth="Jan"}
if (Mth==2){Mth="Feb"}
if (Mth==3){Mth="Mar"}
if (Mth==4){Mth="Apr"}
if (Mth==5){Mth="May"}
if (Mth==6){Mth="Jun"}
if (Mth==7){Mth="Jul"}
if (Mth==8){Mth="Aug"}
if (Mth==9){Mth="Sep"}
if (Mth==10){Mth="Oct"}
if (Mth==11){Mth="Nov"}
if (Mth==12){Mth="Dec"}

Yr=tDate.getFullYear()

H=tDate.getHours();
if (H>11)
{AMPM="pm";}
else
{AMPM="am";}

if (H>12)
{H=H-12;}

if (H<10)
{H="0"+H;}

M=tDate.getMinutes()
if (M<10)
{M="0"+M;}

S=tDate.getSeconds()
if (S<10)
{S="0"+S;}

theTime.value = Mth+" "+Day+" "+Yr + "::"
+ H + ":" + M + ":" + S +" "+ AMPM;
clockID = setTimeout("UpdateClock()",1000);
}

var clockID=0
function StartClock() {
clockID = setTimeout("UpdateClock()",500);
}

function KillClock() {
if (clockID)
 {clearTimeout(clockID);
 clockID = 0;}
}

var clockID1=0
function UpdateClock1()
{
if (clockID1)
{clearTimeout(clockID1);
clockID1 = 0;}

var tDate = new Date();
Day=tDate.getDate()
if (Day<10)
{Day="0"+Day;}

Mth=tDate.getMonth()+1
if (Mth==1){Mth="Jan"}
if (Mth==2){Mth="Feb"}
if (Mth==3){Mth="Mar"}
if (Mth==4){Mth="Apr"}
if (Mth==5){Mth="May"}
if (Mth==6){Mth="Jun"}
if (Mth==7){Mth="Jul"}
if (Mth==8){Mth="Aug"}
if (Mth==9){Mth="Sep"}
if (Mth==10){Mth="Oct"}
if (Mth==11){Mth="Nov"}
if (Mth==12){Mth="Dec"}

Yr=tDate.getFullYear()

H=tDate.getHours();
if (H>11)
{AMPM="pm";}
else
{AMPM="am";}

if (H>12)
{H=H-12;}

if (H<10)
{H="0"+H;}

M=tDate.getMinutes()
if (M<10)
{M="0"+M;}

S=tDate.getSeconds()
if (S<10)
{S="0"+S;}

theClock1.theTime1.value = Day + "-" + Mth + "-" + Yr + "::"
+ H + ":" + M + ":" + S + AMPM;
clockID1 = setTimeout("UpdateClock1()",1000);
}

function StartClock1() {
clockID1 = setTimeout("UpdateClock1()",500);
}

function KillClock1() {
if (clockID1)
 {clearTimeout(clockID1);
 clockID1 = 0;}
}

var Feet,Result,Inches,Lbs,Cms,Kgs,Pinch,Peet,Metres,Height,Weight,x,active,gender,input,tot,carb,prot,fat,A1,A2,A3,A4,frac

function FeetConvert()
{
Result=TGrams.ft.value*30.48;
Result+=TGrams.ins.value*2.54;
decimal();
TGrams.cms.value=Result.toFixed(frac);
}

function InchConvert()
{
Peet=TGrams.ft.value;
Pinch=TGrams.ins.value;

if (Pinch >= 12)
	{FtInsConvert(Pinch);}
else
	{Feet=Peet*30.48;
	Inches=Pinch*2.54;
	Result=+Inches+Feet;
	decimal();
	TGrams.cms.value=Result;}
}

function FtInsConvert()
{
Inches=Pinch%12;
Feet=+Peet+parseInt(Pinch/12);
TGrams.ft.value=Feet;
decimal();
TGrams.ins.value=Inches;
Result=(Feet*30.48)+(Inches*2.54);
decimal();
TGrams.cms.value=Result.toFixed(frac);
}

function CmsConvert()
{
Cms=TGrams.cms.value;
Feet=parseInt(Cms/30.48);
Inches=(Cms % 30.48)/2.54;
TGrams.ft.value=Feet;
decimal();
TGrams.ins.value=Inches.toFixed(frac);
}

function LbsConvert()
{
Kgs=TGrams.lbs.value*0.45359;
decimal();
TGrams.kgs.value=Kgs.toFixed(frac);
}

function KgsConvert()
{
Lbs=TGrams.kgs.value*2.2;
decimal();
TGrams.lbs.value=Lbs.toFixed(frac);
}

function GramsCalculate()
{
decimal();FtInsConvert();LbsConvert();
carb=TGrams.carb.value;
prot=TGrams.prot.value;
fat=TGrams.fat.value;
tot=eval(parseInt(carb) + parseInt(prot) + parseInt(fat));
TGrams.carb.value=parseInt(carb/tot*100);
TGrams.prot.value=parseInt(prot/tot*100);
TGrams.fat.value=100-parseInt(carb/tot*100)-parseInt(prot/tot*100);

carb=TGrams.carb.value/100;
prot=TGrams.prot.value/100;
fat=TGrams.fat.value/100;
if (TGrams.radio3[1].checked)
	{Weight=TGrams.kgs.value*4.36/2.2046;
	Height=TGrams.cms.value*4.32*2.54;
	Age=TGrams.age.value*4.7;
	Result=655+Weight+Height-Age;}
else
	{Weight=TGrams.kgs.value*6.22/2.2046;
	Height=TGrams.cms.value*12.7*2.54;
	Age=TGrams.age.value*6.8;
	Result=66+Weight+Height-Age;}

if (TGrams.Activity[0].checked){
A1=(Result*carb/Protein).toFixed(frac);
A2=(Result*prot/Carbs).toFixed(frac);
A3=(Result*fat/Fats).toFixed(frac);
A4=Result.toFixed(frac);
active=TGrams.Activity[0].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}

else if (TGrams.Activity[1].checked){
A1=(Result*1.25*carb/Protein).toFixed(frac);
A2=(Result*1.25*prot/Carbs).toFixed(frac);
A3=(Result*1.25*fat/Fats).toFixed(frac);
A4=(Result*1.25).toFixed(frac);
active=TGrams.Activity[1].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}

else if (TGrams.Activity[2].checked){
A1=(Result*1.3*carb/Protein).toFixed(frac);
A2=(Result*1.3*prot/Carbs).toFixed(frac);
A3=(Result*1.3*fat/Fats).toFixed(frac);
A4=(Result*1.3).toFixed(frac);
active=TGrams.Activity[2].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}

else if (TGrams.Activity[3].checked){
A1=(Result*1.5*carb/Protein).toFixed(frac);
A2=(Result*1.5*prot/Carbs).toFixed(frac);
A3=(Result*1.5*fat/Fats).toFixed(frac);
A4=(Result*1.5).toFixed(frac);
active=TGrams.Activity[3].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}

else if (TGrams.Activity[4].checked){
A1=(Result*1.7*carb/Protein).toFixed(frac);
A2=(Result*1.7*prot/Carbs).toFixed(frac);
A3=(Result*1.7*fat/Fats).toFixed(frac);
A4=(Result*1.7).toFixed(frac);
active=TGrams.Activity[4].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}

else if (TGrams.Activity[5].checked){
A1=(Result*2*carb/Protein).toFixed(frac);
A2=(Result*2*prot/Carbs).toFixed(frac);
A3=(Result*2*fat/Fats).toFixed(frac);
A4=(Result*2).toFixed(frac);
active=TGrams.Activity[5].value;
for (x=0;x<=TGrams.radio3.length-1;x=x+1)
{if (TGrams.radio3[x].checked)
{gender=TGrams.radio3[x].value;}
}
}
TGrams.actgender.value=active+" for "+gender+"  : "+A4+" Calories";
TGrams.carbs.value="Carbohydrates  : "+A1+" grams ("+(A1/28.35).toFixed(frac)+" ozs.)";
TGrams.protein.value="Protein                 : "+A2+" grams ("+(A2/28.35).toFixed(frac)+" ozs.)";
TGrams.fats.value="Fat                          :"+A3+" grams ("+(A3/28.35).toFixed(frac)+" ozs.)";
}

function validateInput()
	{
	x=document.TGrams
	input=x.cms.value
	if (input<1)
		{alert("Your height, please!");
		focus(cms);
		return false;}

		input=x.kgs.value;
	if (input<1)
		{alert("Your weight, please!");
		focus(kgs);
		return false;}

		input=x.age.value;
	if (input<1)
		{alert("Your age, please!");
		focus(age);
		return false;}
	else
		{return true;}
	}	

function decimal()
{
for (x=0;x<=TGrams.Decimal.length;x=x+1){
if (TGrams.Decimal[x].selected)
{frac=x;
return true;}
}
}

function WaistInchConvert()
{
Peet=BMI11.feet.value;
Pinch=BMI11.inches.value;

if (Pinch >= 12)
	{r=Pinch%12;
	Feet=Math.round(Pinch/12);
	Result=+Peet+Feet;
	BMI11.feet.value=Result;
	BMI11.inches.value=r;}
}

function InchConvert()
{
Peet=BMI1.feet.value;
Pinch=BMI1.inches.value;

if (Pinch >= 12)
	{r=Pinch%12;
	Feet=Math.round(Pinch/12);
	Result=+Peet+Feet;
	BMI1.feet.value=Result;
	BMI1.inches.value=r;}
}

function ValidInput()
{
		
		if (BMI1.feet.value.length<1)
			{alert("Please enter your height in feet");
			BMI1.feet.focus();
			return false;}

		else if (BMI1.inches.value>=12)
			{alert("Inches should be less than 12");
			BMI1.inches.focus();
			return false;}

		else if (BMI1.cms.value.length<1)
			{alert("Please enter your height in cms");
			BMI1.cms.focus();
			return false;}

		else
		{return true;}
}

function RadioCheck0()
{
	if (BMI11.Radio1[0].checked=true)
		{BMI11.Radio1[1].checked=false;

		BMI11.feet.disabled=false;
		BMI11.inches.disabled=false;
		BMI11.lbs.disabled=false;

		BMI11.feet.value="";
		BMI11.inches.value="";
		BMI11.lbs.value="";

		BMI11.cms.value="XXXX";
		BMI11.kgs.value="XXXX";

		BMI11.cms.disabled=true;
		BMI11.kgs.disabled=true;

		BMI11.feet.focus();}
}

function RadioCheck1()
{
	if	(BMI11.Radio1[1].checked=true)
		{BMI11.Radio1[0].checked=false;

		BMI11.feet.value="XXXX";
		BMI11.inches.value="XXXX";
		BMI11.lbs.value="XXXX";

		BMI11.feet.disabled=true;
		BMI11.inches.disabled=true;
		BMI11.lbs.disabled=true;

		BMI11.cms.disabled=false;
		BMI11.kgs.disabled=false;

		BMI11.cms.value="";
		BMI11.kgs.value="";

		BMI11.cms.focus();}
}

function ValidComments(){
if (form2.name1.value==""){alert("Your name, please");form2.name1.focus();return false;}
if (form2.email1.value==""){alert("Your email, please");form2.email1.focus();return false;}
var goodEmail = form2.email1.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
if (goodEmail){}
 else
{alert ("Please enter a valid e-mail address.");
form2.email1.focus();
form2.email1.select();
return false;}
if (form2.comments1.value==""){alert("Your comments, please");form2.comments1.focus();return false;}
}

// Word Filter
// (c) 2002 Premshree Pillai
// Created : 23 June 2002
// http://www.qiksearch.com
// http://javascript.qik.cjb.net
// E-mail : qiksearch@rediffmail.com

function reset_alert_count()
{
 swear_alert_count=0;
}

function validate_user_text()
{
 reset_alert_count();
var swear_words_arr=new Array("fuck","shit","ass","cunt","pussy","piss","<",">");
var swear_alert_arr=new Array;
var swear_alert_count=0;
 var compare_text=form2.comments1.value;
 for(var i=0; i<swear_words_arr.length; i++)
 {
  for(var j=0; j<(compare_text.length); j++)
  {
   if(swear_words_arr[i]==compare_text.substring(j,(j+swear_words_arr[i].length)).toLowerCase())
   {
    swear_alert_arr[swear_alert_count]=compare_text.substring(j,(j+swear_words_arr[i].length));
    swear_alert_count++;
   }
  }
 }
 var alert_text="";
 for(var k=1; k<=swear_alert_count; k++)
 {
  alert_text+="\n" + "(" + k + ")  " + swear_alert_arr[k-1];
 }
 if(swear_alert_count>0)
 {
  alert("The form cannot be submitted.\nThe following illegal words were found:\n_______________________________\n" + alert_text + "\n_______________________________");
  form2.comments1.select();
 }
 else
 {
  form2.submit();
 }
}

function select_area()
{
 form2.comments1.select();
}

window.onload=reset_alert_count;


function openlamellar() {
	clipleft=-width_slice
	clipright=0
    if (i_clipright<=width_slice) {
        for (i=0;i<=x_slices;i++) {
            var thiss=eval("document.all.s"+i+".style")
            thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
            clipleft+=width_slice
            clipright=clipleft+i_clipright
		}
    i_clipright++
    var timer=setTimeout("openlamellar()",20)
   }
   	else {
		clearTimeout(timer)
		var timer=setTimeout("closelamellar()",2000)
	}
}

function openlamellarNN() {
	clipleft=-width_slice
	clipright=0
    if (i_clipright<=width_slice) {
        for (i=0;i<=x_slices;i++) {
            var thiss=eval("document.s"+i)
			thiss.clip.left=clipleft
        	thiss.clip.right=clipright
        	thiss.clip.top=cliptop
        	thiss.clip.bottom=clipbottom
            clipleft+=width_slice
            clipright=clipleft+i_clipright
		}
    i_clipright++
    var timer=setTimeout("openlamellarNN()",20)
   }
   	else {
		clearTimeout(timer)
		var timer=setTimeout("closelamellarNN()",2000)
	}
}

function closelamellar() {
    clipleft=-width_slice
	clipright=0
    if (i_clipright>=0) {
        for (i=0;i<=x_slices;i++) {
            var thiss=eval("document.all.s"+i+".style")
            thiss.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
            clipleft+=width_slice
            clipright=clipleft+i_clipright
		}
    i_clipright--
    var timer=setTimeout("closelamellar()",20)
    
   }
   	else {
		clearTimeout(timer)
		var timer=setTimeout("changeimage()",2000)
	}
}

function closelamellarNN() {
    clipleft=-width_slice
	clipright=0
    if (i_clipright>=0) {
        for (i=0;i<=x_slices;i++) {
           	var thiss=eval("document.s"+i)
			thiss.clip.left=clipleft
        	thiss.clip.right=clipright
        	thiss.clip.top=cliptop
        	thiss.clip.bottom=clipbottom
            clipleft+=width_slice
            clipright=clipleft+i_clipright
		}
    i_clipright--
    var timer=setTimeout("closelamellarNN()",20)
    
   }
   	else {
		clearTimeout(timer)
		var timer=setTimeout("changeimageNN()",2000)
	}
}

function changeimage() {
    content=""
	if (i_message>message.length-1) {i_message=0}
    content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
    content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
	content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
    content+="<a href="+messageurl[i_message]+" target="+target_url+">"
    content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
    content+=message[i_message]
    content+="</font></a></td></tr></table>"
	for (i=0;i<=x_slices;i++) {
        var thisinners=eval("s"+i)
        thisinners.innerHTML=content   
    }
	i_message++
	openlamellar()
}

function changeimageNN() {
    content=""
	if (i_message>message.length-1) {i_message=0}
    content+="<table border="+borderwidth+" cellpadding='5' width="+textwidth+" height="+textheight+">"
    content+="<tr><td bgcolor="+bg_ticker+" align="+alignmessage[i_message]+">"
	content+="<img hspace=5 src="+messageimg[i_message]+" align="+alignimg[i_message]+" border='0'>"
    content+="<a href="+messageurl[i_message]+" target="+target_url+">"
    content+="<font face="+font_face+" size="+font_size+" color="+font_color+">"
    content+=message[i_message]
    content+="</font></a></td></tr></table>"
	for (i=0;i<=x_slices;i++) {
        var thisinners=eval("document.s"+i+".document")
        thisinners.write(content)
		thisinners.close()
    }
	i_message++
	openlamellarNN()
}

    for (i=0;i<=x_slices;i++) {
        document.write("<span id='s"+i+"' class='s'></span>")
	}
