// FILE: published.js
// GOAL: To identify current publishing attributes
// WHO:  Bradley Roberts


// Set the following attributes for each edition in turn:
// Update these as appropriate with each publishing of the site
var copyright_year = "2009";
var current_edition = "1";
var as_of_date = "3/31/2009";
var webmaster_name = "Webmaster";
var webmaster_id = "webmaster";
var webmaster_domain = "PSplendor.net";
var ceo_name = "Jim Garvin";
var ceo_id = "JGarvin";

// The following is for count down timing for the next pack event
var next_major_event = "Fri, 18 September 2009 08:00:00 EDT";  // Birthday

// The following functions use the information above to display 
// various items on a page. You should not have to change these.

//////////////////////////////////////////////////////////////////
// FUNCTION: show_copyright()
// GOAL:     To show the copyright notice on a particular page
// EG:       © 2007 Darby Consulting
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              show_copyright();
//              // End --></script>
//////////////////////////////////////////////////////////////////
function show_copyright()
{
    document.write('&copy;&nbsp;' + copyright_year + ' by Photographic Splendor, LLC');
}


//////////////////////////////////////////////////////////////////
// FUNCTION: show_volume()
// GOAL:     To show the volume number on the page
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              show_volume();
//              // End -->
//              </script>
//////////////////////////////////////////////////////////////////
function show_volume()
{
    document.write(copyright_year);
}


//////////////////////////////////////////////////////////////////
// FUNCTION: show_edition()
// GOAL:     To show the edition on the page
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              show_edition();
//              // End --></script>
//////////////////////////////////////////////////////////////////
function show_edition()
{
    document.write(current_edition);
}


//////////////////////////////////////////////////////////////////
// FUNCTION: get_email(subject)
// GOAL:     To generate an eMail link as appropriate. This helps 
//           combat SPAM by encapsulating the actual mailto link.
// EG:       webmaster@PSplendor.net
// USE:      Just call this as follows where needed:
//               <script><!-- Hidden from some browsers
//               get_email("Need Info, Please");
//               // End --></script>
//////////////////////////////////////////////////////////////////
function get_email(subject)
{
    document.write('<a href=\"mailto:' + webmaster_id + '@' + webmaster_domain + '?subject='+subject+ '\">'); 
    document.write('<font face="Arial, Helvetica, sans-serif">' + webmaster_name + '</font></a>');
}


//////////////////////////////////////////////////////////////////
// FUNCTION: link_email(name, subject)
// GOAL:     To generate an eMail link as appropriate. This helps 
//           combat SPAM by encapsulating the actual mailto link.
// EG:       name@PSplendor.net
// USE:      Just call this as follows where needed:
//               <script><!-- Hidden from some browsers
//               link_email("Brad", "Need Info, Please");
//               // End --></script>
//////////////////////////////////////////////////////////////////
function link_email(name, subject)
{
    document.write('<a href=\"mailto:' + webmaster_id + '@' + webmaster_domain + '?subject='+subject+ '\">'); 
    document.write('<font face="Arial, Helvetica, sans-serif">' + name + '</font></a>');
}


//////////////////////////////////////////////////////////////////
// FUNCTION: get_ceo_email(subject)
// GOAL:     To generate an eMail href link as appropriate. This helps 
//           combat SPAM by encapsulating the actual mailto link.
// EG:       ceo_id@PSplendor.net
// USE:      Just call this as follows where needed:
//               <script><!-- Hidden from some browsers
//               get_ceo_email("Need Info, Please");
//               // End --></script>
//////////////////////////////////////////////////////////////////
function get_ceo_email(subject)
{
    document.write('<a href=\"mailto:' + ceo_id + '@' + webmaster_domain + '?subject='+subject+ '\">' + ceo_name + '</a>');
}


//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// FUNCTION: get_link_email(subject, btn)
// GOAL:     To generate an eMail href link as appropriate. This helps 
//           combat SPAM by encapsulating the actual mailto link.
// EG:       ceo_id@PSplendor.net
// USE:      Just call this as follows where needed:
//               <script><!-- Hidden from some browsers
//               get_link_email("Need Info, Please", "event_btn.jpg");
//               // End --></script>
//////////////////////////////////////////////////////////////////
function get_link_email(subject, img)
{
    document.write('<a href=\"mailto:' + ceo_id + '@' + webmaster_domain + '?subject='+subject+ '\">');
	document.write('<img src=\"images/' + img + '\" alt=\"eMail to \"' + ceo_name + '\" width=\"167\" height=\"70\"/>');
	 
}


