//***********************************************************************/
/**
  * Places the copyrightInfo at the bottom of the page.
  **/
function copyrightInfo(LinkAddress, LinkName, LinkImage)
{
        //alert(LinkAddress + LinkName + LinkImage);
  var text = '<P><HR>\n' +
                                                 '<TABLE border=1 bgcolor=#FFFFFF> <TR><TD><FONT FACE="Arial, Helvetica, sans-serif" color="black" SIZE=1>' + linkMaker(LinkAddress, LinkName, LinkImage) +
                                                 '  | <A HREF="../company/privacy_policy.htm" style="color:black">PRIVACY POLICY</A>' +
                                                 '  | <A HREF="../company/contact_us.htm" style="color:black">Contact Us</A>' +
                                                 '  | <a href="../set/coc_page.htm" style="color:black">Certificates of compliance</A> |<BR>' +
             '&copy; 2004 - 2009 Set Enterprises, Inc. All rights reserved<BR>\n' +
                                           '</FONT></td></tr></table>\n';
  document.write(text);
}

//**********************************************************************/
function getForgottenPasswordURL(passOn, email)
{
  url = "../company/user_password_request.htm?";
  secondPart = false;
  if (passOn != null)
  {
    url += "passOn=" + passOn;
    secondPart =true;
  }
  if (email != null)
  {
    if (secondPart)
    {
      url += "&";
    }
    url += "email=" +email;
  }
  document.location = url;
  return true;
}
//***********************************************************************/
/**
  * Loads the Appropriate Index on the side column
  * Can be passed either 
  * SET, FIVECROWNS, QUIDDLER, or COMPANY
  *
  * @param whichIndex The Index to load
  **/
function setIndex(whichIndex)
{
	//alert("Set Index " + whichIndex);
	if (whichIndex == "SET")
  {
  	top.display1.location='../set/setindex.htm';
  }
  else if (whichIndex == "FIVECROWNS")
  {
    top.display1.location='../fivecrowns/fivecrownsindex.htm';
  }
  else if (whichIndex == "QUIDDLER")
  {
    top.display1.location='../quiddler/quiddlerindex.htm';
  }
  else if (whichIndex == "COMPANY")
  {
    top.display1.location='../company/companyindex.htm';
  }
  return true;
}
//***********************************************************************/
/**
  * Loads the Appropriate Index on the side column
  * Can be passed either 
  * SET, FIVECROWNS, QUIDDLER, or COMPANY
  *
  * @param whichIndex The Index to load
  **/
function setIndexColor(color)
{
	if (top.display1 != null)
	{
		top.display1.document.bgColor = color;
	}
  return true;
}
//***********************************************************************/
function linkMaker(LinkAddress, LinkName, LinkImage)
{
	var text = null;
	if (LinkAddress == null)
  {
  	text = "";
  }
  else if (LinkImage == null)
  {
    text = "<A HREF=\"" + LinkAddress + "\">"+ LinkName + "</A><BR>";
  }
  else 
  {
	  var text = "<A HREF=\"" + LinkAddress + "\">"+
	             "<IMG SRC=\"" + LinkImage + "\"></A><BR>";
  }
  return text;
}
//***********************************************************************/
/**
  * Makes the Document Black on White for the propuses of printing.
  **/
function printableVersion()
{
	document.bgColor    = "FFFFFF";
	document.body.style.backgroundImage = 'url(none)';
	document.body.style.backgroundColor  = 'FFFFFF';
	document.body.style.color= '000000';
  document.fgColor    = "000000";
  document.alinkColor = "000000";
  document.linkColor  = "000000";
  document.vlinkColor = "000000";
}

//***********************************************************************/

function showLayers()
{
	alert(document.constructor);
}

//***********************************************************************/

function showImages()
{
  alert("length = " + document.images.length);
  var images = "";
  for (var i = 0; i < document.images.length; i++)
  {
    images += "image[" + i + "] = *" + document.images[i].src + "*<BR>\n";
  }
  document.bgColor="FFFFFF";
  document.fgColor="000000";
  document.write(images);
}

//***********************************************************************/
/**
  * Sets the current document's colors to the Standard Set Document Colors.
  **/
