//  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 WINDOWS
// ----------------------------------------------------------------------

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,"Subscribe",params);
	POPWIN.focus;
	}
	
function viewPhoto(whichPhoto,x,y) {

  closePopWin(); 	// closes an existing popup window if user opens 
        					// new window before closing existing window
	
	var screenW = x + 42;
	var screenH = y + 42;
	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.writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  POPWIN.document.writeln('<html xmlns="http://www.w3.org/1999/xhtml">');
	POPWIN.document.writeln('<head><title>Victory Nissan / Team Vinci</title></head>');
  POPWIN.document.writeln('<body style="margin: 0; background-color: #EEE; padding: 0;">');
  POPWIN.document.writeln('  <div style="margin: 10px; border: 1px solid #CCC; padding: 10px; background-color: #FFF; text-align: center;">');
  POPWIN.document.writeln('    <a href="javascript:window.close();" title="Click to Close"><img src="' + whichPhoto + '" style="border: 0; width: ' + x + 'px; height: ' + y + 'px;" alt="VNTV Photo (click to close)"></a>');
  POPWIN.document.writeln('  </div>');
  POPWIN.document.writeln('</body>');
  POPWIN.document.writeln('</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());
  }
