// ----------------------------------------
// Page headings
// Creates a self-contained table  (opens and closes here).
// If path2use=1, the call is from the cgi-bin directory
// If path2use=2, the call is from the jam directory (the inside home page)
// If path2use=3, the call is from the root directory (the outside home page)
//   so adjust the pathway to the graphics files.  (For most pages the path2use parameter
//   will be undefined, because it was added much later.)
// ----------------------------------------

function pageTop(gifname, alttext, path2use) {

	if (!path2use) {
		path = "../gfx/"
	} else if (path2use == 1) {
		path="../jam/gfx/"	
	} else if (path2use == 2) {
		path="gfx/"
	} else if (path2use == 3) {
            path="jam/gfx/"
      }

  document.write("<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=\"100%\" BACKGROUND=\"" + path + "blue_black_top.gif\">")
  document.write("<TR><TD VALIGN=MIDDLE><IMG src=\"" + path + "blue_black_top_nostripe.gif\" width=29 height=100>")
  document.write("<A HREF=\"http://www.jingles.com\"><IMG src=\"" + path + "jam_corner_logo_anim.gif\" width=102 height=100 border=0 alt=\"JAM logo\"></A>")
  document.write("<IMG src=\"" + path + "blue_black_top_nostripe.gif\" width=29 height=100></TD>")
	if (gifname != 'none') {
  document.write("<TD align=center><IMG src=\"" + path + "page_" + gifname + ".gif\" width=500 height=100 alt=\"" + alttext + "\"></TD>")
	} else {
  document.write("<TD align=center><IMG src=\"" + path + "shim.gif\" width=500 height=100></TD>")
	  }
  document.write("</TR></TABLE>")
}

// ----------------------------------------
// Page footers
// 
// If 'bodycolor' parameter is passed, that color is used in the main page content filler column instead of white.
// If 'bodycolor' = "nofill" then the filler row is skipped.
// If 'bodycolor' = "nomenu" then the filler row is skipped, and the stripe and text span the entire
//  screen centered. This means there's no master table open when this is called.
// If path2use=1, the call is from the cgi-bin directory
// If path2use=2, the call is from the jam directory (the inside home page)
// If path2use=3, the call is from the root directory (the outside home page)
//   so adjust the pathway to the graphics files.  (For most pages the path2use parameter
//   will be undefined, because it was added much later.)
// ----------------------------------------

function pageBottom(bodycolor, path2use) {

	if (!path2use) {
		path = "../gfx/"
	} else if (path2use == 1) {
		path="../jam/gfx/"	
	} else if (path2use == 2) {
		path="gfx/"
	} else if (path2use == 3) {
            path="jam/gfx/"
	}

  if (bodycolor != 'nomenu') {
    if (bodycolor != 'nofill') {
      document.write("<TR><TD bgcolor=\"#000000\"><img src=\"" + path + "shim.gif\" width=160 height=26</TD>")
      if (bodycolor) {
        document.write("<TD bgcolor=\"" + bodycolor + "\">")
      }
      else {
        document.write("<TD bgcolor=\"#ffffff\">")
      }
    document.write ("<img src=\"" + path + "shim.gif\" width=\"100%\" height=26</TD></TR>")
    }

    document.write("<TR BGCOLOR=\"#000000\"><TD width=160><img src=\"" + path + "shim.gif\" width=160 height=14></td>")
    document.write("<TD><img src=\"" + path + "bottom_stripe.gif\" width=\"100%\" height=14></td></TR>")
    document.write("<TR BGCOLOR=\"#000000\" VALIGN=\"middle\"><TD width=160><img src=\"" + path + "shim.gif\" width=160 height=24></td>")
  }
  else {
    document.write("<TABLE BGCOLOR=\"#000000\" CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=\"100%\">")
    document.write("<TR><TD COLSPAN=2><img src=\"" + path + "bottom_stripe.gif\" width=\"100%\" height=14></td></TR>")
    document.write("<TR VALIGN=\"middle\"><TD width=1><img src=\"" + path + "shim.gif\" width=1 height=24></td>")
  }

  document.write("<TD><DIV CLASS=\"footer\">&copy; JAM Creative Productions, Inc.&nbsp;&middot;&nbsp;5454 Parkdale Drive&nbsp;&middot;&nbsp;Dallas, TX 75227&nbsp;&middot;&nbsp;(214) 388-5454&nbsp;&middot;&nbsp;www.jingles.com</DIV></TD></TR>")
  document.write("</TABLE>")
}


// ----------------------------------------
// Mouse-overs
// ----------------------------------------

function hiLite(imgName,imgObjName) {
	if (document.images) {
	document.images[imgName].src = eval(imgObjName + ".src");
	}}

// ----------------------------------------
// Open new window - no scrollbars, no resize
// ----------------------------------------

function openWin(url,name,w,h) {
      var att = "WIDTH="+ w +",HEIGHT="+ h +",TOOLBAR=NO,SCROLLBARS=NO,MENU=NO,STATUS=NO,RESIZABLE=NO,TOP=50,LEFT=200"
      extrawindow = window.open(url,name,att);
      extrawindow.focus()
      }

// ----------------------------------------
// Open new window - scrollbars and resize
// ----------------------------------------

function openWinSB(url,name,w,h) {
      var att = "WIDTH="+ w +",HEIGHT="+ h +",TOOLBAR=NO,SCROLLBARS=YES,MENU=NO,STATUS=NO,RESIZABLE=YES,TOP=50,LEFT=200"
      window.open(url,name,att);
      }

// ----------------------------------------
// Open new window - scrollbars and resize
// Sample use: <A HREF="javascript:openInfoWin('http://www.test.com','infoWin')">
// ----------------------------------------

function openInfoWin(url,name) {
	if (screen) {
		w = screen.width
		h = screen.height
		}
	else {
		w = 640
		h = 480
		}
      var att = "WIDTH="+ w +",HEIGHT="+ h +",TOOLBAR=YES,SCROLLBARS=YES,MENU=yes,STATUS=yes,RESIZABLE=YES,TOP=0,LEFT=0"
      extrawindow = window.open(url,name,att);
      extrawindow.focus()
      }

// ----------------------------------------
// Sales Rep Locator
// ----------------------------------------

function findrep(scode, sname)  {
	repname = ["not found","being re-assigned.  Please call JAM",,"TOM PARMA","JON WOLFERT",,,,"TOP FORMAT PRODUCTIONS",
	"CARY BASS",,"STEVE ENGLAND"];
	if (scode == 0)  {
	alert("Sorry, that is not a valid selection.");
	}
	else alert("The JAM sales rep for " + sname + " is " + repname[scode] + ".");
	}

// ----------------------------------------
// Generates code for flash player
// ----------------------------------------

function player(audiofile) {

  document.write("      <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"62\" height=\"28\">")
  document.write("        <param name=\"movie\" value=\"" + audiofile + "\" />")
  document.write("        <param name=\"quality\" value=\"high\" />")
  document.write("        <param name=\"wmode\" value=\"transparent\">")
  document.write("        <embed src=\"" + audiofile + "\" quality=\"high\" type=\"application/x-shockwave-flash\" WMODE=\"transparent\" width=\"62\" height=\"28\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />")
  document.write("      </object>")

}
