function relanchor(href,aid,aclass,astyle,text,atitle,basedir)
{
  document.write('<a href="'+basedir+href+'" id="'+aid+'" class="'+aclass );
  document.writeln('" style="'+astyle+'" alt="'+atitle+'" title="'+atitle+'" >'+text );
}

function relimage(src,aid,aclass,astyle,atitle,basedir)
{
  document.write('<img src="'+basedir+src+'" id="'+aid+'" class="'+aclass );
  document.writeln('" style="'+astyle+'" alt="'+atitle+'" title="'+atitle+'" />' );
}


function banner(bannergif)
{
	document.writeln('<table id="head">' );
	document.writeln('  <tr>' );
	document.writeln('    <td>' );
	document.writeln('      <a href="'+mypath+'.htm">' );
	document.writeln('        <img border="0" src="logo0.gif" alt="B2B leads logo" />' );
	document.writeln('      </a>' );
	document.writeln('    </td>' );
	document.writeln('    <td>' );
	document.writeln('        <img src="'+mypath+'images/'+bannergif+'" alt="B2B leads banner" />' );
	document.writeln('    </td>' );
	document.writeln('  </tr>' );
	document.writeln('</table>' );
}//end banner()


function welcomenameform()
{
  document.writeln("<form name='nameform' id='welcome'>" );
  document.writeln("  <span id='hellotxt'>" );
  document.writeln("    <script type='text/javascript'>" );
  document.writeln("      updatewelcome();" );
  document.writeln("    </script>" );
  document.writeln("  </span>" );
  document.writeln("  <br/>" );
  document.writeln("  <span id='label'>Name </span>" );
  document.writeln("  <input id=\"input\" name=\"guest\" type=\"text\" size=\"12\" value=\"\" " +
                   "onkeydown=\"if(event.keyCode==13)setaCookie(this.value)\" />" );
  //document.writeln("<br/><br/><input type='button' value='show cookie' onclick='updatewelcome()' />" );
  document.writeln("</form>" );
  updatewelcome();
}//end welcomenameform()


function getacookie()
{
  //alert("getacookie: "+ document.cookie);
  var mycookie = "guest=";
  var loc1, loc2;
  var myname = "";
  if(document.cookie.length > 0 )
  {
    str = document.cookie;
    loc1 = document.cookie.indexOf(mycookie);
    if( loc1 >=0 )
    {
      loc1 = loc1 + mycookie.length; //add length of "guest="
      loc2 = document.cookie.indexOf(";", loc1 );
      if( loc2 < 0 ) loc2 = document.cookie.length;
      myname = unescape(document.cookie.substring(loc1, loc2));
    }
  }
  //alert("getacookie: guest="+myname);
  return myname;
}//end getacookie()

function updatewelcome()
{
  //alert("updatewelcome: cookie="+ document.cookie);
  var myname = getacookie();
  myname = (myname.length > 1) ? ("Welcome " + myname + "!") : "Welcome!";
  document.getElementById("hellotxt").innerHTML = myname;
  //alert("updatewelcome: myname="+myname);
}//end updatewelcome()

function setaCookie()
{
  var myname = document.nameform.guest.value;
  //alert("setaCookie: guest="+myname);
  var expireDate = new Date();
  if( myname.length > 0 )
  {
    if( myname == "delete") {
      myname = "";
      expireDate.setDate(expireDate.getDate()-1);
      document.cookie = "guest="   + null +
                        ";expires=" + expireDate.toGMTString() +
                        "; path=/";  //domain=e-commerce.pvc.maricopa.edu";
    }
    else {
      expireDate.setMonth(expireDate.getMonth()+1); //30 day expiration
      document.cookie = "guest="   + escape(myname) +
                        ";expires=" + expireDate.toGMTString() +
                        "; path=/";  //domain=e-commerce.pvc.maricopa.edu;
      //alert(expireDate.toGMTString());
      //      + "; path=/;domain=e-commerce.pvc.maricopa.edu";
    }
  }
  updatewelcome();
}//end setaCookie()


