
	// Created 01/29/2010    BSimmons  QSR 241608; Copied largely from '/js/small_business/surveypopup.js'
	
	//---- Put your custom settings here--------
	var CookiesName = 'START_Survey'; //name to store cookie
	var surveyurl = 'https://s-t5mbb-232511.sgizmo.com'; //survey URL
	var infoURL = 'http://www.usbank.com/cgi_w/cfm/about/privacy/privacy_pledge.cfm'; // Privacy pledge URL
	var windowoptions = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=670,height=415';
	
	// You can choose one of the two options below (put appropriate var value in):
	var popupHTML = '<html><head><title>Survey Invite</title></head><body><table cellpadding="0" cellspacing="0" border="0" width="100%">';
	popupHTML += '<tr><td align="center"><img src="/images/global/usbank_logo.gif" border="0" alt="U.S. Bank" title="U.S. Bank"></td></tr>';
	popupHTML += '<tr><td><br><br><font face="Arial" color="#000063"  style="font-size: 13px;">Thank you for visiting this U.S. Bank website. We are interested in your opinions, and invite you to take a brief survey to help us understand your interest in S.T.A.R.T. so we can better serve your needs.<br>&nbsp;<br>Your answers will be anonymous and kept confidential. You will not be asked for any private information. Thank you for your time and feedback.</td></tr>';	
	// * * popupHTML += '<tr><td align="center"><br><a href="JavaScript:window.close();"><img src="/images/commercial_business/popup_survey/NoThankYou.gif" border="0"></a>&nbsp;<a href="Javascript:window.moveTo(250, 250);JavaScript:window.resizeTo(680,480);location.href=\''+surveyurl +'\';"><img src="/images/commercial_business/popup_survey/TakeSurvey.gif" border="0"></a><br></td></tr>';
	popupHTML += '<tr><td align="center"><br><a href="JavaScript:window.close();"><img src="/images/commercial_business/popup_survey/NoThankYou.gif" border="0"></a>&nbsp;<a href="JavaScript:window.resizeTo(680,480);location.href=\''+surveyurl +'\';"><img src="/images/commercial_business/popup_survey/TakeSurvey.gif" border="0"></a><br></td></tr>';
	popupHTML += '<tr><td><hr></td></tr>';
	popupHTML += '<tr><td align="center"><a href="" onClick="JavaScript:window.open(\''+infoURL +'\', \'Privacy\', \'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=680,height=480\'); return false">Privacy Pledge</a></td></tr>';
	popupHTML += '</table></body></html>';

	var popupURL = '';			// 2. Put your popup URL here
	//----- End of custom settings area
	
	//  * * Need to set date in future so cookie will not be expired
	var expirationdate = new Date('November 30, 2009 0:00:00');
	function SetCookie(sName, sValue, exp_date)
	{
		document.cookie = escape(sName) + "=" + escape(sValue) + ";path=/;expires=" + exp_date.toGMTString();
	}
	// Retrieve the value of the cookie with the specified name.

	function GetCookie(sCookie)
	{
		// Real cookie name is encoded
		var sCookieHash = escape(sCookie);
		// cookies are separated by semicolons
		var aCookie = document.cookie.split(";");
		for (var i=0; i < aCookie.length; i++)
		{
			// a name/value pair (a crumb) is separated by an equal sign
			var aCrumb = aCookie[i].split("=");
			if (sCookieHash == aCrumb[0] || ( aCrumb[0].charAt(0)==" " && sCookieHash == aCrumb[0].substr(1)))
			if(aCrumb.length==1)
				return null;
			else
				return unescape(aCrumb[1]);
		}
		// a cookie with the requested name does not exist
		return null;
	}
	
	function getRandom(number) 
	{ 
		return Math.floor( number*Math.random() ) 
	} 


	function decidePopUp(number)
	{
		if ( getRandom(number+2) > number )
		{
			return true; 
		}
		
		return false;		
	}
	
	function survey()
	{
		    if (GetCookie(CookiesName)==null)
			{
					SetCookie (CookiesName,true,expirationdate);
					defwin = window.open('', 'Survey', windowoptions);
					if (popupURL !='')
					{
						defwin.location.href = popupURL;
						// * *defwin.moveTo(250, 250);
					}
					else 
					{
						defwin.document.write(popupHTML);
						defwin.document.close();
					}
			}
	}

