// 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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', 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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', 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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', 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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', 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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', null, false);
}

function showMenuParts() {
	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_parts', null, true);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', 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_parts', null, false);
	showElement('id', 'box_main_news', null, true);
	showElement('id', 'box_main_contact', null, false);
}

function showMenuContact() {
	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_parts', null, false);
	showElement('id', 'box_main_news', null, false);
	showElement('id', 'box_main_contact', null, true);
}

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

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

	switch (attr) {
		case "img01":
			image.src  = 'img/startpage_02.jpg';
			image.name = 'img02';
			break;
		case "img02":
			image.src  = 'img/startpage_03.jpg';
			image.name = 'img03';
			break;
		case "img03":
			image.src  = 'img/startpage_04.jpg';
			image.name = 'img04';
			break;
		case "img04":
			image.src  = 'img/startpage_01.jpg';
			image.name = 'img01';
			break;
		default:
			image.src  = 'img/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);
	
	if (tage > 1) {
		document.write("<b>" + tage + " days to go!</b><br>");
	} else if (tage == 1) {
		document.write("<b>Only one day!</b><br>");
	} 
}
