function openWin(l,w,h)
{
	url = l;
	winWidth = w;
	winHeight = h;
	scrWidth = screen.availWidth;
	scrHeight = screen.availHeight;
	contwin = window.open(url,"win",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + winWidth + ',height=' + winHeight);
	
	contwin.moveTo((scrWidth/2) - (winWidth/2), (scrHeight/2) - (winHeight/2));
}

function openPop(l,w,h,scr)
{
	url = l;
	winWidth = w;
	winHeight = h;
	scrWidth = screen.availWidth;
	scrHeight = screen.availHeight;
	contwin = window.open(url,"win",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scr+',resizable=no,width=' + winWidth + ',height=' + winHeight);
	
	contwin.moveTo((scrWidth/2) - (winWidth/2), (scrHeight/2) - (winHeight/2));
}

function reloadPage(init) { // netscape resize fix
  if (init==true) with (navigator) {if ((appName=="Netscape")&&((parseInt(appVersion)==4)||(parseInt(appVersion)==6))) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

function copyright() { // automatically updates the copyright
var year="";
mydate = new Date();
myyear= mydate.getFullYear();
year = myyear;
if (year < 2000)
year = year + 1900;
var year = ("&nbsp; &copy; " + year);
document.write(year);
}

// search engine special search
function popct() {
	var subwebs = new Array(
		"intranet", "cs-pa-about", "cs-brand", "cmt-main", "corp-quality",
		"cso-main", "ind-doguide", "cs-adm-facplan", "gbs-main", "gbs-salessupp",
		"cs-hr-main", "cs-hr-benefits", "cs-hr-cardev", "cs-hr-comp", "cs-hr-emplysrv",
		"cs-hr-ergo", "cs-hr-frmsques", "cs-hr-mgrstlbx", "cs-hr-policies", "cs-hr-wellness",
		"is-main", "is-cmndcntr", "is-cmd-support", "is-corplaptop", "is-css",
		"is-biw", "is-educ", "is-eai", "is-edm", "is-security",
		"is-tap-report", "is-gbss", "is-hr", "is-isasd", "is-jag",
		"is-mcs", "is-opsmgmt", "is-practices", "is-prjofspt", "is-qrw",
		"is-voicedata", "ind-main", "ind-infomgmt", "aud-main", "cs-pa-commgovt",
		"law-main", "cmp-procure", "gbs-retire", "cs-spkeasy", "aud-fraud",
		"cs-towerclub", "cs-clc-ums"
	);
	var collections = new Array(
		"2134897570", "825690159", "141107779", "1603607149", "202845912",
		"1946650882", "1596473640", "773224190", "1750102406", "920616536",
		"693010612", "512486872", "1412076466", "1837392757", "881338720",
		"835443106", "1304345423", "1765893512", "221878324", "1334365464",
		"934698738", "2676583", "1997030035", "482103799", "2071792222",
		"1444005572", "448636774", "264115773", "1480030427", "458087269",
		"1889323485", "896374007", "1540693922", "1127929449", "230300350",
		"1705267550", "621065479", "883308215", "954947331", "897744648",
		"1544527471", "72780035", "1613857480", "1236031316", "1731489526",
		"272990729", "1594088853", "2016208211", "597772451", "574279531",
		"106215263", "774524700"
	);

	var arr = document.location.href.split('/');
	var srchOption = document.forms.search.srchOpt;
	var srchOnSite;

	document.forms.search.ct.value = collections[0]; // default to intranet

	for( var i=0; i<srchOption.length; i++ ) {
		if( srchOption[i].checked ) {
			srchOnSite = srchOption[i].value;
		}
	}

	if( srchOnSite == "site" ) {
		for( var i=0; subwebs[i] != null && subwebs[i] != ""; i++ ) {
			if( arr[3] == "dcs" ) {
				document.forms.search.ct.value = "2071792222";
				break;
			}

			if( subwebs[i] == arr[3] ) {
				if( collections[i] != null && collections[i] != "" ) {
					document.forms.search.ct.value = collections[i];
					break;
				}
			}
		}
	}

}

function beenHere()
{
	//set document cookie
	document.cookie="golfpromo=viewed";
}

function checkSession()
{
	if (get_cookie("swliad")!="")
	{
		if (get_cookie("swliad")=="viewed")
		{
			//do nothing
		}
	}
	else if (get_cookie("golfpromo")!="")
	{
		if (get_cookie("golfpromo")=="viewed")
		{
			//do nothing
		}
	}
	else
	{
		beenHere();
	}
}

//Get cookie routine by Shelley Powers 
function get_cookie(Name)
{
	var search = Name + "=";
	var returnvalue = "";
	
	if (document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search)
		// if cookie exists
		if (offset != -1)
		{ 
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset);
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}
