function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

var showSurvey = 'NO';
if (showSurvey == 'YES' && strLanguage == 'de') {
	var surveyCookieexpdate = new Date();
	var maxPageViews = 5;
	surveyCookieexpdate.setTime(surveyCookieexpdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
	var surveyPageCountFromCookie = xGetCookie('SURVEYDAT') * 1;
	if (surveyPageCountFromCookie >= maxPageViews) {
		redirToSurvey();
	}
	xSetCookie('SURVEYDAT', surveyPageCountFromCookie + 1, surveyCookieexpdate, '')
}

function redirToSurvey() {
	if (xGetCookie('SURVEYDONE') != 'YES' && xGetCookie('BUGMENOMORE') != 'YES') {
		if (confirm('Bitte helfen Sie uns, diese Giant Homepage noch weiter zu verbessern.\nKlicken Sie auf "OK", um einen kurzen Fragebogen auszuf\u00FCllen. Klicken Sie auf "Abbrechen", um nicht an der Umfrage teilzunehmen.')) {
			xSetCookie('SURVEYDONE', 'YES', surveyCookieexpdate, '')
			window.location.href = '/' + strLanguage + '/090.000.000/090.000.000.asp'
		} else {
			xSetCookie('BUGMENOMORE', 'YES', surveyCookieexpdate, '')
		}
	}
}