/*-----------------------------------------*
  JavaScript Utilities
**-----------------------------------------*/

//========================================================================
// Short hand version of document.write
//------------------------------------------------------------------------
function dw(dname)
{
  document.write(dname);
}

//========================================================================
// Group Button
//------------------------------------------------------------------------
function grpBtn(bname, sel)
{
  dw("<input class=\"menuBtn\" type=\"button\" value=\""+ bname +"\" onClick=\"selGr("+sel+")\"><br>");
}

//========================================================================
// Menu Button
//------------------------------------------------------------------------
function mBtn(bname, bopen)
{
  dw("<input class=\"menuBtn\" type=\"button\" value=\""+ bname +"\" onClick=\"location.href='"+ bopen +"'\"><br>");
}
function nBtn(bname, bopen)
{
  dw("<input class=\"navBtn\" type=\"button\" value=\""+ bname +"\" onClick=\"location.href='"+ bopen +"'\"><br>");
  dw("<a class='cdw' Target=\"_blank\" href=\""+cLink+"\">"+cLink+"</a><br>");
}

//========================================================================
// Menu Button List
//------------------------------------------------------------------------
function nlBtn(bopen, bname)
{
  dw("<li><a href=\""+bopen+"\" target=\"_blank\">"+bname+"</a></li>");
}
function lBtn(bopen, bname)
{
  dw("<li><a href=\""+bopen+"\" target=\"_top\">"+bname+"</a></li>");
}
function lBtn2(bopen, bname, n2)
{
  dw("<li><a href=\""+bopen+"\" target=\"_top\">"+bname+"<br>"+n2+"</a></li>");
}
function lBtn3(bopen, bname, n2, n3)
{
  dw("<li><a href=\""+bopen+"\" target=\"_top\">"+bname+"<br>"+n2+"<br>"+n3+"</a></li>");
}


function selGr(sel)
{
//  document.getElementById("menugr0").style.display="block";
  document.getElementById("menugr1").style.display="none";
  document.getElementById("menugr2").style.display="none";
  document.getElementById("menugr3").style.display="none";
  document.getElementById("menugr4").style.display="none";
  document.getElementById("menugr5").style.display="none";
  if(sel==1)
    document.getElementById("menugr1").style.display="block";
  else if(sel==2)
    document.getElementById("menugr2").style.display="block";
  else if(sel==3)
    document.getElementById("menugr3").style.display="block";
  else if(sel==4)
    document.getElementById("menugr4").style.display="block";
  else if(sel==5)
    document.getElementById("menugr5").style.display="block";
}

//========================================================================
// Begin Table. Page Header or Banner area (Top of page)
//------------------------------------------------------------------------
function pg_hdr(sel)
{
if(sel==0)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(0)\">");
else if(sel==1)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(1)\">");
else if(sel==2)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(2)\">");
else if(sel==3)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(3)\">");
else if(sel==4)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(4)\">");
else if(sel==5)
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(5)\">");
else
  dw("<body style=\"background-image:url(images/bg_st_side.jpg)\" onload=\"selGr(0)\">");

  dw("<form name=\"quiltFrm\"><table id=\"tblPg\" align=\"center\"><tr>");
  dw("<td id=\"ctrlTable\"><img src=\"images/azlaqtop.gif\" class=\"logo\"></td>");
  dw("<td style=\"background-image:url(images/azlaqbanner.jpg)\"id=\"pgTitle\"> <span>AZLAQ is a chapter of the Arizona Quilters Guild</span></td></tr>");

//-----------------------
//<!--  Menu Buttons  -->
  dw("<tr><td id=\"ctrlTable\" rowspan=2>");
  dw("<div id='td_l'>");

  mBtn("Home", "index.htm");

//----[ Menu Group 1 ]--------------------
  mBtn("AZLAQ", "grp_azlaq.htm");
  dw("<div class=\"adjBtn\" id=\"menugr1\"><ul>");
  lBtn("about.htm", "About AZLAQ ");
  lBtn2("what_is_machine_quilting.htm", "What is","Machine Quilting");
  lBtn("benefits.htm", "Benefits");
  lBtn("membership.htm", "Membership");
  lBtn("board_of_directors.htm", "Board of Directors");
  lBtn("contact.htm", "Contact Us");
  dw("</ul></div>");

//----[ Menu Group 2 ]--------------------
  mBtn("Calendar of Events","grp_calendar.htm");
  dw("<div class=\"adjBtn\" id=\"menugr2\"><ul>");
  lBtn("calendar.htm", "Calendar");
  lBtn("general_mtg.htm", "General Meeting");
  dw("</ul></div>");

