function myitinerary_hide()
{
  document.getElementById("myitinerary").style.display="none";
}
function myitinerary_show()
{
  var xmlhttp=false;
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) {
   try {
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (E) { 
    xmlhttp = false; 
   } 
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); 
  }
  xmlhttp.open("GET", "functions.inc.php?myitinerary_show=1",true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
		var response = xmlhttp.responseText;
		document.getElementById('myitinerarymain').innerHTML=response;
                document.getElementById("myitinerary").style.display="";
	}
        }
  xmlhttp.send(null);
}
function myitinerary_insertmember(id)
{
  var xmlhttp=false;
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) {
   try { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (E) { 
    xmlhttp = false; 
   } 
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); 
  }
  xmlhttp.open("GET", "functions.inc.php?myitinerary_insertmember=1&id="+id,true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
		var response = xmlhttp.responseText;
                myitinerary_show();
	}
        }
  xmlhttp.send(null);
  
}
function myitinerary_updatenotes()
{
  var notes=document.getElementById('myitinerary_notes').value;
  var xmlhttp=false;
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) {
   try { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (E) { 
    xmlhttp = false; 
   } 
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); 
  }
  xmlhttp.open("GET", "functions.inc.php?myitinerary_updatenotes=1&notes="+escape(notes),true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
		var response = xmlhttp.responseText;
	}
        }
  xmlhttp.send(null);
}
function myitinerary_removemember(id)
{
  var xmlhttp=false;
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) {
   try { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
   } catch (E) { 
    xmlhttp = false; 
   } 
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); 
  }
  xmlhttp.open("GET", "functions.inc.php?myitinerary_removemember=1&id="+id,true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
		var response = xmlhttp.responseText;
                myitinerary_show();
	}
        }
  xmlhttp.send(null);
  
}
function myitinerary_autoadd()
{
  var id=document.getElementById("myitinerary_template").value;
  var xmlhttp=false;
  try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
  } catch (e) {
   try { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
   } catch (E) { 
    xmlhttp = false; 
   } 
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest(); 
  }
  if(id==0)
  {
    document.getElementById('myitinerary_notes').value="";
  }
  else if(id==1)
  {
    document.getElementById('myitinerary_notes').value="Play in Frankenmuth\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Take a hands-on tour of Zeilinger Wool Company\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Take a Fantasy horse-drawn carriage tour**\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Play 18 holes of mini golf at Jellystone Park or the Bavarian Inn Lodge\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Play 18 holes of professional golf at The Fortress\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Go fly at kite at the Frankenmuth Toy Company/Kite Kraft\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="View the German glockenspiel at the Bavarian Inn Restaurant**\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Have fun at Frankenmuth River Place and do the following:\n\r";
    document.getElementById('myitinerary_notes').value+="	-Cruise on the Bavarian Belle Riverboat* **\n\r";
    document.getElementById('myitinerary_notes').value+="	-Get lost in the Ultimate Mirror Maze\n\r";
    document.getElementById('myitinerary_notes').value+="	-Scare yourself at the Midnight Manor haunted house\n\r";
    document.getElementById('myitinerary_notes').value+="	-Win prizes at the River Place Game Room\n";
    document.getElementById('myitinerary_notes').value+="	-View the Lights Fantastic laser light show**\n";
    document.getElementById('myitinerary_notes').value+="	-Dress up and have an old-time photo taken at Michigan Memories\n\n\r";
    document.getElementById('myitinerary_notes').value+="Play paintball at Frankenmuth Hobby Center\n\n\r";
    document.getElementById('myitinerary_notes').value+="Splash in the fountain at the Frankenmuth Visitor Center\n\n\r";
    document.getElementById('myitinerary_notes').value+="Enjoy outdoor entertainment at Fischer Platz behind the Bavarian Inn Restaurant*\n\n\r";
    document.getElementById('myitinerary_notes').value+="Dance the night away at a Frankenmuth Festival* **\n\n\r";
    document.getElementById('myitinerary_notes').value+="*Seasonal Item  |  **Times Vary\n\n\r";
  }
  else if(id==2)
  {
    document.getElementById('myitinerary_notes').value="Historical Frankenmuth.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Take a Frankenmuth city tour with a personal guide.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Take a Fantasy horse-drawn carriage tour. **\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Extend your tour of St. Lorenz Lutheran Church and its \n\rmuseum and log cabin.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Watch The World of Bronner's DVD presentation at \n\rBronner's CHRISTmas Wonderland.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Tour the Frankenmuth Historical Museum.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Visit Grandpa Tiny's Farm and tour the early 1900's farmstead and \n\r1850's one-room schoolhouse.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Visit the woodcarvers at the Eagle's Nest Woodcarving Cottage.* **\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Learn of Frankenmuth's beer brewing history and take a tour of the \n\rBlack Forest Brau Keller.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Cruise aboard the Bavarian Belle riverboat and learn of \n\rFrankenmuth's logging history.* **\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Tour Michigan's Own Military and Space Museum.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Enjoy a world-famous, family-style chicken dinner at \n\rZehnder's Restaurant or the Bavarian Inn Restaurant.\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="Walk across the Holzbrucke (wooden covered bridge).\n\r\n\r";
    document.getElementById('myitinerary_notes').value+="*Seasonal Item  |  **Times Vary\n\r";
  }
  else if(id==3)
  {
    document.getElementById('myitinerary_notes').value="A Taste of Frankenmuth\n\n";
    document.getElementById('myitinerary_notes').value+="Learn to roll and twist a pretzel at the Bavarian Inn Restaurant\n\n";
    document.getElementById('myitinerary_notes').value+="Learn of Frankenmuth's beer brewing history and take a tour of the \nBlack Forest Brau Keller\n\n";
    document.getElementById('myitinerary_notes').value+="Get to the meat of things by stuffing sausage at Willi's Sausage Company\n\n";
    document.getElementById('myitinerary_notes').value+="Do some downtown Frankenmuth shopping  and make sure to visit the \nFrankenmuth  Taffy Kitchen, Jaami's Jams & Jellies, Zak's Candy Haus and the Frankenmuth Fudge Kitchen\n\n";
    document.getElementById('myitinerary_notes').value+="Eat a Christmas cookie at Bronner's CHRISTmas Wonderland's \nSeason's Eatings snack area\n\n";
    document.getElementById('myitinerary_notes').value+="Let your ears do the tasting when over 100 cuckoo clocks chime at \nthe Frankenmuth Clock Company\n\n";
    document.getElementById('myitinerary_notes').value+="Enjoy a locally made, hand-rolled Fat Rum Tavern Cigar from the \nFrankenmuth Original Cigar Company\n\n";
    document.getElementById('myitinerary_notes').value+="Sample from among 100 types of cheese at the Frankenmuth Cheese Haus\n\n";
    document.getElementById('myitinerary_notes').value+="Sample over 40 different flavors of popcorn at \nThe Popcorn Wagon in River Place\n\n";
    document.getElementById('myitinerary_notes').value+="Take a tour and enjoy a sampling of wines and sparkling juices at \nSt. Julian Wine Company or Chateau de Leelanau Winery\n\n";
    document.getElementById('myitinerary_notes').value+="Enjoy a world-famous, family-style chicken dinner at Zehnder's Restaurant\n\n";
    document.getElementById('myitinerary_notes').value+="Enjoy a traditional German meal at the Bavarian Inn Restaurant\n\n";
  }
  else if(id==4)
  {
    document.getElementById('myitinerary_notes').value="Christmas in Frankenmuth\n\n";
    document.getElementById('myitinerary_notes').value+="Go shopping at Bronner's CHRISTmas Wonderland and also do the following:\n";
    document.getElementById('myitinerary_notes').value+="    -Lunch in the Season's Eatings snack area\n";
    document.getElementById('myitinerary_notes').value+="    -Play in the west entrance snowfall* **\n";
    document.getElementById('myitinerary_notes').value+="    -Visit the Silent Night Memorial Chapel\n\n";
    document.getElementById('myitinerary_notes').value+="Attend the Holiday Celebration & Candlewalk*\n\n";
    document.getElementById('myitinerary_notes').value+="Attend the Frankenmuth Christkindlmarkt* **\n\n";
    document.getElementById('myitinerary_notes').value+="Attend a Bavarian Inn Holiday Dinner Show* **\n\n";
    document.getElementById('myitinerary_notes').value+="Attend the Living Nativity at Immanuel Lutheran Church in Frankentrost* **\n\n";
    document.getElementById('myitinerary_notes').value+="Attend a Christmas choir concert at a local church* **\n\n";
    document.getElementById('myitinerary_notes').value+="Do your holiday shopping in downtown Frankenmuth.\n\n";
    document.getElementById('myitinerary_notes').value+="Enjoy a Fantasy horse-drawn carriage tour complete with sleigh bells **\n\n";
    document.getElementById('myitinerary_notes').value+="Feast on a holiday dinner at Zehnder's Restaurant or the \nBavarian Inn Restaurant\n\n";
    document.getElementById('myitinerary_notes').value+="Take a Frankenmuth holiday light tour*\n\n";
  }
  //myitinerary_updatenotes();
  var notes=document.getElementById('myitinerary_notes').value;
  xmlhttp.open("GET", "functions.inc.php?myitinerary_autoadd=1&id="+id+"&notes="+escape(notes),true);
  xmlhttp.onreadystatechange = function() {
	if(xmlhttp.readyState == 4){
		var response = xmlhttp.responseText;
                myitinerary_show();
	}
        }
  xmlhttp.send(null);

  
}
function myitinerary_email()
{
  var generator=window.open('','name','height=650,width=992,resizable=no,scrollbars=yes,menubar=yes');
  var tmp=document.getElementById('myitinerarymain').innerHTML;
  tmp=replaceAll(tmp,'<IMG src="http://new.frankenmuth.org/images/justcancel.png" border=0>',"");
  tmp=tmp.replace("<CENTER><FONT size=3><B>Notes</B>","<table align=center><tr><td><FONT size=3><B>Notes</B>");
  tmp=tmp.replace("<TEXTAREA id=myitinerary_notes name=myitinerary_notes rows=5 cols=80>","<tt><pre>");
  tmp=tmp.replace("</TEXTAREA></center>","</tt></pre></td></tr></table>");
  tmp=tmp.replace('<BR><INPUT onclick=javascript:myitinerary_updatenotes(); type=button value="Update Notes"></INPUT>',"");
  generator.document.writeln('<html><head><title>Frankenmuth, Michigan - My Itinerary</title>');
  generator.document.writeln('</head><body>');
  generator.document.writeln('<Center><b>Email To:</b> <input type=text size=23 id="myiemail" name="myiemail"></input>  <input onClick="javascript:myi_email_send();" type=button value="Email Itinerary"></input>  <div id="myiemailmessage" name="myiemailmessage"></div></center>');
  generator.document.writeln('<div id="myi_body" name="myi_body">');
  generator.document.write(tmp);
  generator.document.writeln('</div>');
  generator.document.writeln('<script language=javascript>');
  generator.document.writeln('window.onload= function(){');
  generator.document.writeln('        DisableEnableLinks(true);');
  generator.document.writeln('}');

  generator.document.writeln('function DisableEnableLinks(xHow){');
  generator.document.writeln('  objLinks = document.links;');
  generator.document.writeln('  for(i=0;i<objLinks.length;i++){');
  generator.document.writeln('    objLinks[i].disabled = xHow;');
  generator.document.writeln('    //link with onclick');
  generator.document.writeln('    if(objLinks[i].onclick && xHow){');
  generator.document.writeln('        objLinks[i].onclick = new Function("return false;" + objLinks[i].onclick.toString().getFuncBody());');
  generator.document.writeln('    }');
  generator.document.writeln('    //link without onclick ');
  generator.document.writeln('    else if(xHow){  ');
  generator.document.writeln('      objLinks[i].onclick = function(){return false;} ');
  generator.document.writeln('    }                                            ');
  generator.document.writeln('    //remove return false with link without onclick  ');
  generator.document.writeln('    else if(!xHow && objLinks[i].onclick.toString().indexOf("function(){return false;}") != -1){   ');
  generator.document.writeln('      objLinks[i].onclick = null;    ');
  generator.document.writeln('    }    ');
  generator.document.writeln('    //remove return false link with onclick   ');
  generator.document.writeln('    else if(!xHow && objLinks[i].onclick.toString().indexOf("return false;") != -1){  ');
  generator.document.writeln('      strClick = objLinks[i].onclick.toString().getFuncBody().replace("return false;","")  ');
  generator.document.writeln('      objLinks[i].onclick = new Function(strClick);  ');
  generator.document.writeln('    }           ');
  generator.document.writeln('  }             ');
  generator.document.writeln('}         ');
  generator.document.writeln('function myi_email_send() ');
  generator.document.writeln('{                         ');
  generator.document.writeln('  var mailto=document.getElementById("myiemail").value;   ');
  generator.document.writeln('  var mailfrom="no-reply@frankenmuth.org";                     ');
  generator.document.writeln('  var mailsubject="Frankenmuth Intinerary";                    ');
  generator.document.writeln('  var mailbody=document.getElementById("myi_body").innerHTML;  ');
  generator.document.writeln('  var xmlhttp=false;                                            ');
  generator.document.writeln('  try {                                                         ');
  generator.document.writeln('  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");                ');
  generator.document.writeln(' } catch (e) {                                                  ');
  generator.document.writeln('  try {                                                         ');
  generator.document.writeln('    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");           ');
  generator.document.writeln('   } catch (E) {                                                ');
  generator.document.writeln('    xmlhttp = false;                                             ');
  generator.document.writeln('   }                                                             ');
  generator.document.writeln('  }                                                              ');

  generator.document.writeln('  if (!xmlhttp && typeof XMLHttpRequest!="undefined") {          ');
  generator.document.writeln('    xmlhttp = new XMLHttpRequest();                                 ');
  generator.document.writeln('  }                                                                  ');
  generator.document.writeln('  mailbody=encodeURI(mailbody);                                        ');
  generator.document.writeln('  url="http://new.frankenmuth.org/functions.inc.php?email=1&mailTo="+mailto+"&mailFrom="+mailfrom+"&mailSubject="+mailsubject; ');
  generator.document.writeln('  xmlhttp.open("POST", url, true);                                                                   ');
  generator.document.writeln('  xmlhttp.onreadystatechange = function() {                                                         ');
  generator.document.writeln('	if(xmlhttp.readyState == 4){                                                                      ');
  generator.document.writeln('                document.getElementById("myiemail").value="";                                 ');
  generator.document.writeln('                document.getElementById("myiemailmessage").innerHTML=xmlhttp.responseText;}}      ');
  generator.document.writeln('  xmlhttp.send(null);}                                                                             ');
  generator.document.writeln('  </script> ');
  generator.document.writeln('<script language=javascript>');
  generator.document.writeln('document.getElementById("myiemail").focus();');
  generator.document.writeln('  </script> ');
  generator.document.writeln('</body></html>');
  generator.document.close();
}


