// JavaScript Document

function loadModule(pShowLanguageBox) {
	showElement('id', 'box_language', null, pShowLanguageBox);
	showElement('id', 'box_main_company', null, false);
	showElement('id', 'box_main_products', null, false);
	showElement('id', 'box_main_service', null, false);
	showElement('id', 'box_main_news', null, false);
}

function hideMenus() {
	showElement('id', 'box_main_company', null, false);
	showElement('id', 'box_main_products', null, false);
	showElement('id', 'box_main_service', null, false);
	showElement('id', 'box_main_news', null, false);
}

function showMenuCompany() {
	showElement('id', 'box_main_company', null, true);
	showElement('id', 'box_main_products', null, false);
	showElement('id', 'box_main_service', null, false);
	showElement('id', 'box_main_news', null, false);
}

function showMenuProducts() {
	showElement('id', 'box_main_company', null, false);
	showElement('id', 'box_main_products', null, true);
	showElement('id', 'box_main_service', null, false);
	showElement('id', 'box_main_news', null, false);
}

function showMenuService() {
	showElement('id', 'box_main_company', null, false);
	showElement('id', 'box_main_products', null, false);
	showElement('id', 'box_main_service', null, true);
	showElement('id', 'box_main_news', null, false);
}

function showMenuNews() {
	showElement('id', 'box_main_company', null, false);
	showElement('id', 'box_main_products', null, false);
	showElement('id', 'box_main_service', null, false);
	showElement('id', 'box_main_news', null, true);
}

function switchMainImageDE() {
	switchMainImage('de');
}
function switchMainImageEN() {
	switchMainImage('en');
}
function switchMainImageES() {
	switchMainImage('es');
}
function switchMainImageRU() {
	switchMainImage('ru');
}
function switchMainImageZH() {
	switchMainImage('zh');
}

function switchMainImage(language) {
	var image = getElement ('id', 'mainimg');
	var attr  = getAttribute ('id', 'mainimg', null, 'name');

//	alert('Attribut: ' + attr);
//	alert('language: ' + language);

	switch (attr) {
		case "img01":
			image.src  = 'img/' + language + '/startpage_02.jpg';
			image.name = 'img02';
			break;
		case "img02":
			image.src  = 'img/' + language + '/startpage_03.jpg';
			image.name = 'img03';
			break;
		case "img03":
			image.src  = 'img/' + language + '/startpage_04.jpg';
			image.name = 'img04';
			break;
		case "img04":
			image.src  = 'img/' + language + '/startpage_01.jpg';
			image.name = 'img01';
			break;
		default:
			image.src  = 'img/' + language + '/startpage_01.jpg';
			image.name = 'img01';
			break;
	}
}

function writeCounterText(language) {
	var heute = new Date();
	var messe = new Date(2009, 10, 10); //Messebeginn 10.11.2009
	
	millisec = messe - heute;
	tage = (millisec / (1000*3600*24))+1;
	tage = parseInt(tage);
	//alert('tage: ' + tage);
	
	switch (language) {
		case "de":
			if (tage > 1) {
				document.write("<b>Noch " + tage + " Tage!</b><br>");
			} else if (tage == 1) {
				document.write("<b>Nur noch ein Tag!</b><br>");
			} 
			break;
		case "en":
			if (tage > 1) {
				document.write("<b>" + tage + " days to go!</b><br>");
			} else if (tage == 1) {
				document.write("<b>Only one day!</b><br>");
			} 
			break;
		case "es":
			if (tage > 1) {
				document.write("<b>¡" + tage + " días solamente!</b><br>");
			} else if (tage == 1) {
				document.write("<b>¡Un día solamente!</b><br>");
			} 
			break;
		case "ru":
			if (tage > 1) {
				document.write("<b>Ещё " + tage + " дней!</b><br>");
			} else if (tage == 1) {
				document.write("<b>Только ещё один день!</b><br>");
			} 
			break;
		case "zh":
			if (tage > 1) {
				document.write("<b>还有 " + tage + " 天</b><br>");
			} else if (tage == 1) {
				document.write("<b>只剩1天！</b><br>");
			} 
			break;
		default:
			if (tage > 1) {
				document.write("<b>" + tage + " days to go!</b><br>");
			} else if (tage == 1) {
				document.write("<b>Only one day!</b><br>");
			} 
			break;
	}
}

function openWindow_Detail_01() {
	win = open ('retrofit_program_detail_01.html', 'windetail',
				'width=300,height=500,left=500,top=50');
	win.moveTo (500, 50);
	win.resizeTo(300, 500);
	win.focus ();
} 

function openWindow_Detail_02() {
	win = open ('retrofit_program_detail_02.html', 'windetail',
				'width=300,height=500,left=500,top=50');
	win.moveTo (500, 50);
	win.resizeTo(300, 500);
	win.focus ();
} 

function openWindow_Detail_03() {
	win = open ('retrofit_program_detail_03.html', 'windetail',
				'width=490,height=450,left=500,top=50');
	win.moveTo (500, 50);
	win.resizeTo(490, 450);
	win.focus ();
} 

function openWindow_Detail_04() {
	win = open ('retrofit_program_detail_04.html', 'windetail',
				'width=480,height=450,left=1,top=50');
	win.moveTo (1, 50);
	win.resizeTo(480, 450);
	win.focus ();
} 

function openWindow_Detail_05() {
	win = open ('retrofit_program_detail_05.html', 'windetail',
				'width=480,height=450,left=1,top=50');
	win.moveTo (1, 50);
	win.resizeTo(480, 450);
	win.focus ();
} 

function openWindow_Detail_06() {
	win = open ('retrofit_program_detail_06.html', 'windetail',
				'width=300,height=500,left=100,top=10');
	win.moveTo (100, 10);
	win.resizeTo(300, 500);
	win.focus ();
} 

function openWindow_Detail_07() {
	win = open ('retrofit_program_detail_07.html', 'windetail',
				'width=480,height=450,left=1,top=50');
	win.moveTo (1, 50);
	win.resizeTo(480, 450);
	win.focus ();
} 

function openWindow_Detail_08() {
	win = open ('retrofit_program_detail_08.html', 'windetail',
				'width=480,height=450,screenx=1,screeny=50');
	win.moveTo (1, 50);
	win.resizeTo(480, 450);
	win.focus ();
} 

function openWindow_Detail_09() {
	win = open ('retrofit_program_detail_09.html', 'windetail',
				'width=480,height=450,screenx=1,screeny=50');
	win.moveTo (1, 50);
	win.resizeTo(480, 450);
	win.focus ();
} 
