//=============================================================
//functions
//=============================================================
function validateLogin(oForm)
{	var bError = false;
	var sLoginCode = oForm.logincode.value.toUpperCase();
	
	if (!validateCharacters(sLoginCode) || sLoginCode == "")
	{	bError = true;
	}
	
	if (bError)
	{	alert("The Login Code is invalid.  Please try again.");
	}
	else
	{	if (validateLoginCode(sLoginCode))
		{
			window.location = "members/members.html";
			//window.open('members/members.html', 'win1','toolbar=no,status=yes,scrollbars=yes,location=yes,resizable=yes,width=800,height=600,');
		}
		else
		{
			alert("The Login Code is invalid.  Please try again.");
		}
	}
}

function validateCharacters(sString)
{	var invalidChars = "'\"[]{}%@#!~`^*$+;:?><()|,\/";
	var nextChar = "-";
	
	for (var i = 0; i < invalidChars.length; i++)
	{	nextChar = invalidChars.charAt(i);
		if (sString.indexOf(nextChar, 0) > -1)
		{ return false;
		}
	}
	
	return true;
}

function validateLoginCode(sLoginCode)
{	
	//if you want an other code then use (sLoginCode == "WELCOME" || sLoginCode == "WHATEVER")
	if (sLoginCode == "MEMBER") 
	{	
		return true;
	}	
	
	return false;
}

//++++++++++++++++
// Popups
//++++++++++++++++


// Opens Pop-Up Window

function openWindow(URL,name,features)
 {
 new_window = window.open(URL,name,features);
 new_window.focus();
 }
 

function popupWin(filename){
	popupWindow = window.open(filename, 'popupWindow', 'left='+leftPos+',top='+topPos+',toolbar=yes,status=yes,scrollbars=yes,location=yes,resizable=yes,menubar=yes,width=900,height=600');
	popupWindow.focus();
	return;
}

	var leftPos = 10;
	var topPos = 10;
	if (screen) {
		leftPos = (screen.width-1200)/2;
		topPos = (screen.height-1200)/2;
	}
//+++++++++++++
// mouseover show picture
//+++++++++++++

function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}

//* slide show *//
<!-- Begin
/* This script creates an array of slides */
NewImg = new Array (
"images/gv_banner_468x60_car.gif",
"images/gv_banner_468x60_lamp.gif",
"images/gv_banner_468x60_mic.gif",
"images/gv_banner_468x60_toaster.gif",
"images/gv_banner_468x60_new-chair.gif",
"images/gv_banner_468x60_phone.gif",
"images/gv_banner_468x60_radio.gif"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 6000;

var lock = false;
var run;
function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
   }
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
   }
}
//  End -->