function navigation_big(basedir)
{
//Navigation Drop-Down Menu 
  /* document.writeln('<h3 align="center">test</h3>'); */
  /* .teal   {color:#066; } */
  /* .aqua   {color:#9ff; } */

    document.writeln('<table id="nav">');                                                                            
    document.writeln(' <tr>');                                                                                       
    document.writeln('  <td cellpadding="7">');                                                                      
    document.writeln('   <div id="topmenu0" class="center">');                                                       
    document.writeln('   <a class="prime" href="'+basedir+'final.html">Home</a><br/></div>');                                   
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td onmouseover=\"showmenu('products')\" onmouseout=\"hidemenu('products')\" cellpadding=\"5\">"); 
    document.writeln('   <div id="topmenu1" class="center"> ');                                                      
    document.writeln('   <a class="prime center" href="'+basedir+'product/products.html">Products</a><br/></div>');                     
    document.writeln('   <table class="menu" id="products" width="150">');                                           
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'products/classes/classes.html" >Beginner Classes</a></td></tr>');      
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'products/favorites.html"       >Favorites</a></td></tr>');      
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'products/catalog.html"         >Full Catalog</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'articles/articles.html"        >Free Articles</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'products/free.html"            >Free Lessons</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'products/songs.html"           >Songs</a></td></tr>');    
    document.writeln('   </table>');                                                                                 
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td onmouseover=\"showmenu('services')\" onmouseout=\"hidemenu('services')\" cellpadding=\"5\">"); 
    document.writeln('   <div id="topmenu2" class="center">');                                                       
    document.writeln('   <a class="prime center" href="'+basedir+'services/services.html">Services</a><br/></div>');                       
    document.writeln('   <table class="menu" id="services" width="200">');                                           
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'services/presentations.html" >Presentation Scheduling</a></td></tr>');      
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'services/seminars.html"      >Seminar Scheduling</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'services/calendar.html"      >Current Calendar</a></td></tr>');    
    document.writeln('   </table>');                                                                                 
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td onmouseover=\"showmenu('storyteller')\" onmouseout=\"hidemenu('storyteller')\" cellpadding=\"5\">"); 
    document.writeln('   <div id="topmenu2" class="center">');                                                       
    document.writeln('   <a class="prime center" href="'+basedir+'storyteller/storyteller.html">Storytelling</a><br/></div>');                       
    document.writeln('   <table class="menu" id="storyteller" width="150">');                                           
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'storyteller/power-of-story.html"  >Power of Story</a></td></tr>');      
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'storyteller/props.html"           >Prop Usage</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'storyteller/learning-styles.html" >Styles of Learning</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'storyteller/video.html"           >Video</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'storyteller/visuals.html"         >Visuals</a></td></tr>');    
    document.writeln('   </table>');                                                                                 
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td onmouseover=\"showmenu('about')\" onmouseout=\"hidemenu('about')\" cellpadding=\"5\">");
    document.writeln('   <div id="topmenu3" class="center">');                                                       
    document.writeln('   <a class="prime center" href="'+basedir+'about/about.html">About</a><br/></div>');                          
    document.writeln('   <table class="menu" id="about" width="150">');                                           
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/bibles.html"       >Bibles Used</a></td></tr>');    
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/company.html"      >Company History</a></td></tr>');      
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/feedback.html"     >Feedback</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/kurt-marley.html"  >Kurt Marley Bio</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/links.html"        >Links</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/sitemap.html"      >Site Map</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/testamonials.html" >Testamonials</a></td></tr>');          
    document.writeln('   <tr><td class="menu"><a href="'+basedir+'about/prayer.html"       >Website Prayer</a></td></tr>');          
    document.writeln('   </table>');                                                                                 
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td cellpadding=\"5\">");   
    document.writeln('   <div id="topmenu4" class="center">');                                                       
    document.writeln('   <a class="prime center" href="'+basedir+'about/contact.html">Contact</a><br/></div>');                        
    document.writeln('  </td>');                                                                                     
    document.writeln("  <td cellpadding=\"5\">");   
    document.writeln('   <div id="topmenu5" class="search">');                                                       
    document.writeln('   <a class="prime center" href="'+basedir+'jssearch.html">Search</a><br/></div>');                        
    document.writeln('  </td>');                                                                                     
    document.writeln(' ');
/*  */
    document.writeln(' </tr>');
    document.writeln('</table>');
}

function showmenu(elmnt) { document.getElementById(elmnt).style.visibility="visible"; }

function hidemenu(elmnt) { document.getElementById(elmnt).style.visibility="hidden"; }


