/*
 4D (the "Software") and the corresponding source code remain
 the exclusive property of 4D and/or its licensors and are protected by national
 and/or international legislations.
 This file is part of the source code of the Software provided under the relevant
 4D License Agreement available on http://www.4D.com/license whose compliance
 constitutes a prerequisite to any use of this file and more generally of the
 Software and the corresponding source code.
 */
	
is64bits = false;
$(document).ready(initEventHandler);  
	
function initEventHandler() {	
	$("[name='close']").click(close);	
	$(".w-closebox").click(show);	
	$(document).keydown(keydown);
	
	//Development #30118 - Allow copy of version/build information
	//disabled auto-close and display a contextual menu on right click
	$("#version").click(function() {return false;}, false);	
	document.getElementById("version").addEventListener("contextmenu", function(e) {
            var text = getSelectionText();
						if (text != "") {
							waMessage('copy_'+ text);
						} 
            e.preventDefault();
        }, false);
  //--------------------------------------------------------------------------------------
	return true;
}
	
function keydown(e) {

	if (!e) e = event;

	switch (e.keyCode) {

	// escape
	case 27:

			close(); /* close dialog */
	
		break;

	default:

	}
}

function userInfos(userName, userCompany) {
	$('span#userName').text(userName);
	$('span#userCompany').text(userCompany);
}

function show(what) {

	switch (what) {

	case 'copyright':

		waMessage('copyright');

		break;

	case 'legal':

		waMessage('legal');

		break;

	case 'around':

		waMessage('around');

		break;

	default:
	
		waMessage('4dwelcome');

		break;
	}
}