function setColors()
{
  //document.bgColor="FFF0D0";
	setIndexColor("#FFFFCC");
  document.bgColor="#FFFFCC"; //color of the document background
  document.alinkColor="#0000FF"; //active link (after mouse-button down, but before mouse-button up).
  document.fgColor="#000000"; //the color of the document (foreground) text 
  document.vlinkColor="#5F0000"; //color of visited links.
  document.linkColor="#0000FF"; //color of the document hyperlinks
}

//***********************************************************************/
/**
  * Sets the current document's colors to the Standard Quiddler Document Colors.
  **/
function quiddlerColors()
{
  document.bgColor="333366"; //color of the document background
  document.fgColor="DFE333"; //the color of the document (foreground) text 
  document.linkColor="00FF00"; //color of the document hyperlinks
  document.alinkColor="FF0000"; //active link (after mouse-button down, but before mouse-button up).
  document.vlinkColor="FF0000"; //color of visited links.
}

//***********************************************************************/
/**
  *
  * Writes to the document a Standard Table Showing and allowing the download of a file.
  *
  * @param Name Name Of the DownLoad
  * @param Picture An (Optional, send "" for none) icon for the download
  * @param Link The Location of the File
  * @param Size The Size of the File
  * @param Platform The platform and compression of the file.
  * @param Date The Date the file was created
  * @param Description A Description of the file.
  *
  *
  **/
function downloadFileInfo(Name, Picture, Link, Size, Platform, Date, Description)
{
  var PictureText = ((Picture == "") ? "" : ('<IMG SRC="' + Picture + '" ALIGN=ABSMiddle>'));
  var text = 
      '<TABLE BGCOLOR="#FFFFFF" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH=75%>' +
      '  <TR>' +
      '    <TD>' +
      '      <TABLE BORDER="0" COLS="4" CELLSPACING="1" CELLPADDING="3" WIDTH=100%>' +
      '        <TR>' +
      '          <TD BGCOLOR="#663399" WIDTH=25% ROWSPAN="2">' +
      '            <A HREF="' + Link + '">' + PictureText + Name + '</A>' +
      '          </TD>' +
      '          <TD BGCOLOR="#663399" WIDTH=25%>' +
      '            <B> ' + Size + '</B>' +
      '          </TD>' +
      '          <TD BGCOLOR="#663399" WIDTH=25%>' +
      '            <B> ' + Platform + '</B>' +
      '          </TD>' +
      '          <TD BGCOLOR="#663399" WIDTH=25%>' +
      '            <B> ' + Date + '</B>' +
      '          </TD>' +
      '        </TR>' +
      '        <TR>' +
      '          <TD BGCOLOR="#663399" COLSPAN="3">' +
      '            ' + Description + '<BR>' +
      '          </TD>' +
      '        </TR>' +
      '      </TABLE>' +
      '    </TD>' +
      '  </TR>' +
      '</TABLE>' +
      '<P>';
  document.write(text);
}

//***********************************************************************/
/**
  * Loads a catalog page into the frame, if not already there.
  * i.e. catalogLoader(window, "productquiddler.htm");
  * would load productquiddler.htm into the frame if it was not already there.
  *
  * @param place The current location of the current Document
  * @param url The Location of the document to be loaded.
  **/

function catalogLoader(place, url)
{
  setIndexColor("#FFFFCC");
  if (top.Main == place)
  {
    var HTML = '<FRAMESET ROWS="180,*" BORDER=0 FRAMESPACING=0 FRAMEBORDER=0>' +
           '<FRAME SRC="catalogindex.htm" NAME="CatalogIndex" SCROLLING=NO>' + 
           '<FRAME SRC="productset.htm" NAME="ProductDisplay" MARGINWIDTH=0>' +
           '</FRAMESET>' ;
    place.document.write(HTML);
    top.Main.ProductDisplay.location = url;
  }
}
  
//***********************************************************************/
/**
  * Loads the appropriate Nearest Stores page for a given Zip Code, must be 
  * at least 3 digits long.
  *
  * @param zipcode The Zip Code
  * @return false(in case you are calling from a form, this will stop the exacution.)
  **/

function goToStore(zipcode)
{
  if (zipcode.length < 3)
  {
    alert("Must enter at least 3 digits");
    return false;
  }
  zipcode = zipcode.substring(0,3);
  window.location = ('zip'+ zipcode +'.htm');
  //alert(code);
  return false;
}

//***********************************************************************/
//***********************************************************************/
  