// JavaScript Document

function changeLanguage(language, isCom) {
	var host = 'http://'+this.location.host;
	var hostLength = host.length;
	var URL = this.location;
	var currentURL = URL.toString();
	var currentPath = currentURL.substring(hostLength);
	if (language == 'EN' && isCom) host = 'http://www.elcomsoft.com';
	else if (language == 'EN' && !isCom) host = 'http://www.elcomsoft.co.uk';
	else if (language == 'DE') host = 'http://www.elcomsoft.de';
	else if (language == 'FR') host = 'http://www.elcomsoft.fr';
	else if (language == 'JP') host = 'http://www.elcomsoft.jp';
	else if (language == 'RU') host = 'http://www.elcomsoft.ru';
	else if (language == 'ES') host = 'http://www.elcomsoft.es';
	else if (language == 'PL') host = 'http://www.elcomsoft.pl';
	else if (language == 'IT') host = 'http://www.elcomsoft.it';
	else if (language == 'CN') host = 'http://cn.elcomsoft.com';
	pageTracker._link(this.href);
	if (language == 'EN') {
		this.location = host + currentPath;
	}
	else if (language == 'DE') {
		this.location = host + currentPath;
	}
	else if (language == 'FR') {
		this.location = host + currentPath;
	}
	else if (language == 'JP') {
		this.location = host + currentPath;
	}
	else if (language == 'RU') {
		this.location = host + currentPath;
	}
	else if (language == 'ES') {
		this.location = host + currentPath;
	}
	else if (language == 'PL') {
		this.location = host + currentPath;
	}
	else if (language == 'IT') {
		this.location = host + currentPath;
	}
	else if (language == 'CN') {
		this.location = host + currentPath;
	}
	else this.location = host;
}

function itemOn(num) {
	var image = document.images['menuitem'+num];
	image.src = '/images/menu_selected.gif';
}

function itemOff(num) {
	var image = document.images['menuitem'+num];
	image.src = '/images/spacer.gif';
}

function showImage(sImgPath, width, height) {
	var scroll = 'no';
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = 'yes';
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-68);
	window.open(sImgPath,'','scrollbars='+scroll+',resizable=yes,width='+width+',height='+height+',left='+left+',top='+top);
}