//----[ Menu Group 3 ]--------------------
  mBtn("Quilting Services","grp_quilting_services.htm");
  dw("<div class=\"adjBtn\" id=\"menugr3\"><ul>");
  lBtn("top_prep.htm", "Top Preparation");
  lBtn("quilt_back.htm", "Quilt Back");
  lBtn2("locate_quilter.htm", "Locate a Quilter","in your Area");
  dw("</ul></div>");

//----[ Menu Group 4 ]--------------------
  mBtn("Quilts & Shows","grp_quilt_shows.htm");
  dw("<div class=\"adjBtn\" id=\"menugr4\"><ul>");
  lBtn("quilt_show_info.htm", "Quilt Show Information");
  lBtn3("quilt_challenge.htm", "President's Challenge","Quilt Show","Information & Entry");
  lBtn("judging_standards.htm", "Judging Standards");
//  nlBtn("slide_show.htm", "Quilt Slide Show");
  dw("</ul></div>");

//----[ Menu Group 5 ]--------------------
  mBtn("How To & Tips","grp_how_to_tips.htm");
  dw("<div class=\"adjBtn\" id=\"menugr5\"><ul>");
  lBtn3("become_professional_quilter.htm", "Becoming a", "Professional","Longarm Quilter");
  lBtn("how_hire_longarm_quilter.htm", "Hire Longarm Quilter");
  lBtn2("how_hanging_sleeve.htm", "Construct a","Hanging Sleeve");
  dw("</ul></div>");

//----[ Menu Group 6 ]--------------------
  mBtn("Suppliers","grp_suppliers.htm");

//----[ Menu Group 7 ]--------------------
  mBtn("Forms & Documents","grp_forms.htm");
//----------------------------------------
  dw("</td></tr>");

//-----------------------
//<!--  Page Content  -->
  dw("<tr><td rowspan=2><table id=\"conTable\"><tr><td>");
}

//Table part 4 - Ending for Main contents area (Right portion table)
function pg_end()
{
  dw("</td></tr></table></td></tr></table></form></body>");
}

//========================================================================
// Card Functions
//------------------------------------------------------------------------

function quilt_area(hdr)
{
  dw("<h1>"+hdr+"</h1>");
  dw("<table id=\"cenback\" width=100%><tr><td id=\"cenback\">");
//<!-- Select a city for a list of longarm quilters servicing that area -->
  dw("<ul class=\"pg\">");
  menu_link("_nw", "NW");
  menu_link("_ne", "NE");
  menu_link("_sw", "SW");
  menu_link("_se", "SE");
  menu_link("_other", "Other");
  menu_link("", "Map");
  dw("</ul>");
}
function menu_link(mLink,mName)
{
  dw("<li class=\"pg\"><a class=\"city\" href=\"locate_quilter"+mLink+".htm\">"+mName+"</a></li>");
}

function card_no_img()
{
  card_img2("_no_cards.jpg");
  dw("<h2>Sorry, No cards available.</h2>");
  dw("<span><img src='images/arrow.gif' class='arrow'></span><span>2007 President's Challenge - Terri Doyle<br>Best of Show<br>1st Place in Custom<br>Viewer's Choice</span>");
}
function card_img2(cImg)
{
  dw("<tr><td><img src=\"images/card/"+cImg+"\" class=\"cards\"></td><td id='cd'>");
}
function card_img(cImg)
{
  dw("<tr><td><a href='images/card/"+cImg+"' Target=\"_blank\"><img src=\"images/card/"+cImg+"\" class='cards' alt='Click to Enlarge\nOpens a New Window\nClose new window when done'></a></td><td id='cd'>");
//	dw("<a href='"+pic+"'><img src='"+pic+"' width='150' alt='Flight Deck'></a>");

}
function card_www(cLink)
{
  dw("<a class='cdw' Target=\"_blank\" href=\""+cLink+"\">"+cLink+"</a><br>");
}
function card_mail(cMail)
{
  dw("<a class='cdm' href=\"mailto:"+cMail+"?Subject=AZLAQ%20Site%20Message\">Send an E-Mail Message</a><br>");
}
function card_para(cTxt)
{
  dw("<p class='adj'>"+cTxt+"</p>");
}
function card_loc(cCity, cXst, cYst)
{
  dw("<table id=\"tbl_addr\"><tr><td id='td_cr'>");
  dw("City: <br>Cross Streets: <br>&... </td>");
  dw("<td id='td_cl'>"+cCity+"<br>"+cXst+"<br>"+cYst+"</td>");
  dw("</tr></table>");
}

