//  Team Vinci Softball | common.js
//  Kevin Scholl        | kscholl@comcast.net
//  Last Update         | 06 Feb 2005

// ------------------------------------------------//
// GLOBAL VARIABLE(S)
// ------------------------------------------------//

var CURR_SUBNAV = '';

// ----------------------------------------------------------------------
// SET CURRENT NAV STATE
// ----------------------------------------------------------------------

function setCurrNav(whichNav) {
	var newClass = "hm curr";
	var currNav = document.getElementById(whichNav);
	currNav.className = newClass;
	}

// ----------------------------------------------------------------------
// DISPLAY POPUP WINDOW
// ----------------------------------------------------------------------

var popWin = null;

function newWindow(loc,x,y) {

  closePopWin();	// closes an existing popup window if user opens 
                	// new window before closing existing window
	
	var screenW = x + 20;
	var screenH = y + 20;
	var params  = "width=" + screenW + ",height=" + screenH + ",status=yes,toolbar=no,directories=no,scrollbars=yes,resizable=yes,menubar=no,location=no,top=50,left=50,screeny=50,screenx=50"

	popWin = window.open(loc,"VNTV",params);
	popWin.focus;
	}
	
// ----------------------------------------------------------------------
// DISPLAY LARGE PHOTO
// ----------------------------------------------------------------------

var thePhoto = null;

function viewPhoto(whichPhoto,x,y) {

  closePopWin(); 	// closes an existing popup window if user opens 
        					// new window before closing existing window
	
	var screenW = x + 50;
	var screenH = y + 50;
	var params  = "width=" + screenW + ",height=" + screenH + ",status=yes,toolbar=no,directories=no,scrollbars=no,resizable=yes,menubar=no,location=no,top=50,left=50,screeny=50,screenx=50"

	popWin = window.open("","VNTV",params);

  popWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  popWin.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
	popWin.document.write('<head><title>Team Vinci Photo Gallery</title></head>');
  popWin.document.write('<body style="background-color: #F8F8F8;">');
  popWin.document.write('<div style="border: 1px solid #CCC; padding: 10px; background-color: #FFF; text-align: center;">');
  popWin.document.write('<a href="javascript:window.close();"><img src="' + whichPhoto + '" style="border: 0; width: ' + x + ' height: ' + y + ';" alt="Click to Close" title="Click to Close"></a>');
  popWin.document.write('</div>');
  popWin.document.write('</body>');
  popWin.document.write('</html>');
	
	popWin.document.close();
  }

// ----------------------------------------------------------------------
// CLOSE EXISTING CHILD WINDOW
// ----------------------------------------------------------------------

function closePopWin() {
  if ((popWin != null) && (popWin.closed != true))
  	popWin.close();
	}

// ----------------------------------------------------------------------
// WRITE CURRENT DATE
// ----------------------------------------------------------------------

function writeDate() {

  var now      = new Date;
  var modDay   = new Array ("sunday","monday","tuesday","wednesday","thursday","friday","saturday");
  var modMonth = new Array ("january","february","march","april","may","june","july","august","september","october","november","december");
	
  document.write(modDay[now.getDay()] + ", " + now.getDate() + " " + modMonth[now.getMonth()] + " " + now.getFullYear());
  }
