/*
 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 display64(is64bits) {

	// $("#processor").toggleClass('cached', !eval(is64bits));
	
 	var visible = eval(is64bits);
	var icon64 = document.getElementById("processor");
	
	if (visible) {
		icon64.className= ""; 
	} else {
		icon64.className= "cached"; 
	}

}
	
function initEventHandler() {	
	$("#processor").toggleClass('cached', !is64bits);	
	$("[name='close']").click(close);	
	$(".w-closebox").click(show);	
	$(document).keydown(keydown);	
	return true;
}
	
function keydown(e) {

	if (!e) e = event;

	switch (e.keyCode) {

	// escape
	case 27:

		if (!($('#window_1').hasClass('cached'))) {

			show(); /* close pop window */

		} else {

			close(); /* close dialog */
		}

// 		return suppressdefault(e, document);
		break;

	default:

	}
}

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

function show(what) {

// 	stopTimer();

	switch (what) {

	case 'copyright':

		$('#w-title').text(wTitleCopyright);

		$('#window_1').toggleClass('cached',
				!$('#copyright').hasClass('cached'));
		$('#copyright').toggleClass('cached',
				!$('#copyright').hasClass('cached'));

		$('#legal').addClass('cached');

		break;

	case 'legal':

		$('#w-title').text(wTitleLegal);

		$('#window_1').toggleClass('cached', !$('#legal').hasClass('cached'));
		$('#legal').toggleClass('cached', !$('#legal').hasClass('cached'));

		$('#copyright').addClass('cached');

		break;

	case 'around':

		$('#window_1').addClass('cached');
		$('#legal').addClass('cached');
		$('#copyright').addClass('cached');

		waMessage('around');

		break;

	default:

		$('#window_1').addClass('cached');
		$('#legal').addClass('cached');
		$('#copyright').addClass('cached');
	}
}