function card_end()
{
  dw("</td></tr>");
  dw("<tr><td colspan=2><hr class='adj'></td></tr>");
}

function cal_year(chdr)
{
  dw("<tr><td colspan=3><div id='title'>"+chdr+"&nbsp;&nbsp;Calendar</div></td></tr>");
//  dw("<tr><td colspan=3><div id='title'>"+chdr+"&nbsp;&nbsp;Calendar&nbsp;&nbsp;of&nbsp;&nbsp;Events</div></td></tr>");
}
function cal_date(cdate)
{
  dw("<tr><td width=20%>"+cdate+"</td>");
}
function cal_event(cevent,ctime)
{
  dw("<td width=30%>"+cevent+"<br>"+ctime+"</td>");
}
function cal_info(cinfo)
{
  dw("<td width=50%>"+cinfo+"</td></tr>");
}
function cal_info2(cinfo)
{
  dw("<td class='padleft' width=70%>"+cinfo+"</td></tr>");
}


function mtg_date(txt){dw("<tr><td id='td_gr'>Date: </td><td id='td_gl'>"+txt+"</td></tr>");}
function mtg_time(txt){dw("<tr><td id='td_gr'>Time: </td><td id='td_gl'>"+txt+"</td></tr>");}
function mtg_loc(txt){dw("<tr><td id='td_gr'>Location: </td><td id='td_gl'>"+txt+"</td></tr>");}

function mtg_agenda(){dw("<tr><td id='td_gr'>Agenda: </td><td id='td_gl'><ul class='ag'>");}
function mtg_ag_bul(txt){dw("<li class='ag'>"+txt+"</li>");}
function mtg_ag_end(){dw("</ul></td></tr>");}

function mtg_dir(txt){dw("<tr><td id='td_gr'>Directions: </td><td id='td_gl'>"+txt+"</td></tr>");}
function mtg_www(who, txt)
{
  dw("<tr><td id='td_gr'></td><td id='td_gl'><a class='cdm' Target=\"_blank\" href=\""+txt+"\">"+who+" Map Directions</a></td></tr>");
}
function mtg_w1()
{
  dw("<tr><td id='td_gr'>Directions: </td><td id='td_gl'>");
}
function mtg_w2(who, txt)
{
  dw("<a class='cdm' Target=\"_blank\" href=\""+txt+"\">"+who+" Map Directions</a>");
}
function mtg_w3()
{
  dw("</td></tr>");
}

function board_name(office, bName, eMail)
{
  dw("<tr><td id='td_bod1'>"+office+"</td>");
  dw("<td id='td_bod2'>"+bName+"</td>");
  dw("<td id='td_bod3'>");
  dw("<a class='cdm' href=\"mailto:"+eMail+"?Subject=AZLAQ%20Site%20Message\">E-Mail:&nbsp;&nbsp;"+bName+"</a>");
  dw("</td></tr>");
}

function contact_name(office, bName, eMail)
{
  dw("<tr><td id='td_con1'>"+office+"</td>");
  dw("<td id='td_con2'>"+bName+"</td>");
  dw("<td id='td_con3'>");
  dw("<a class='cdm' href=\"mailto:"+eMail+"?Subject=AZLAQ%20Site%20Message\">E-Mail:&nbsp&nbsp"+bName+"</a>");
  dw("</td></tr>");
}
function contact_addr(office, bName)
{
  dw("<tr><td id='td_con1'>"+office+"</td>");
  dw("<td id='td_con2' colspan=2>"+bName+"</td></tr>");
}
function contact_line()
{
  dw("<tr><td colspan=3><hr></td></tr>");
}


//<!-- Form new ?? still need ??-->
function open_frm1(docLink, txtTitle, txtMsg)
{
  dw("<hr><table width=100%><tr><td id='td_f1'>");
  dw("<a class='frm' href='"+docLink+"'target='_blank'><img src='images/open.gif' border='0'></a>");
  dw("</td><td id='td_f2'>"+txtTitle+"</td>");
  dw("<td id='td_f3'>"+txtMsg+"</td></tr></table><hr>");
}

//<!-- Form cont ?? still need ??-->
function open_frm2(docLink, txtTitle, txtMsg)
{
  dw("<table width=100%><tr><td id='td_f1'>");
  dw("<a class='frm' href='"+docLink+"'target='_blank'><img src='images/open.gif' border='0'></a>");
  dw("</td><td id='td_f2'>"+txtTitle+"</td>");
  dw("<td id='td_f3'>"+txtMsg+"</td></tr></table><hr>");
}


