/* -----------------------------------------------------------------------------
function: openUploadPopup (contribId, typeName)

Function for closing a window on a timeout
----------------------------------------------------------------------------- */
function openUploadPopup (contribId, typeName) {

    // Open a popup window
    window.open ('upload.php?contribId=' + contribId + '&type=' + typeName, 'uploadPopup', 'width=400,height=300, scrollbars=0');
}


/* -----------------------------------------------------------------------------
function: notifyFlash ()

Notifies flash (on successfull submission) of uploads.
----------------------------------------------------------------------------- */
function notifyFlash () {

    // Create the flash object
    var FO = { movie:"swf/uploadStart.swf", width:"1px", height:"1px", majorversion:"7", build:"0", flashvars:"connectionName=_lc_/tbl-jj_upload", wmode:"transparent"};

    // And display it
    UFO.create (FO, "uploadFlash");

    // Return success
    return true;
}

function killPlayer() {
    var embElm  = document.getElementById('objPlayer');
    if ( embElm )
        embElm.SetVariable( 'kill', 'true' );
}

window.onload = function() {
    if ( window.location.href.indexOf('broadcast/index.php') >= 1) {
	    var aElements = document.body.getElementsByTagName('a');

	    for (var i = 0; i < aElements.length; i++) {
	        if ( aElements[i] )
	            aElements[i].onclick = killPlayer;
	    }
    }
}

function validateQuiz() {
    if (this.document.getElementById('poll_name').value == '') {
        alert('Je hebt geen naam opgegeven.');
        return false;
    } else if (this.document.getElementById('poll_email').value == '') {
        alert('Je hebt geen e-mail opgegeven.');
		return false;
    } else {
        alert('test');
        return true;
    }
}