// This JS needs the following variables to be set up on the page which it is called from:

// Delay in seconds until survey window pops - for example:
// var surveypopdelay = 7;

// Cookie expiry date - example:
// var cookieexpiry = 'Mon, 20 Oct 2004 23:59:59 GMT';

// URL or relative path of survey - example:
// var surveyurl = '/business_services/bs_survey.html';

// Height of survey window - example:
// var surveyheight = 448;

// Width of survey window - example:
// var surveywidth = 420;

function popsurvey() {

	var surveycookie = document.cookie.split("; ");
	var surveyalreadypopped = 0;
	for(var i=0; i < surveycookie.length; i++) {
		var crumb = surveycookie[i].split("=");
		if(crumb[0] == "survey") {
			if(crumb[1] == "popped") {
				surveyalreadypopped = 1;
			}
		}
	}
	if(surveyalreadypopped == 0) {
		document.cookie = 'survey=popped; expires=' + cookieexpiry + ';'
		setTimeout('opensurveywindow()', (surveypopdelay * 1000));
	}
}

function opensurveywindow() {
var winValues
	winValues = "scrollbars=no,toolbar=no,location=no,menubar=no,resizable=yes,status=no,width=" + surveywidth + ",height=" + surveyheight + ",left=50,top=50";
	window.open(surveyurl,'survey',winValues);
}