function navigation(apath)
{
//Navigation Menu 
	document.writeln('<table width="70%" cellpadding="7"> ');
	document.writeln('<tr> ');
	document.writeln('  <td> ');
	document.writeln('    <a href="'+apath+'index.htm" ' );
	document.writeln('        onmouseover="newgif(\'navhome\',\'homebluebtn.gif\')" ');
	document.writeln('         onmouseout="newgif(\'navhome\',\'homegreenbtn.gif\')" >');
	document.writeln('      <img border="0" id="navhome" src="'+apath+'images/homegreenbtn.gif" alt="home" /> ' );
	document.writeln('    </a>');
	document.writeln('  </td>');
	document.writeln('  <td> ');
	document.writeln('    <a href="'+apath+'services.htm" ' );
	document.writeln('        onmouseover="newgif(\'navservices\',\'servicesbluebtn.gif\')" ');
	document.writeln('         onmouseout="newgif(\'navservices\',\'servicesgreenbtn.gif\')" >');
	document.writeln('      <img border="0" id="navservices" src="'+apath+'images/servicesgreenbtn.gif" alt="services" /> ' );
	document.writeln('    </a>');
	document.writeln('  </td>');
	document.writeln('  <td> ');
	document.writeln('    <a href="'+apath+'survey.htm" ' );
	document.writeln('        onmouseover="newgif(\'navsurvey\',\'surveybluebtn.gif\')" ');
	document.writeln('         onmouseout="newgif(\'navsurvey\',\'surveygreenbtn.gif\')" >');
	document.writeln('      <img border="0" id="navsurvey" src="'+mypath+'images/surveygreenbtn.gif" alt="survey" /> ' );
	document.writeln('    </a>');
	document.writeln('  </td>');
	document.writeln('  <td> ');
	document.writeln('    <a href="'+apath+'contact.htm" ' );
	document.writeln('        onmouseover="newgif(\'navcontact\',\'contactbluebtn.gif\')" ');
	document.writeln('         onmouseout="newgif(\'navcontact\',\'contactgreenbtn.gif\')" >');
	document.writeln('      <img border="0" id="navcontact" src="'+apath+'images/contactgreenbtn.gif" alt="contact" /> ' );
	document.writeln('    </a>');
	document.writeln('  </td>');
	document.writeln('  <td> ');
	document.writeln('    <a href="'+apath+'about.htm" ' );
	document.writeln('        onmouseover="newgif(\'navabout\',\'aboutbluebtn.gif\')" ');
	document.writeln('         onmouseout="newgif(\'navabout\',\'aboutgreenbtn.gif\')" >');
	document.writeln('      <img border="0" id="navabout" src="'+apath+'images/aboutgreenbtn.gif" alt="about" /> ' );
	document.writeln('    </a>');
	document.writeln('  </td>');
	document.writeln(' </tr>');
	document.writeln('</table>');
}

function newgif(elment,newgif){
	//alert(elment+"  "+newgif);
	document.getElementById(elment).src = mypath+"images/"+newgif;
}


function footer(which) 
{
	document.writeln("<div id=\"footer"+which+"\">");
	document.writeln("<br/><br/>");
	document.writeln("<hr class='b2bgreen' width='75%' align='left' size='2'>  <!-- page footer -->");
	document.writeln("<span style='font-size:9pt;'>");
	document.write("Copyright &copy;2008-2010 by Phoenix B2B Leads LLC.&nbsp; ");
	document.writeln("Contact <a id='mail' href='javascript:mymailto()'>Webmaster</a> for changes or comments.<br/>");
	//document.writeln("Contact <a id='mail' href='mailto:marleyk@aol.com'>Webmaster</a> for changes or comments.<br/>");
	var lastmod = document.lastModified;         // get string of last modified date
	var lastmoddate = Date.parse(lastmod);       // convert modified string to date
	if(lastmoddate == 0) document.writeln("<b>updated</b>: unknown");// unknown date (or january 1, 1970 gmt)
	else                 document.write("<b>updated</b>: " + lastmod +". ");
	   var docurl = document.URL;           // get string of url filename
	   //document.writeln("&nbsp; " + docurl );
	if(which==3)
	{
			document.writeln("<br/>extra footing#1");
	}
	if(which==4)
	{
			document.writeln("<br/>extra footing#2");
	}
	document.writeln("</span>");
	document.writeln("</div>");
}

function mymailto(){  //hides webmaster email address from the internet
	var emailAddr = 'Cathy_at_phxb2bleads_dot__calm_';
	emailAddr = emailAddr.replace("_at_","@");
	emailAddr = emailAddr.replace("_dot_",".");
	emailAddr = emailAddr.replace("_calm_","com");
	window.location="mailto:"+emailAddr;
}