//////////////////////////////////////////////////////////////////
// FUNCTION: last_update()
// GOAL:     To show the last time this site was updated
// EG:       "Last updated on 08/15/2004. Contact the _Webmaster_
//           with any corrections."
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              last_update();
//              // End --></script>
//////////////////////////////////////////////////////////////////
function last_update()
{
    document.write('Last updated on ' + as_of_date + '. Contact the ');
    document.write('<a href=\"mailto:' + webmaster_id + '@' + webmaster_domain + '?subject=Comments\">'); 
    document.write('Webmaster</a> with any corrections.');
}


//////////////////////////////////////////////////////////////////
// FUNCTION: showSlideWindow(theURL, winName, features)
// GOAL:     To popup a window showing the specific slide in high 
//           resolution mode. This is used to download full images.
// 
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              showSlideWindow(theURL, winName, features);
//              // End --></script>
//////////////////////////////////////////////////////////////////
function showSlideWindow(theURL, winName, features) 
{
    // NOTE: winName must be unique - use 'newWin'+new Date().getTime()
	window.open(theURL, winName, features);
}

//////////////////////////////////////////////////////////////////
// FUNCTION: setNewDeliveryTimeAgain()
// GOAL:     To set the time this site will be delivered
// EG:       "Last updated on 08/15/2004. Contact the _Webmaster_
//           with any corrections."
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              setNewDeliveryTimeAgain();
//              // End --></script>
//////////////////////////////////////////////////////////////////
function setNewDeliveryTimeAgain()
{   // Called by setNewDeliveryTimeAgain
  setDeliveryTime();
}



//////////////////////////////////////////////////////////////////
// FUNCTION: setDeliveryTime()
// GOAL:     To show the time this site will be delivered
// EG:       "Last updated on 08/15/2004. Contact the _Webmaster_
//           with any corrections."
// USE:      Just call this as follows where needed:
//              <script><!-- Hidden from some browsers
//              setDeliveryTime();
//              // End --></script>
//////////////////////////////////////////////////////////////////
function setDeliveryTime()
{
  now = new Date();
  launch = Date.parse("Wed, 09 Nov 2006 13:01:00 EST");
  timeNow = now.getTime();

  if ( (launch - timeNow) >= 0)
  {
	  timeLeft = launch - timeNow;
  }

  else
  {
  	  timeLeft = timeNow - launch;
  }

  days = parseInt(timeLeft / 86400000);
  if (isNaN(days))
  {
	  days = 0;
  }

  timeLeft = parseInt(timeLeft % 86400000);
  hours = parseInt(timeLeft / 3600000);
  timeLeft = parseInt(timeLeft % 3600000);
  mins = parseInt(timeLeft / 60000);
  timeLeft = parseInt(timeLeft % 60000);
  secs = parseInt(timeLeft / 1000);
  d1 = parseInt(days / 10);

  if ( isNaN(d1))
	  d1 = 0;
  d2 = parseInt(days % 10);

  if ( isNaN(d2))
	  d2 = 0;
  h1 = parseInt(hours / 10);

  if ( isNaN(h1))
	  h1 = 0;
  h2 = parseInt(hours % 10);

  if ( isNaN(h2))
	  h2 = 0;
  m1 = parseInt(mins / 10);

  if ( isNaN(m1))
	  m1 = 0;
  m2 = parseInt(mins % 10);

  if ( isNaN(m2))
	  m2 = 0;
  s1 = parseInt(secs / 10);

  if ( isNaN(s1))
	  s1 = 0;
  s2 = parseInt(secs % 10);

  if ( isNaN(s2))
	  s2 = 0;

  document.timeForm.deliveryTime.value="  "+days+" Days "+h1+h2+" hrs "+m1+m2+" mins "+s1+s2+" secs";
  setTimeout("setNewDeliveryTimeAgain()", 950);
  return;
}

// End of functions

