
/************************************************************************/
/* DOCEBO LMS - Learning Managment System                               */
/* ============================================                         */
/*                                                                      */
/* Copyright (c) 2004                                                   */
/* http://www.docebo.com                                                */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

var wp_output_element = false;
var wp_server_url;
var _WP = new Array();

function setup_welcomepage(passed_server_url) {
	wp_server_url = passed_server_url;
	
	var data = "op=getLang";
	var objAjax = new Ajax.Request(
        	wp_server_url,
        	{method: 'post', parameters: data, onComplete: setup_welcomepage_complete}
    );
}

function setup_welcomepage_complete(ObjReq) {

	var langText = ObjReq.responseText;
	_WP = langText.evalJSON(true);
}

function wpWarningAlert(server_url, id_course, output_element) {
	
	wp_output_element = $("output_element");

	var data = "op=getwarningalert&id_course=" + id_course;
	var objAjax = new Ajax.Request(
        	server_url,
        	{method: 'post', parameters: data, onComplete: wpWarningAlertLoaded}
    );
}

function wpWarningAlertLoaded(ObjReq) {
	
	//wp_output_element.innerHtml = ObjReq.responseText;
	alert(ObjReq.responseText);
}

function wpBecomeTeacherConfirm() {
	
	var name = "window_confirm_become";
	var title = _WP._BECOME_TEACHER;
	
	var str="";
	str += _WP._BECOME_TEACHER_LONGTEXT + '<br />';
	var butt="";
	butt += '<form method="post" action="index.php?modname=welcomepage&amp;op=addcourse">';
	butt += '<input type="submit" value="'+_WP._YES+'" /> ';
	butt += '<input type="button" value="'+_WP._NO+'" onclick="destroyWindow(\'window_confirm_become\');"; return false;" />';
	butt += '</form>';
	
	var w = new Window();
	w.id = name;
	w.width = 400;
	w.height = 125;
	w.title = title;
	w.content = str;
	w.buttons = butt;
	w.show();
}