//<!-- Form new -->
function open_frm_pt1(docLink, txtTitle)
{
  dw("<hr><table width=100%><tr><td id='td_fp2' height='26'><a class='frm' href='form/"+docLink+"'target='_blank'><img src='images/btn_open.gif' border='0'></a>");
  dw("<td id='td_fp1'>"+txtTitle+"</td></tr><tr>");
  dw("</td>");
}

function open_frm_cont(txtMsg)
{
  dw("<td colspan='2' id='td_fp3'>"+txtMsg+"</td></tr></table>");
}
function open_frm_end(txtMsg)
{
  dw("<td colspan='2' id='td_fp3'>"+txtMsg+"</td></tr></table><hr>");
}

//<!-- Form cont -->
function open_frm2(docLink, txtTitle, txtMsg)
{
  dw("<table width=100%><tr><td id='td_f1'>");
  dw("<a class='frm' href='"+docLink+"'target='_blank'><img src='images/open.gif' border='0'></a>");
  dw("</td><td id='td_f2'>"+txtTitle+"</td>");
  dw("<td id='td_f3'>"+txtMsg+"</td></tr></table><hr>");
}

//-----------[ Support ]------------
function supmenu()
{
  dw("<h6>The following list of vendors, manufacturers, suppliers, distributors, organizations, authors, etc. are provided as a service to our membership. Their listing on this web site does not constitute an endorsement or recommendation. To add your favorite vendor, etc. to this list, e-mail the <a class='normal' href='mailto:webmaster@azlongarmquilters.com' target='_blank'>AZLAQ Webmaster</a>.</h6><br>");
  dw("<table width='100%'><tr><td class='menu_w'>");
  dw("<table class='nav' width='100%'><tr><td class='menu'>");
  menu_supplier("batting","Batting");
  menu_supplier("fabric","Fabric");
  menu_supplier("fabric_wide","Fabric - Wide");
  menu_supplier("thread","Thread");
  menu_supplier("general","General Supplies");
  menu_supp_sp();
  menu_supplier("patterns","Patterns");
  menu_supplier("stencils","Stencils");
  menu_supplier("templates","Templates");
  menu_supp_sp();
  menu_supplier("books","Books");
  menu_supplier("magazines","Magazines");
  menu_supplier("videos","Videos");
  menu_supp_sp();
  menu_supplier("distributors","Distributors");
  menu_supplier("manufacturers","Machine Manufacturers");
  menu_supp_sp();
  menu_supplier("classes","Classes");
  menu_supplier("organizations","Organizations");
  menu_supplier("websites","Websites / Chat Rooms");
  menu_supplier("miscellaneous","Miscellaneous");
  dw("</td></tr></table>");
  dw("</td><td class='mbdy'>");
}

function supmend()
{
  dw("</td></tr></table>");
}

function menu_supplier(mLink,mName)
{
  dw("<a class='menu2' href=\"supp_"+mLink+".htm\">"+mName+"</a>");
}
function menu_supp_sp()
{
  dw("<div class='smsp'>&nbsp;</div>");
}

function menu_tst_2(mLink,mName)
{
  dw("<li class=\"pg\"><a class=\"city\" href=\"locate_quilter"+mLink+".htm\">"+mName+"</a></li>");
}
function open_s_hdr()
{
  dw("<div class='note'>Note: All of the below will open a new window.</div>");
  dw("<table class='mbdy' width=100%>");
}
function open_sup(btn, docLink, txtMsg)
{
  dw("<tr><td id='suppbtn'>");
	if(btn=="none")
		dw("<img src=\"images/btn_"+btn+".gif\" border='0'>");
	else
	{
		dw("<a class='btns' href='"+docLink+"'target='_blank'>");
		dw("<img src=\"images/btn_"+btn+".gif\" border='0'></a>");
	}
  dw("</td>");
  dw("<td id='td_supptxt'>"+txtMsg+"</td></tr>");
}
function open_s_end()
{
  dw("</table>");
}
function open_none()
{
  dw("<br><h6><u>Note:</u> Button with Arrows indicates Web or E-Mail is NOT known (button is disabled).</h6>");
}

function book_tbl()
{
  dw("<table class='bklst'>");
}
function book_end()
{
  dw("</table>");
}
function book_hdr(bName,bBy)
{
  dw("<tr><td class='bklst_hdr'>"+bName+"</td>");
  dw("<td class='bklst_hdr'>"+bBy+"</td></tr>");
}
function book_item(bName,bBy)
{
  dw("<tr><td class='bklst'>"+bName+"</td>");
  dw("<td class='bklst'>"+bBy+"</td></tr>");
}

//========== EOF ==========
