/**
 * @author Mike Etts, 2007-2009
 */
/*--------------------------------------------------------------------------------*/
var LastQuotNum;
var CurrHdrPic;
/*--------------------------------------------------------------------------------*/
function showQuote( seq )
{
   var q=new Array() 
   var styled;
   q[0] = { Txt: "Come to the edge,<br>He said.<br>They said, <br>we are afraid.<br>Come to the edge, <br>He said.<br><br>They came.<br>He pushed them...<br>And they flew.<br><br>-Guillaume Apollinaire", TxtSz : "13px" };
   q[1] = { Txt: "The brook would lose its song if the rocks were taken away<br><br>Elizabeth Kellogg", TxtSz : "15px" };
   q[2] = { Txt: "Security is mostly a superstition. It does not exist in nature... <br>Life is either a daring adventure or nothing.<br><br>Helen Keller", TxtSz : "14px" };
   q[3] = { Txt: "You yourself, as much as anybody in the entire universe, deserve your love and affection.<br><br> Buddha" , TxtSz : "14px" };
   q[4] = { Txt: "...that best portion of a good man's life: <br>his little, nameless, unremembered acts of kindness and love.<br><br>William Wordsworth", TxtSz : "13px" };
   q[5] = { Txt: "If you have built castles in the air, your work need not be lost, that is where they should be. Now put the foundations under them.<br><br>Henry David Thoreau", TxtSz : "13px" };
   q[6] = { Txt: "Whatever you can do, or dream you can, begin it. <br><br>Boldness has genius and power and magic in it.<br><br> Goethe", TxtSz : "14px" };
   q[7] = { Txt: "Forgiveness frees the forgiver. It extracts the forgiver from someone else's nightmare.<br><br>Lance Morrow", TxtSz : "15px" };
   q[8] = { Txt: "Whoever survives a test,<br> whatever it may be, must tell the story.<br> That is his duty.<br><br> Elie Wiesel", TxtSz : "15px" };
   q[9] = { Txt: "Out of suffering have emerged the strongest souls;<br><br> the most massive characters are seared with scars.<br><br>Edwin H. Chapin ", TxtSz : "14px" };
   q[10] = { Txt: "The world breaks everyone and afterward some are strong at the broken places...<br><br>Ernest Hemingway ", TxtSz : "15px" };
   q[11] = { Txt: "The most beautiful people we have known<br>are those who have known defeat,<br>known suffering, known struggle, known loss,<br>and have found their way out of the depths [...]<br>Beautiful people do not just happen. <br><br>Elisabeth Kubler-Ross", TxtSz : "13px" };
   q[12] = { Txt: "The secret of health for both mind and body is not to mourn for the past, worry about the future, or anticipate troubles but to live in the present moment wisely and earnestly.<br><br>Buddha", TxtSz : "13px" };
   q[13] = { Txt: "Happiness cannot be traveled to, owned, earned, worn or consumed. <br>Happiness is the spiritual experience of living every minute with love, grace, and gratitude. <br><br>Denis Waitley", TxtSz : "13px" };
   q[14] = { Txt: "Don't ask yourself what the world needs, ask yourself what makes you come alive. <br>And then go and do that. Because what the world needs is people who have come alive.<br><br>Howard Washington Thurman ", TxtSz : "13px" };
   q[15] = { Txt: "A ship in harbor is safe, but that is not what ships are built for<br><br>John A. Shedd", TxtSz : "15px" };
   q[16] = { Txt: "We all leave childhood with wounds. [...] The injuries we have suffered invite us to assume the most humane of all vocations - to heal ourself and others<br><br>Sam Keen", TxtSz : "14px" };
   q[17] = { Txt: "On the mountains of truth you can never climb in vain: either you will reach a point higher up today, or you will be training your powers so that you will be able to climb higher tomorrow<br><br>Friedrich Nietzsche", TxtSz : "13px" };
   q[18] = { Txt: "How far that little candle throws his beams! <br>So shines a good deed in a weary world<br><br>Shakespeare", TxtSz : "15px" };
   q[19] = { Txt: "If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music which he hears, however measured or far away<br><br>Henry David Thoreau", TxtSz : "13px" };
   q[20] = { Txt: "Memory Believes before Knowing Remembers <br><br>William Faulkner", TxtSz : "15px" };
   q[21] = { Txt: "Most of the important things in the world<br>have been accomplished by people who have kept on trying when there seemed to be no hope at all.<br><br>Dale Carnegie ", TxtSz : "13px" };
   q[22] = { Txt: "Our greatest glory consists not in never falling, but in rising every time we fall.<br><br> Ralph Waldo Emerson ", TxtSz : "15px" };
   q[23] = { Txt: "What the caterpillar calls the end of the world, <br>the master calls a butterfly.<br><br>Richard Bach", TxtSz : "15px" };
   q[24] = { Txt: "If we could read the secret history of our enemies we should find in each man's life sorrow and suffering enough to disarm all hostility.<br><br>Longfellow", TxtSz : "13px" };
   q[25] = { Txt: "I am larger, better than I thought. I did not know I held so much goodness.<br><br>Walt Whitman", TxtSz : "15px" };
   q[26] = { Txt: "Love is an act of endless forgiveness, a tender look which becomes a habit.<br><br>Peter Ustinov (English actor)", TxtSz : "15px" };
   q[27] = { Txt: "If you bring forth what is within you, what you bring forth will save you. If you do not bring forth what is within you, what you do not bring forth will destroy you.<br><br>Jesus", TxtSz : "13px" };
   q[28] = { Txt: "He who has a why to live can bear almost any how<br><br>Friedrich Nietzsche", TxtSz : "15px" };
   q[29] = { Txt: "In the confrontation between the stream and the rock, the stream always wins - not through strength, but through persistence.<br><br> Buddha", TxtSz : "14px" };
   q[30] = { Txt: "Wisdom comes with age, but sometimes age comes alone<br><br>Unknown", TxtSz : "15px" };
   q[31] = { Txt: "May we love ever more.<br> May we motivate ourselves to committed love in Action.  May we motivate ourselves to live the life we wish to see in the world. May we be the transformation we wish to see in the world.  From the inside out . . .  From the roots branching upwards . . .  From the heart to thought to word to action. Through life's trials and hardships we can arise beautiful and free  --- Julia Butterfly Hill ", TxtSz : "11px" };
   q[32] = { Txt: "Sell your cleverness and buy bewilderment<br><br>Rumi", TxtSz : "15px" };
   q[33] = { Txt: "Character cannot be developed in ease and quiet.<br> Only through experiences of trial and suffering<br> can the soul be strengthened, vision cleared,<br> ambition inspired, and success achieved.<br><br>Helen Keller", TxtSz : "13px" };
   q[34] = { Txt: "Between stimulus and response, there is a space. <I>In that space is our power to choose our response.</I> In our response lies our growth and our freedom.<br><br>Victor Frankl", TxtSz : "13px"};
   q[35] = { Txt: "Some minds seem almost to create themselves, springing up under every disadvantage and working their solitary but irresistible way through a thousand obstacles.<br><br>Washington Irving", TxtSz : "13px" };
   q[36] = { Txt: "Your vision will become clear only when you look into your heart. Who looks outside, dreams. Who looks inside, awakens. <br><br>Carl Jung", TxtSz : "14px" };
   q[37] = { Txt: "for there is nothing either good or bad, but thinking makes it so. <br><br>William Shakespeare", TxtSz : "14px" };
   q[38] = { Txt: "To the mind that is still, the whole universe surrenders. <br><br>Lao Tzu", TxtSz : "14px" };






   var Q = q.length;
   if ( seq )
   {
      if ( seq.match(/next/i)  ) LastQuotNum = ( LastQuotNum+1 >= Q ? 0 : LastQuotNum+1 );
      if ( seq.match(/prev/i)  ) LastQuotNum = ( LastQuotNum-1 >= 0 ? LastQuotNum-1 : Q );
      styled="<p style='font-size:"+q[LastQuotNum].TxtSz+";' class=menuquote>"+q[LastQuotNum].Txt+"</p>";
   }
   else
   {
      var whichQuotation=Math.round(Math.random()*(Q-1));
      LastQuotNum = whichQuotation;
      styled="<p style='font-size:"+q[whichQuotation].TxtSz+";' class=menuquote>"+q[whichQuotation].Txt+"</p>";
   }
   if ( document.getElementById('quote') ) document.getElementById('quote').innerHTML=styled;
}
/*--------------------------------------------------------------------------------*/
function displayDiv( DivId, ID )
{
   /*--  alert ( DivId + " elem id = " + ID );  --*/
   if ( document.getElementById(DivId).style.display.match(/none/) )
   {
      document.getElementById(DivId).style.display="block";
   }
   else
   {
      document.getElementById(DivId).style.display="none";
   }
   if ( document.getElementById(ID).innerHTML.match(/see review/) )
   {
      document.getElementById(ID).innerHTML="hide review <img alt='up arrow' src='../images/arrow_up.gif'>";
   }
   else if ( document.getElementById(ID).innerHTML.match(/hide review/) )
   {
      document.getElementById(ID).innerHTML="see review <img alt='down arrow' src='../images/arrow_down.gif'>";
   }
}
/*---------------------------------------------------------------------------------------------------*/
function ChangePhoneNum ( HdrTable, Clinician, PhNum )
{
     if ( Clinician.match(/^me/i) ) { Clinician="Michael Etts, LGSW*, <a class=underl href=\"FAQ hypnotherapy Nassau Long Island NY.shtml#ACH\">ACH</a>"; }
     var spanstyle='<span style=" color:dimgray; padding:3px; font-size:14px; ">' + Clinician + '<br>';
     var PhoneWithStyle='<span style=" color:blue; padding:3px; font-size:17px; ">' + PhNum;
     /*--  var phone_img='&nbsp;&nbsp;&nbsp;<img alt="phone" src="../images/phone_blue.gif" align=absbottom></span>';  --*/
     var phone_img='</span>'; 
     HdrTable.rows[4].cells[0].innerHTML=spanstyle + PhoneWithStyle + phone_img;
     /*--  showQuote();  --*/
}
/*---------------------------------------------------------------------------------------------------*/
function ChangeHdrPicture ( HdrTable, pictureFile )
{
     HdrTable.rows[0].cells[1].innerHTML="<img border=0 padding=0 align=center src="+pictureFile+" alt=\"Header graphic\">";
     CurrHdrPic=HdrTable.rows[0].cells[1].innerHTML;
}
/*---------------------------------------------------------------------------------------------------*/
function HighlightResults ( AnalyzeTable, cellnum )
{
       for ( var y=1; y <= 3; y++ )
	  {
             AnalyzeTable.rows[0].cells[y].style.backgroundColor="white";
             AnalyzeTable.rows[1].cells[y].style.backgroundColor="white";
             AnalyzeTable.rows[0].cells[y].style.color="#6B696B";
             AnalyzeTable.rows[1].cells[y].style.color="#6B696B";
	  }
          AnalyzeTable.rows[0].cells[cellnum].style.backgroundColor="#CCFFFF";
          AnalyzeTable.rows[1].cells[cellnum].style.backgroundColor="#CCFFFF";
          AnalyzeTable.rows[0].cells[cellnum].style.color="brown";
          AnalyzeTable.rows[1].cells[cellnum].style.color="brown";
}
/*---------------------------------------------------------------------------------------------------*/
function DisplayQuizResult ( form, TableName, AnalyzeTable )
{
   var answerCount=0;
   var validSelects=0;
   for (x=0; x < form.length; x++ )
   {
      if ( form[x].checked == true )
      {
//for (var i in form[x])  
//{  
//  if ( i.match(/^checked/i) )  
//  {  
//    alert("form item " + x + " checked = " + form[x].checked + " name = " + form[x].name + " " + i + " " + form[x].value + "<br>");   
//  } 
//}  
          validSelects += parseInt(form[x].value);
	  answerCount++;
      }
   }
   if ( answerCount != 8 ) 
   { 
      alert ("Please answer all 8 questions to get an accurate score"); 
   } 
   else 
   {
      TableName.rows[0].cells[2].innerHTML="<span style='font:16pt Arial; color: brown;'>"+validSelects+"</span>";
       if ( validSelects >= 8 && validSelects <= 15 ) 
       { 
	  		HighlightResults ( AnalyzeTable, 3 );
       } 
       else if ( validSelects >= 16 && validSelects <= 23 ) 
       { 
	  		HighlightResults ( AnalyzeTable, 2 );
       } 
       else if ( validSelects >= 24 && validSelects <= 32 ) 
       { 
	  		HighlightResults ( AnalyzeTable, 1 );
       } 
   }
}
/*---------------------------------------------------------------------------------------------------*/
function ValidateAndSubmit ( form )
{
	var email=form['email'].value;
	var AtPos = email.indexOf("@")
	var StopPos = email.lastIndexOf(".")
	var alertStr="";
	if ( form['fname'].value == "" )
	{
		alertStr += "--> Please enter a name...\n"
	}
	if (email == "" || AtPos < 1 || StopPos < 1 ) 
	{
	   alertStr+="\n--> The email address '"+email+"' is not valid...\n";
	}
	if ( alertStr.length > 0 )
	{
		alert ( alertStr + "\n Please try again.");
	}
	else
	{
		form.action="https://member.ezezine.com/sub.ez";
		form.submit();
	}
}
/*---------------------------------------------------------------------------------------------------*/
function anxiety ( cell )
{
   var img="../images/fork_small.gif";
   var wtloss="<h2 style=\"font: bold 16px Arial, Helvetica, sans-serif; color: #696969; display:inline;\">Hypnosis for Anxiety</h2><br>";
   wtloss += "<p class='HypnoHdr'>As a person learns to manage anxiety through hypnosis, the experience of success with such self-regulation provides or heightens the feeling of being in greater control. Self-esteem can grow as the sense of helplessness fades [...]</p>";
   wtloss += "- Menninger Clinic (1990)";
   cell.innerHTML=wtloss;
}
/*---------------------------------------------------------------------------------------------------*/
function lesspain ( cell )
{
   var wtloss="<h2 style=\"font: bold 16px Arial, Helvetica, sans-serif; color: #696969; display:inline;\">Hypnosis for Pain Management</h2><br>";
   wtloss += "<p class='HypnoHdr'>[...] hypnotic analgesia treatment for chronic pain results in significant reductions in perceived pain that maintain for at least several months, and possibly longer. Such changes in pain are not observed in patients who do not receive hypnosis treatment.</p>"; 
   wtloss += "- Journal of Behavioral Medicine (2006)";
   cell.innerHTML=wtloss;
}
/*---------------------------------------------------------------------------------------------------*/
function stopsmok ( cell )
{
   var wtloss="<h2 style=\"font: bold 16px Arial, Helvetica, sans-serif; color: #696969; display:inline;\">Hypnosis to stop smoking</h2><br>";
   wtloss += "<p class='HypnoHdr'>A new study presented at [...] the American College of Chest Physicians (ACCP), shows that smoking patients who participated in one hypnotherapy session were more likely to be nonsmokers at 6 months compared with patients using nicotine replacement therapy (NRT) alone or patients who quit \"cold turkey\".</p>";
   wtloss += "- American College of Chest Physicians (2007)";
   cell.innerHTML=wtloss;
}
/*---------------------------------------------------------------------------------------------------*/
function wtloss ( cell )
{
   var wtloss="<h2 style=\"font: bold 16px Arial, Helvetica, sans-serif; color: #696969; display:inline;\">Hypnosis for weight loss</h2><br>";
   wtloss += "<p class=HypnoHdr>Over as many as 48 months, hypnotized patients lost more than double the amount of weight that patients lost in a program without a hypnosis component.</p>";
   wtloss += "- Consumer Reports (2004)";
   cell.innerHTML=wtloss;
}
/*---------------------------------------------------------------------------------------------------*/
function ShowPrvw ( PreviewNm )
{
   var cell=document.getElementById('hdr').rows[0].cells[1];
   cell.bgColor="white";
   cell.style.border="medium inset rgb(193, 212, 212)";
   if ( PreviewNm.match(/wtloss/i) ) wtloss( cell );
   if ( PreviewNm.match(/stopsmok/i) ) stopsmok( cell );
   if ( PreviewNm.match(/lesspain/i) ) lesspain( cell );
   if ( PreviewNm.match(/anxiety/i) ) anxiety( cell );
}
/*---------------------------------------------------------------------------------------------------*/
function RestorePic ( )
{
     document.getElementById('hdr').rows[0].cells[1].innerHTML=CurrHdrPic;
     document.getElementById('hdr').rows[0].cells[1].style.borderStyle="none";
}
/*---------------------------------------------------------------------------------------------------*/

