
//config changes here
parentFormId = 'survey'

//no changes below

baseURL = 'http://www.geographics-europe.com/common/survey/'
sNotCalled = -1
sLoading = 0
sLoaded = 1

sStatus = sNotCalled

function loadSurveyScript() {
    if (sStatus == sNotCalled) {
        sStatus = sLoading
        
        introNode = document.getElementById("surveyIntro")       
        introNode.innerHTML = "<img src='" + baseURL + "loading.gif'>"
        introNode.style.textAlign = "center"
        introNode.style.paddingTop = "170px"
        introNode.style.paddingBottom = "20px"
   
        var e = document.createElement("script")
        e.src = baseURL + 'survey.js.php'
        e.type="text/javascript"
        document.getElementsByTagName("head")[0].appendChild(e)
        
        startSurveyScript()
    }           
}

function startSurveyScript() {
    if (sStatus == sLoaded) {
        jsString = "startSurvey(document.getElementById('" + 
        			parentFormId + "'), '" + baseURL + "questions.xml.php" +
        			"')"
        setTimeout(jsString, 1)
    } else {
        //try again soon
        setTimeout("startSurveyScript()", 100)
    }
}