function myitinerary_print()
{
  var generator=window.open('','name','height=650,width=992,resizable=no,scrollbars=yes,menubar=yes');
  var tmp=document.getElementById('myitinerarymain').innerHTML;
  tmp=replaceAll(tmp,'<IMG src="http://new.frankenmuth.org/images/justcancel.png" border=0>',"");
  tmp=tmp.replace("<CENTER><FONT size=3><B>Notes</B>","<table align=center><tr><td><FONT size=3><B>Notes</B>");
  tmp=tmp.replace("<TEXTAREA id=myitinerary_notes name=myitinerary_notes rows=5 cols=80>","<tt><pre>");
  tmp=tmp.replace("</TEXTAREA></center>","</tt></pre></td></tr></table>");
  tmp=tmp.replace('<BR><INPUT onclick=javascript:myitinerary_updatenotes(); type=button value="Update Notes"></INPUT>',"");
  generator.document.writeln('<html><head><title>Frankenmuth, Michigan - My Itinerary</title>');
  generator.document.writeln('</head><body>');
  //generator.document.writeln('<Center><b>Email To:</b> <input type=text size=23 id="myi_email" name="myi_email"></input>  <input onClick="javascript:myi_email_send();" type=button value="Email Itinerary"></input>  <div id="myi_emailmessage" name="myi_emailmessage"></div></center>');
  generator.document.writeln('<div id="myi_body" name="myi_body"><center><h1>Frankenmuth Itinerary</h1></center>');
  generator.document.write(tmp);
  generator.document.writeln('</div>');
  generator.document.writeln('<script language=javascript>');
  generator.document.writeln('window.onload= function(){');
  generator.document.writeln('        DisableEnableLinks(true);');
  generator.document.writeln('        window.print();');
  generator.document.writeln('}');

  generator.document.writeln('function DisableEnableLinks(xHow){');
  generator.document.writeln('  objLinks = document.links;');
  generator.document.writeln('  for(i=0;i<objLinks.length;i++){');
  generator.document.writeln('    objLinks[i].disabled = xHow;');
  generator.document.writeln('    //link with onclick');
  generator.document.writeln('    if(objLinks[i].onclick && xHow){');
  generator.document.writeln('        objLinks[i].onclick = new Function("return false;" + objLinks[i].onclick.toString().getFuncBody());');
  generator.document.writeln('    }');
  generator.document.writeln('    //link without onclick ');
  generator.document.writeln('    else if(xHow){  ');
  generator.document.writeln('      objLinks[i].onclick = function(){return false;} ');
  generator.document.writeln('    }                                            ');
  generator.document.writeln('    //remove return false with link without onclick  ');
  generator.document.writeln('    else if(!xHow && objLinks[i].onclick.toString().indexOf("function(){return false;}") != -1){   ');
  generator.document.writeln('      objLinks[i].onclick = null;    ');
  generator.document.writeln('    }    ');
  generator.document.writeln('    //remove return false link with onclick   ');
  generator.document.writeln('    else if(!xHow && objLinks[i].onclick.toString().indexOf("return false;") != -1){  ');
  generator.document.writeln('      strClick = objLinks[i].onclick.toString().getFuncBody().replace("return false;","")  ');
  generator.document.writeln('      objLinks[i].onclick = new Function(strClick);  ');
  generator.document.writeln('    }           ');
  generator.document.writeln('  }             ');
  generator.document.writeln('}         ');
  generator.document.writeln('function myi_email_send() ');
  generator.document.writeln('{                         ');
  generator.document.writeln('  var mailto=document.getElementById("myi_email").value;   ');
  generator.document.writeln('  var mailfrom="no-reply@frankenmuth.org";                     ');
  generator.document.writeln('  var mailsubject="Frankenmuth Intinerary";                    ');
  generator.document.writeln('  var mailbody=document.getElementById("myi_body").innerHTML;  ');
  generator.document.writeln('  var xmlhttp=false;                                            ');
  generator.document.writeln('  try {                                                         ');
  generator.document.writeln('  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");                ');
  generator.document.writeln(' } catch (e) {                                                  ');
  generator.document.writeln('  try {                                                         ');
  generator.document.writeln('    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");           ');
  generator.document.writeln('   } catch (E) {                                                ');
  generator.document.writeln('    xmlhttp = false;                                             ');
  generator.document.writeln('   }                                                             ');
  generator.document.writeln('  }                                                              ');

  generator.document.writeln('  if (!xmlhttp && typeof XMLHttpRequest!="undefined") {          ');
  generator.document.writeln('    xmlhttp = new XMLHttpRequest();                                 ');
  generator.document.writeln('  }                                                                  ');
  generator.document.writeln('  mailbody=encodeURI(mailbody);                                        ');
  generator.document.writeln('  url="http://new.frankenmuth.org/functions.inc.php?email=1&mailTo="+mailto+"&mailBody="+mailbody+"&mailFrom="+mailfrom+"&mailSubject="+mailsubject; ');
  generator.document.writeln('  xmlhttp.open("GET", url, true);                                                                   ');
  generator.document.writeln('  xmlhttp.onreadystatechange = function() {                                                         ');
  generator.document.writeln('	if(xmlhttp.readyState == 4){                                                                      ');
  generator.document.writeln('                document.getElementById("myi_email").value="";                                 ');
  generator.document.writeln('                document.getElementById("myi_emailmessage").innerHTML=xmlhttp.responseText;}}      ');
  generator.document.writeln('  xmlhttp.send(null);}                                                                             ');
  generator.document.writeln('</script>                                                                                       ');

  generator.document.write('</body></html>');
  generator.document.close();
}

