var pageHeight;
var pageName;
var ident;
var icount=0;
var LoginStatus;
var userName;
var showCookiesSwitch=false;
var viewportwidth;
var viewportheight;
baseURL="http://www.essentialHolistics.com/";
var copywrite="Copyright © 2008-2012 Rita Davies Wild Essential Holistics";
var rule="0123456789012345678901234567890123456789012345678901234567890123456789"
//-----------------------Location Directions---------------------------
//Manorville
mc_directions="http://maps.yahoo.com/py/maps.py?Pyt=Tmap&addr=1 Marilyn Street&csz=Manorville, NY 11949&Get+Map=Get+Map";
//Om Sweet Om - Port Washington

//TRS NY

//-----------------------Product Types----------------------------------
//Crystals
document.write('<form name="prod1" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Crystals"/>');
document.write('</form>');

//Crystal Jewelry
document.write('<form name="prod2" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Crystal Jewelry"/>');
document.write('</form>');

//Silver Jewelry
document.write('<form name="prod3" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Silver Jewelry"/>');
document.write('</form>');

//Chakra Jewelry
document.write('<form name="prod4" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Chakra Jewelry"/>');
document.write('</form>');

//Gold Jewelry
document.write('<form name="prod5" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Gold Jewelry"/>');
document.write('</form>');

//Yoga Supplies
document.write('<form name="prod6" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Yoga Supplies"/>');
document.write('</form>');

//Books & Cd
document.write('<form name="prod7" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Books & Cds"/>');
document.write('</form>');

//Meditation Supplies
document.write('<form name="prod8" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Meditation Supplies"/>');
document.write('</form>');

//Aroma Therapy
document.write('<form name="prod9" method="post" action="http://www.essentialholistics.com/productInterface.pl">');
document.write('<input type="hidden" name="productType" value="Aroma Therapy"/>');
document.write('</form>');

//--------------------------------Functions------------------------------------
//Define Page Height
function setPageHeight(ph){
	pageHeight=ph;
        //getViewPort();
}
function clearAccountName(){
    eraseAccountName();
    eraseLoginStatus();
//    ident=window.setTimeout("showStatus();",1000);
}
function submitEdit(){
  //alert(userName);
  document.write('<form name="editForm" action="http://www.essentialholistics.com/accountInfo.pl" method="post">');
  document.write('<input type="hidden" name="cmd" value="editProfile" />');
  document.write('<input type="hidden" name="userName" value="'+userName+'" />');
  document.write('</form>');
  document.editForm.submit();
}

function submitNew(){
  document.write('<form  name="newForm" action="http://www.essentialholistics.com/accountInfo.pl" method="post">');
  document.write('<input type="hidden" name="cmd" value="register" /></form>');
  document.newForm.submit();
}

function showStatus(){
   return 0;
//Get Account Name
   AccountName=readAccountName();
   //get Login Status
   LoginStatus=readLoginStatus();
   LogOutWarning=readCookie("LogoutWarning");
   if (LoginStatus == "Logged In" && LogOutWarning == ""){
     var msg="Logout Warning - Click Cancel to continue. Click OK to Logout";
     var confirmed = window.confirm(msg);
     if (confirmed){
         logout();
     }else
     {
         writeLoginStatus("Logged In");
     }
   }
   userName=readUserName();
   line0='<table style="border:0px black solid;">';

   if(LoginStatus=="Logged In"){
      //logged in - show account name
      line1='<td style="color:purple;">Welcome '+AccountName+'</td>';
      line2='<td><a href="#" style="color:purple;" onclick="logout();">[Log Out]</a></td>';
   }else{
      //not logged in
      if(AccountName){
         //show known account name
         line1='<td style="color:purple;">Hello '+AccountName+'</td>';
         line2='<td><a href="signIn.html" target="_self" style="color:purple;">[Please Sign In]</a></td>';
         line2+='<td><a href="#" style="color:purple;" onclick="clearAccountName();">[Not '+AccountName+'?]</a></td>';
      }else{
         //no account name - request sign in or regististration
         line1='<td></td>';
         line2='<td><a href="signIn.html" style="color:purple;" target="_self">Please Sign In</a></td>';
      }
   }
   line3='</table>';
   divId=document.getElementById("signin");
   if(divId && pageName != 'Member Profile' && pageName != 'Sign In'){
        divId.innerHTML=line0+line1+line2+line3;
        divId.style.textAlign='center';
   }

   //diagnostics switch
   if(showCookiesSwitch)showCookies();
   ident=window.setTimeout("showStatus();",1000);
}
function logout(){
     eraseLoginStatus();
     location.reload(true);
//     ident=window.setTimeout("showStatus();",1000);
}

