function advance(currentField,nextField,maxlength,evt)
{
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
	if (charCode > 39 && currentField.value.length == maxlength) nextField.focus();
}

function openCountyWindow(theURL,winName,features)
{
	var theWindow;
	theWindow = window.open(theURL,winName,features);
	theWindow.focus();
}

function openClubService()
	{
		window.open('club_service_area.asp','ClubServiceArea','width=380,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
	}

function openWin_global(theURL, tb, loc, dir, st, mb, sb, rs)
{
	var winNoLocation;
	winNoLocation = window.open(theURL,'nolocation','toolbar='+ tb + ',location='+ loc + 
		',directories='+ dir + ',status='+ st + ',menubar='+ mb + ',scrollbars='+ sb + ',resizable='+ rs + '');
	winNoLocation.focus();
}

function openSizedWin_global(theURL, tb, loc, dir, st, mb, sb, rs, left, top, height, width)
{
	var winNoLocation;
	winNoLocation = window.open(theURL,'nolocation','toolbar='+ tb + ',location='+ loc + 
		',directories='+ dir + ',status='+ st + ',menubar='+ mb + ',scrollbars='+ sb + 
		',resizable='+ rs + ',left=' + left + ',top=' + top + ',height=' + height +
		',width=' + width + '');
	winNoLocation.focus();
}
function openSizedWinCentered_global(theURL, tb, loc, dir, st, mb, sb, rs, height, width)
{
	var winNoLocation;
	var left = (screen.availWidth - width) / 2;
	var top = (screen.availHeight - height) / 2;
	openSizedWin_global(theURL, tb, loc, dir, st, mb, sb, rs, left, top, height, width);
}
function showMapNA(id)
{
	var w = screen.width;
	var winwidth;
	var winheight;
	var winurl;

	if (w >= 1000)
		{
			winwidth=886;
			winheight=620;
			winurl = 'http://delivery.vrxstudios.com/destinations/vrxfullviewer.asp?ident=AA1699-' + id;
		}
	else
		{
			winwidth=546;
			winheight=520;
			winurl = 'http://delivery.vrxstudios.com/destinations/vrxmap.asp?ident=AA1699-' + id;
		}


	var win = window.open(winurl,'vrxmap','width=' + winwidth + ',height=' + winheight + ',top=5,left=5,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	eval(win);
}
	
function showMapEurope(mapid)
{
	var w = screen.width;
	var winwidth;
	var winheight;
	var winurl;

	if (w >= 1000)
		{
			winwidth=886;
			winheight=620;
			winurl = 'http://delivery.vrxstudios.com/destinations/vrxfullviewer.asp?ident=AA1699-' + mapid;
		}
	else
		{
			winwidth=546;
			winheight=520;
			winurl = 'http://delivery.vrxstudios.com/destinations/vrxmap.asp?ident=AA1699-' + mapid;
		}


	var win = window.open(winurl,'vrxmap','width=' + winwidth + ',height=' + winheight + ',top=5,left=5,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no');
	win.focus();
}

function showMap(id)
{

	var codestr;
	var swidth;
	swidth = screen.width;
	if (swidth>=800)
		{
			codestr = 'window.open("http://delivery.vrxstudios.com/sponsor/map.asp?ID=' + id + '","TransInfo","height=550,width=696,menubar=no,top=5,scrollbars=no,resizable=no,left=0")';
		}
	else
		{
			//codestr = 'window.open("http://delivery.vrxstudios.com/sponsor/mapthumb.asp?ID=' + id + '","TransInfo","height=550,width=495,menubar=no,top=5,scrollbars=no,resizable=yes,left=0")';
			codestr = 'window.open("http://delivery.vrxstudios.com/sponsor/map.asp?ID=' + id + '","TransInfo","height=550,width=495,menubar=no,top=5,scrollbars=no,resizable=yes,left=0")';
		}
	eval(codestr);
}

function swapImage( itemName, imageName )
{
	document[itemName].src = "/assets/common/images/topnav/" + imageName;
	return true;
}

