function open_project_data(projectID) {
	if (screen) {
		l = Math.max(0, (screen.availWidth - 310));
		t = screen.availHeight - 80;
	}
	else if ((window) && (window.outerWidth)) {
    	l = Math.max(0, (window.outerWidth - 310));
    	t = window.outerHeight - 80;
    }
	else {
		l = 495;
		t = 600;
	}
	window.open('../scripts/project_data.php?id=' + projectID, 'projectData', 'toolbar=no,directiories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=300,height=' + t + ',top=0' + ',left=' + l + ',screenX=' + l + ',screenY=' + 0);
}

function open_flash(id, width, height) {
	if (screen) {
		l = Math.max(0, (screen.width - width) / 2);
		t = Math.max(0, (screen.height - height) / 2);
	}
	else if ((window) && (window.outerWidth)) {
    	l = Math.max(0, (window.outerWidth - width) / 2);
    	t = Math.max(0, (window.outerHeight - height) / 2);
    }
	else {
		l = Math.max(0, (800 - width) / 2);
		t = Math.max(0, (600 - height) / 2);
	}
	window.open('../scripts/flash.php?id=' + id, 'flash', 'toolbar=no,directiories=no,location=no,status=no,menubar=no,resizable=yes,scrollbars=no,width=' + width + ',height=' + height + ',top=' + t + ',left=' + l + ',screenX=' + l + ',screenY=' + t);
}

function position_dropdowns() {
	if (numDropdowns > 0) {
		get_client_height();
		for (n = 0; n < numDropdowns; n++) {
			ddID = dropdowns[n];
			if (dd = d.getElementById('dd' + ddID)) dd.style['top'] = clientHeight - middleTopOfset + (n * menuHeight) + 11;
		}
		dropdownsSet = true;
	}
	return true;
}

function set_active(id) {
	activeDropdown = id;
}

function show_dropdown(id) {
	activeDropdown = 0;
	h_d(0);
	if (dd = d.getElementById('dd' + id)) {
		activeDropdown = id;
		dd.style['visibility'] = 'visible';
	}
}

function hide_dropdown(id) {
	activeDropdown = 0;
	setTimeout('h_d(' + id + ')', closeDelay);
}

function h_d(id) {
	if (numDropdowns > 0) {
		if (id == 0) {
			for (n = 0; n < numDropdowns; n++) {
				ddID = dropdowns[n];
				if ((dd = d.getElementById('dd' + ddID))) dd.style['visibility'] = 'hidden';
			}
		}
		else if ((id != activeDropdown) && (dd = d.getElementById('dd' + id))) dd.style['visibility'] = 'hidden';
	}
}

function get_client_height() {
	if (document.body.offsetHeight) clientHeight = Math.round(document.body.offsetHeight / 2);
	else if (window.innerHeight) Math.round(clientHeight = window.innerHeight / 2);
}

function change_picture(mode) {
	if ((projectMoPicture) && (projectMoPicture[mode])) document.images['projMoPic'].src = projectMoPicture[mode].src;
}

function switch_menu(id, mode) {
	if ((menuImages) && (menuImages[id]) && (menuImages[id][mode])) document.images['menu' + id].src = menuImages[id][mode].src;
}

function switch_project_data_image(mode) {
	if ((projectDataImage) && (projectDataImage[mode])) document.images['projectData'].src = projectDataImage[mode].src;
}

function switch_lang_image(mode) {
	if ((langImage) && (langImage[mode])) document.images['language'].src = langImage[mode].src;
}

function switch_enter_lang(id, mode) {
	if ((enterLangImages) && (enterLangImages[id]) && (enterLangImages[id][mode])) document.images['enterLang' + id].src = enterLangImages[id][mode].src;
}