function buildHeader(pn){
pageName=pn;

//..............................Header......................................
document.write(' <div id="topArea" style="position:absolute;top:0px;left:0px;width:100%;height:150px;"> ');

//..............................Company Name.................................
document.write('<div style="color:purple;text-align:center;position:absolute;left:15%;width:70%;top:10px">');
document.write('<i><h2 style="text-align:center;">Rita Davies Wild</h2>');
document.write('</i></div>');


document.write('<div style="color:purple;text-align:center;position:absolute;left:15%;width:70%;top:30px;">');
document.write('<i><h5 style="text-align:center;">Essential Holistics</h5>');
document.write('</i></div>');

//..............................Page Title.................................
	document.write('<div style="color:purple;text-align:center;position:absolute;left:15%;width:70%;top:45px;font-size:120%;"><h2 style="text-align:center;"><i>'+pageName+'</i></h2></div>');

/*
//....................Constant Contact Newsletter...........................
document.write('<div id="constantContact" style="position:absolute;left:40%;width:45%;top:125px;">');
//<!-- BEGIN: Constant Contact Text Link Email List Button -->
document.write('<div align="center">');
document.write('<table width="200" border="0" cellpadding="0" cellspacing="0">');
document.write('<tr><td nowrap><div style="margin-right:3px;margin-top:2px; background-color:#810081;">');
document.write('<a href="http://visitor.r20.constantcontact.com/d.jsp?llr=d6sfi5cab&p=oi&m=1102674316195"  target="_blank">');
document.write('<img src="https://imgssl.constantcontact.com/ui/images1/visitor/email5_trans.gif" border="0"></a></div></td>');
document.write('<td nowrap width="100%"><a href="http://visitor.r20.constantcontact.com/d.jsp?llr=d6sfi5cab&p=oi&m=1102674316195"  target="_blank" style="font-family:Verdana; font-size:13px; color:#810081;">Sign up for our Email Newsletter</a></td></tr></table></div>');
//<!-- END: Constant Contact Text Link Email List Button -->
document.write('</div>');
*/
//................................Sign In..................................
document.write('<div id="signIn" style="position:absolute;left:25%;width:50%;top:120px;font-size:65%;text-align:center;"></div>');

//...............................Logos......................................
//EH Logo.....
document.write('<div id="logo" style="position:absolute;left:15%;top:15px;">');
document.write('<a href="http://www.essentialholistics.com/index.html" title="Essential Holistics" target="_self">');
//document.write('<img src="http://www.essentialholistics.com/images/essential-label.gif" width="188" height="101" border="0" alt="Home"/></a>');
document.write('<img src="/images/essential-label-2.gif" width="150" height="97" border="0" alt="Home"/></a>');
document.write('</div>');

//facebook badge
//document.write('<div style="position:absolute;top:200px;left:10%;">');
//document.write('');
//document.write('</div>');

//YLO Logo.....
document.write('<div id="yl" style="position:absolute;top:30px;left:65%;">');
document.write('<a href="https://www2.youngliving.com/signup/custType.faces?sponsorid=456915&enrollerid=456915" target="_blank">');
h=30;ar=39/222;w=h/ar;
document.write('<img src="images/yl_logo_color.png" width="222" height="39" border="0" alt=""></a>');
document.write('</div>');

/*Holistic Practioners Logo.....
document.write('<div id="hpnet" style="position:absolute;top:80px;left:75%;">');
document.write('<a href="http://www.holisticpractitioner.net" title="As Seen On Holistic Practitioner .net" target="_blank">');
document.write('<img src="http://www.holisticpractitioner.net/images/holistic_practitioners.gif" style="border: 0px;" alt="Holistic Practitioners" />');
document.write('</a>');
document.write('</div>');
*/

//....................Manorville Center Location...........................
//document.write('<div id="mc" style="color:purple;position:absolute;top:115px;left:5%;font-size:75%;" >');
//document.write('<a href="' + mc_directions + '" target="_blank">Manorville Center</a></div>');
//document.write('</div>');
}

function buildMenu(){
    var line=new Array();
//..............................Menus......................................
//Menu Start
    ln=-1;
    line[++ln]= '<div  id="menuDiv">';
    line[++ln]='<table style="position:absolute;left:15%;width:70%">';

//Home....
    line[++ln]='<td><ul class="sddm"><li><a href="index.html">Home</a></li></ul></td>';

//Modalities(My Services)....
    line[++ln]= '<td></td><td><ul class="sddm">';
    line[++ln]= '<li><a href="http://www.essentialholistics.com/#"; onmouseover="mopen2()" onmouseout="mclosetime()">Modalities</a>';
    line[++ln]= '<div id="m2" style="z-index:30" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
    line[++ln]= '<a href="newReiki.html">Reiki</a>';
    line[++ln]= '<a href="newBreath.html">Full-Wave® Breath</a>';
    line[++ln]= '<a href="newChakra.html">Chakra</a>';
    line[++ln]= '<a href="newRaindrop.html">Raindrop® Technique</a>';
    line[++ln]= '<a href="newMeditation.html">Meditation</a>';
    line[++ln]= '<a href="newMelkezidek.html">Order of Melchizedek</a>';
    line[++ln]= '<a href="newAscension.html">Ascension</a>';
    line[++ln]='</div></li></ul></td>';

//My Work....
    line[++ln]='<td></td><td><ul class="sddm">';
    line[++ln]= '<li><a href="http://www.essentialholistics.com/#" onmouseover="mopen3()" onmouseout="mclosetime()">My Work</a>';
    line[++ln]= '<div id="m3" style="z-index:30" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
    line[++ln]='<a href="newEventCalendar.html">Events</a>';
    line[++ln]='<a href="newPrivateSessions.html">Private Sessions</a>';
    line[++ln]='<a href="newWorkShops.html">Workshops</a>';
    line[++ln]='<a href="newAttunements.html">Classes & Attunements</a>';
    line[++ln]='</div></li></ul></td>';


//Members
//    line[++ln]='<td><ul class="sddm">';
//    line[++ln]=
'<li><a href="#" onmouseover="mopen4()" onmouseout="mclosetime()">Members</a>';
//    line[++ln]=
'<div id="m4" style="z-index:30" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';

   //get Login Status
//       LoginStatus=readLoginStatus();
       //alert(LoginStatus);
//    if(LoginStatus == "Logged In"){
//        line[++ln]='<a href="javascript: submitEdit();">Update Profile</a>';
//        line[++ln]='<a href="javascript: logout();">Log Out</a>';
//    }else{
 //       line[++ln]=
 //        '<a href="http://www.essentialholistics.com/signIn.html">Sign In</a>';
//    }
 //   line[++ln]='</div></li></ul></td>';

//Shopping....
    //line[++ln]='<td><ul class="sddm">';
    //line[++ln]='<li><a onmouseover="mopen7()" onmouseout="mclosetime()" href="newShopping.html">Books & Tools</a>';
    //line[++ln]='<div id="m7" style="z-index:30" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
    //line[++ln]='<a href="javascript:document.prod9.submit();">Aroma Therapy</a>';
    //line[++ln]='<a href="javascript:document.prod1.submit();">Crystals</a>';
    //line[++ln]='<a href="javascript:document.prod2.submit();">Crystal Jewely</a>';
    //line[++ln]='<a href="javascript:document.prod3.submit();">Silver Jewelry</a>';
    //line[++ln]='<a href="javascript:document.prod4.submit();">Chakra Jewelry</a>';
    //line[++ln]='<a href="javascript:document.prod5.submit();">Gold Jewelry</a>';
    //line[++ln]='<a href="javascript:document.prod6.submit();">Yoga Supplies</a>';
    //line[++ln]='<a href="javascript:document.prod7.submit();">Books & CDs</a>';
    //line[++ln]='<a href="javascript:document.prod8.submit();">Meditation Supplies</a>';
   // line[++ln]='</div></li></ul></td>';
    
//About Me....
    line[++ln]='<td></td><td><ul class="sddm">';
    line[++ln]=' <li><a href="http://www.essentialholistics.com/#" onmouseover="mopen6()" onmouseout="mclosetime()">About Me</a>';
    line[++ln]=' <div id="m6" style="z-index:30" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">';
    //line[++ln]=' <a href="newMissionStatement.html">Mission Statement</a>';
    line[++ln]=' <a href="newContactMe.html">Contact Me</a>';
    line[++ln]=' <a href="newAssociates.html">Associates</a>';
    line[++ln]=' <a href="newTestamonials.html">Testamonials</a>';
    //line[++ln]=' <a href="newSiteMap.html">Site Map</a>';
    line[++ln]=' </div></li></ul></td>';


//menu end.....
    line[++ln]= ' </table></div>';
    k=line.length-1;
    var menuCode="";
    for (var i=0;i<=k;i++){menuCode+=line[i]};
    document.write(menuCode);
}
//..............................Body Div - must end code with </div>......
function setBody(){
document.write('<div id="bodyArea" style="position:absolute;top:180px;left:15%;width:70%;">');
}

//..............................Right Border..............................
function buildRightBorder(){
document.write('<div id="rightBorder" style="border:solid 0px black;position:absolute;top:0px;left:90%;width:15%;height:'+ pageHeight +'px;background:#e0d7d4;"></div>');
}

//...............................Left Border..............................
function buildLeftBorder(){
if (showCookiesSwitch){return 0;}
document.write('<div id="leftBorder" style="border:solid 0px black;position:absolute;top:0px;left:0px;width:10%;height:'+ pageHeight +'px;background:#e0d7d4;z-index: 30"></div>');
}

//...............................Bottom Border............................
function buildBottomBorder(){
var t = pageHeight - 100;
document.write('<div id="bottomBorder" style="position:absolute;top:'+ t +'px;left:0px;width:100%;height:150px;background:#e0d7d4;">');

var line=new Array();
var ln=-1;
document.write('<table id="bb" name="bb" style="position:relative;  left:10%;top:10px;width:80%;" >');

line[++ln]='<td><a href="newAscension.html">Ascension</a></td><td> | </td>';

line[++ln]='<td><a href="newAssociates.html">Associates</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod7.submit();">Books & CDs</a></td><td> | </td>';

line[++ln]='<td><a href="newContactMe.html">Contact Me</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod4.submit();">Chakra Jewelry</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod1.submit();">Crystals</a> </td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod2.submit();">Crystal Jewely</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod9.submit();">Essential Oils</a></td><td> | </td>';

line[++ln]='<td><a href="newEventCalendar.html">Events</a></td><td> | </td>';

line[++ln]='<td><a href="newBreath.html">Full-Wave® Breath</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod5.submit();">Gold Jewelry</a></td><td> | </td>';

line[++ln]='<td><a href="index.html">Home</a></td><td> | </td>';

line[++ln]='<td><a href="newMeditation.html">Meditation</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod8.submit();">Meditation Supplies</a></td><td> | </td>';

line[++ln]='<td><a href="newMelkezidek.html">Order of Melchizedek</a></td> <td> | </td>';

line[++ln]='<td><a href="newPrivateSessions.html">Private Sessions</a></td><td> | </td>';

line[++ln]='<td><a href="newReiki.html">Reiki</a></td><td> | </td>';

line[++ln]='<td><a href="newRaindrop.html">Raindrop® Technique</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod3.submit();">Silver Jewely</a></td><td> | </td>';

line[++ln]=' <td><a href="newTestamonials.html">Testamonials</a></td><td> | </td>';

line[++ln]='<td><a href="newWorkShops.html">Workshops</a></td><td> | </td>';

//line[++ln]='<td><a href="javascript:document.prod6.submit();">Yoga Supplies</a></td><td> | </td>';

line[++ln]='</table>';
for (var i=0;i<=ln;i++){
    document.write(line[i]);
    if(i==8){document.write('<tr>');}
    if(i==17){document.write('</tr><tr>');}
   if(i==ln){document.write('</tr>');}
}

document.write('<p align="center" style="font-size:60%;">'+copywrite+'</p>');

document.write('</div>');
if(showCookiesSwitch)listCookies();
//ident=window.setTimeout("showStatus();",1000);
showStatus();
}

//................................ Vertical Line .........................
function drawVerticalLine(Left,Top,Height,Width){
	document.write(' <div style="position:absolute;background:purple;left:' + Left + ';top:'+ Top + ';height:' + Height + ';width:' + Width + ';">');
	document.write(' </div>');
}

//............................... Viewport ...............................
function getViewPort(){
     //alert("getViewPort");
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
     if (typeof window.innerWidth != 'undefined')
     {
          viewportwidth = window.innerWidth;
          viewportheight = window.innerHeight;
     }
 
     // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

     else if (typeof document.documentElement != 'undefined' 
           && typeof document.documentElement.clientWidth != 'undefined'
           && document.documentElement.clientWidth != 0)
     {
           viewportwidth = document.documentElement.clientWidth;
           viewportheight = document.documentElement.clientHeight;
     }
 
     // older versions of IE
 
     else
     {
           viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
           viewportheight = document.getElementsByTagName('body')[0].clientHeight;
     }
     //var id = document.getElementById('viewport');
     //id.innerHTML='<p>Your viewport size is ' + viewportwidth + 'x' + viewportheight+' Menu Length='+viewportwidth+'</p>';
}

